From: Peter Zijlstra <peterz@infradead•org>
To: Andy Lutomirski <luto@kernel•org>
Cc: Rik van Riel <riel@surriel•com>,
Vitaly Kuznetsov <vkuznets@redhat•com>,
Juergen Gross <jgross@suse•com>,
Boris Ostrovsky <boris.ostrovsky@oracle•com>,
linux-arch <linux-arch@vger•kernel.org>,
Will Deacon <will.deacon@arm•com>,
Catalin Marinas <catalin.marinas@arm•com>,
linux-s390@vger•kernel.org,
Benjamin Herrenschmidt <benh@kernel•crashing.org>,
linuxppc-dev <linuxppc-dev@lists•ozlabs.org>,
LKML <linux-kernel@vger•kernel.org>, X86 ML <x86@kernel•org>,
Mike Galbraith <efault@gmx•de>, kernel-team <kernel-team@fb•com>,
Ingo Molnar <mingo@kernel•org>,
Dave Hansen <dave.hansen@intel•com>
Subject: Re: [PATCH 4/7] x86,tlb: make lazy TLB mode lazier
Date: Fri, 20 Jul 2018 10:30:16 +0200 [thread overview]
Message-ID: <20180720083016.GN2494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CALCETrXLMsSBChDvrms-omwYV4LHT30GenDjbnD-+LTg55yPow@mail.gmail.com>
On Thu, Jul 19, 2018 at 10:04:09AM -0700, Andy Lutomirski wrote:
> I added some more arch maintainers. The idea here is that, on x86 at
> least, task->active_mm and all its refcounting is pure overhead. When
> a process exits, __mmput() gets called, but the core kernel has a
> longstanding "optimization" in which other tasks (kernel threads and
> idle tasks) may have ->active_mm pointing at this mm. This is nasty,
> complicated, and hurts performance on large systems, since it requires
> extra atomic operations whenever a CPU switches between real users
> threads and idle/kernel threads.
>
> It's also almost completely worthless on x86 at least, since __mmput()
> frees pagetables, and that operation *already* forces a remote TLB
> flush, so we might as well zap all the active_mm references at the
> same time.
So I disagree that active_mm is complicated (the code is less than ideal
but that is actually fixable). And aside from the process exit case, it
does avoid CR3 writes when switching between user and kernel threads
(which can be far more often than exit if you have longer running
tasks).
Now agreed, recent x86 work has made that less important.
And I of course also agree that not doing those refcount atomics is
better.
next prev parent reply other threads:[~2018-07-20 8:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180716190337.26133-1-riel@surriel.com>
[not found] ` <20180716190337.26133-5-riel@surriel.com>
[not found] ` <CALCETrUMntRe_LYX5wj9YD4xZ+84QExK+ZNb3yxEBDEKa7nePQ@mail.gmail.com>
[not found] ` <B6566AA4-2E8A-43BD-A224-0F6D4747B8FB@surriel.com>
[not found] ` <F93A3335-4830-4E36-9179-D0FA5D640C8A@amacapital.net>
[not found] ` <B976CC13-D014-433A-83DE-F8DF9AB4F421@surriel.com>
[not found] ` <CALCETrWDiMhgiR3f8n0jdWcW31EDJ+Waq0wh5sMDutfigANGnA@mail.gmail.com>
2018-07-19 17:04 ` [PATCH 4/7] x86,tlb: make lazy TLB mode lazier Andy Lutomirski
2018-07-20 4:57 ` Benjamin Herrenschmidt
2018-07-20 8:30 ` Peter Zijlstra [this message]
2018-07-23 12:26 ` Rik van Riel
2018-07-24 16:33 ` Will Deacon
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=20180720083016.GN2494@hirez.programming.kicks-ass.net \
--to=peterz@infradead$(echo .)org \
--cc=benh@kernel$(echo .)crashing.org \
--cc=boris.ostrovsky@oracle$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=dave.hansen@intel$(echo .)com \
--cc=efault@gmx$(echo .)de \
--cc=jgross@suse$(echo .)com \
--cc=kernel-team@fb$(echo .)com \
--cc=linux-arch@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=luto@kernel$(echo .)org \
--cc=mingo@kernel$(echo .)org \
--cc=riel@surriel$(echo .)com \
--cc=vkuznets@redhat$(echo .)com \
--cc=will.deacon@arm$(echo .)com \
--cc=x86@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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