From: Catalin Marinas <catalin.marinas@arm.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
Andrey Konovalov <andreyknvl@google.com>,
Prathu Baronia <prathu.baronia@oneplus.com>,
linux-kernel@vger.kernel.org,
Prathu Baronia <prathubaronia2011@gmail.com>,
chintan.pandya@oneplus.com,
"glider@google.com" <glider@google.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Andrew Morton <akpm@linux-foundation.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/1] mm: Optimizing hugepage zeroing in arm64
Date: Fri, 22 Jan 2021 12:13:35 +0000 [thread overview]
Message-ID: <20210122121334.GC8567@gaia> (raw)
In-Reply-To: <de782758-a7bc-d5a5-832e-c09ce8fe7c00@arm.com>
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.
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Robin Murphy <robin.murphy@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:13:35 +0000 [thread overview]
Message-ID: <20210122121334.GC8567@gaia> (raw)
In-Reply-To: <de782758-a7bc-d5a5-832e-c09ce8fe7c00@arm.com>
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.
--
Catalin
next prev parent reply other threads:[~2021-01-22 12:15 UTC|newest]
Thread overview: 12+ 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 ` Prathu Baronia
2021-01-21 16:51 ` [PATCH 1/1] " Prathu Baronia
2021-01-21 16:51 ` Prathu Baronia
2021-01-21 17:46 ` [PATCH 0/1] " Will Deacon
2021-01-21 17:46 ` Will Deacon
2021-01-21 18:59 ` Robin Murphy
2021-01-21 18:59 ` Robin Murphy
2021-01-22 12:13 ` Catalin Marinas [this message]
2021-01-22 12:13 ` Catalin Marinas
2021-01-22 12:45 ` Robin Murphy
2021-01-22 12:45 ` Robin Murphy
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=20210122121334.GC8567@gaia \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=anshuman.khandual@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=robin.murphy@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.