From: Robin Murphy <robin.murphy@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>,
Prathu Baronia <prathubaronia2011@gmail.com>,
Prathu Baronia <prathu.baronia@oneplus.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
linux-kernel@vger.kernel.org, chintan.pandya@oneplus.com,
"glider@google.com" <glider@google.com>,
Andrey Konovalov <andreyknvl@google.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Andrew Morton <akpm@linux-foundation.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/1] mm: Optimizing hugepage zeroing in arm64
Date: Fri, 22 Jan 2021 12:45:55 +0000 [thread overview]
Message-ID: <d9a5beaa-2927-3c0b-80ed-2735f72db247@arm.com> (raw)
In-Reply-To: <20210122121334.GC8567@gaia>
On 2021-01-22 12:13, Catalin Marinas wrote:
> On Thu, Jan 21, 2021 at 06:59:37PM +0000, Robin Murphy wrote:
>> On 2021-01-21 17:46, Will Deacon wrote:
>>> On Thu, Jan 21, 2021 at 10:21:50PM +0530, Prathu Baronia wrote:
>>>> This patch removes the unnecessary kmap calls in the hugepage zeroing path and
>>>> improves the timing by 62%.
>>>>
>>>> I had proposed a similar change in Apr-May'20 timeframe in memory.c where I
>>>> proposed to clear out a hugepage by directly calling a memset over the whole
>>>> hugepage but got the opposition that the change was not architecturally neutral.
>>>>
>>>> Upon revisiting this now I see significant improvement by removing around 2k
>>>> barrier calls from the zeroing path. So hereby I propose an arm64 specific
>>>> definition of clear_user_highpage().
>>>
>>> Given that barrier() is purely a thing for the compiler, wouldn't the same
>>> change yield a benefit on any other architecture without HIGHMEM? In which
>>> case, I think this sort of change belongs in the core code if it's actually
>>> worthwhile.
>>
>> I would have thought it's more the constant manipulation of the preempt and
>> pagefault counts, rather than the compiler barriers between them, that has
>> the impact. Either way, if arm64 doesn't need to be atomic WRT preemption
>> when clearing parts of hugepages then I also can't imagine that anyone else
>> (at least for !HIGHMEM) would either.
>
> I thought the kmap_local stuff was supposed to fix this unnecessary
> preemption disabling on 64-bit architectures:
>
> https://lwn.net/Articles/836144/
>
> I guess it's not there yet.
No, it's there alright - when I pulled up the code to double-check my
memory of this area, I did notice the kerneldoc and start wondering if
this should simply be using kmap_local_page() for everyone.
Robin.
prev parent reply other threads:[~2021-01-22 12:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 16:51 [PATCH 0/1] mm: Optimizing hugepage zeroing in arm64 Prathu Baronia
2021-01-21 16:51 ` [PATCH 1/1] " Prathu Baronia
2021-01-21 17:46 ` [PATCH 0/1] " Will Deacon
2021-01-21 18:59 ` Robin Murphy
2021-01-22 12:13 ` Catalin Marinas
2021-01-22 12:45 ` Robin Murphy [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=d9a5beaa-2927-3c0b-80ed-2735f72db247@arm.com \
--to=robin.murphy@arm.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=chintan.pandya@oneplus.com \
--cc=geert@linux-m68k.org \
--cc=glider@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=prathu.baronia@oneplus.com \
--cc=prathubaronia2011@gmail.com \
--cc=vincenzo.frascino@arm.com \
--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;
as well as URLs for NNTP newsgroup(s).