[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKOZueu2wdkeUFYLQ8qE48yJs1_uRz-9RVJRkp==CL=jp=Q8+g@mail.gmail.com>
Date: Fri, 12 Oct 2018 19:25:08 -0700
From: Daniel Colascione <dancol@...gle.com>
To: Joel Fernandes <joel@...lfernandes.org>
Cc: David Miller <davem@...emloft.net>, kirill@...temov.name,
linux-kernel <linux-kernel@...r.kernel.org>,
kernel-team@...roid.com, Minchan Kim <minchan@...nel.org>,
Ramon Pantin <pantin@...gle.com>,
Hugh Dickins <hughd@...gle.com>,
Lokesh Gidra <lokeshgidra@...gle.com>,
Michal Hocko <mhocko@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
aryabinin@...tuozzo.com, luto@...nel.org, bp@...en8.de,
catalin.marinas@....com, Chris Zankel <chris@...kel.net>,
dave.hansen@...ux.intel.com, elfring@...rs.sourceforge.net,
fenghua.yu@...el.com, geert@...ux-m68k.org, gxt@....edu.cn,
deller@....de, mingo@...hat.com, jejb@...isc-linux.org,
jdike@...toit.com, Jonas Bonn <jonas@...thpole.se>,
Julia Lawall <Julia.Lawall@...6.fr>,
kasan-dev@...glegroups.com, kvmarm@...ts.cs.columbia.edu,
lftan@...era.com, linux-alpha@...r.kernel.org,
linux-hexagon@...r.kernel.org, linux-ia64@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org, linux-mips@...ux-mips.org,
linux-mm <linux-mm@...ck.org>, linux-parisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org, linux-sh@...r.kernel.org,
linux-snps-arc@...ts.infradead.org, linux-um@...ts.infradead.org,
linux-xtensa@...ux-xtensa.org, Max Filippov <jcmvbkbc@...il.com>,
nios2-dev@...ts.rocketboards.org,
Peter Zijlstra <peterz@...radead.org>, richard@....at
Subject: Re: [PATCH v2 2/2] mm: speed up mremap by 500x on large regions
On Fri, Oct 12, 2018 at 7:10 PM, Joel Fernandes <joel@...lfernandes.org> wrote:
> On Fri, Oct 12, 2018 at 06:54:33PM -0700, Daniel Colascione wrote:
>> I wonder whether it makes sense to expose to userspace somehow whether
>> mremap is "fast" for a particular architecture. If a feature relies on
>> fast mremap, it might be better for some userland component to disable
>> that feature entirely rather than blindly use mremap and end up
>> performing very poorly. If we're disabling fast mremap when THP is
>> enabled, the userland component can't just rely on an architecture
>> switch and some kind of runtime feature detection becomes even more
>> important.
>
> I hate to point out that its forbidden to top post on LKML :-)
> https://kernelnewbies.org/mailinglistguidelines
> So don't that Mr. Dan! :D
Guilty as charged. I really should switch back to Gnus. :-)
> But anyway, I think this runtime detection thing is not needed. THP is
> actually expected to be as fast as this anyway, so if that's available then
> we should already be as fast.
Ah, I think the commit message is confusing. (Or else I'm misreading
the patch now.) It's not quite that we're disabling the feature when
THP is enabled anywhere, but rather that we use the move_huge_pmd path
for huge PMDs and use the new code only for non-huge PMDs. (Right?) If
that's the case, the commit message shouldn't say "Incase THP is
enabled, the optimization is skipped". Even if THP is enabled on a
system generally, we might use the new PMD-moving code for mapping
types that don't support THP-ization, right?
> This is for non-THP where THP cannot be enabled
> and there is still room for some improvement. Most/all architectures will be
> just fine with this. This flag is more of a safety-net type of thing where in
> the future if there is this one or two weird architectures that don't play
> well, then they can turn it off at the architecture level by not selecting
> the flag. See my latest patches for the per-architecture compile-time
> controls. Ideally we'd like to blanket turn it on on all, but this is just
> playing it extra safe as Kirill and me were discussing on other threads.
Sure. I'm just pointing out that the 500x performance different turns
the operation into a qualitatively different feature, so if we expect
to actually ship a mainstream architecture without support for this
thing, we should make it explicit. If we're not, we shouldn't.
Powered by blists - more mailing lists