From: Liam Howlett <liam.howlett@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Mark Brown <broonie@kernel.org>, Will Deacon <will@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH] mm/mprotect: Fix maple tree start address in do_mprotect_pkey()
Date: Fri, 26 Aug 2022 03:27:34 +0000 [thread overview]
Message-ID: <20220826032728.c5zw3bh4pmbz66dp@revolver> (raw)
In-Reply-To: <20220825180614.0ea05648f898bfa17f95a83c@linux-foundation.org>
* Andrew Morton <akpm@linux-foundation.org> [220825 21:06]:
> On Thu, 25 Aug 2022 20:30:24 +0000 Liam Howlett <liam.howlett@oracle.com> wrote:
>
> > Use the untagged_addr() instead of the address passed into the function.
>
> What are the runtime effects of this fix?
Prior to my change to use the maple tree, the start address was changed
before calling find_vma() with the untagged_addr() version of start. My
first change recorded the tagged address and searched on the incorrect
start location - which would have found the incorrect VMA. This fix
will use the untagged_addr() as the start of the search as it was
before I changed the code at all.
Any penalty of calling untagged_addr() occurred regardless of the
version that was used. The search of the maple tree would have also
occurred in both versions - just at the wrong location before this fix.
I expect that the execution time would be equal as the search on the
tagged address would have either returned a VMA at start, or the VMA in
the next slot in the maple tree node - probably immeasurably slower
since the data is very likely already in the CPU cache, but I don't have
hard data to say either way. I can look into a benchmark to measure the
difference between both working versions, but I don't have an arm64
native target so it will be emulated.
prev parent reply other threads:[~2022-08-26 3:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 20:30 Liam Howlett
2022-08-26 1:06 ` Andrew Morton
2022-08-26 3:27 ` Liam Howlett [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220826032728.c5zw3bh4pmbz66dp@revolver \
--to=liam.howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-next@vger.kernel.org \
--cc=maple-tree@lists.infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox