From: Peter Zijlstra <peterz@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, LKML <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>,
Christoph Hellwig <hch@lst.de>,
Matthew Wilcox <willy@infradead.org>,
Daniel Vetter <daniel@ffwll.ch>,
Andrew Morton <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>, Ingo Molnar <mingo@kernel.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>,
Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: [patch V4 4/8] sched: Make migrate_disable/enable() independent of RT
Date: Fri, 20 Nov 2020 10:29:28 +0100 [thread overview]
Message-ID: <20201120092928.GA3021@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <87tutkolq1.fsf@nanos.tec.linutronix.de>
On Fri, Nov 20, 2020 at 02:33:58AM +0100, Thomas Gleixner wrote:
> On Thu, Nov 19 2020 at 19:28, Peter Zijlstra wrote:
> > On Thu, Nov 19, 2020 at 09:23:47AM -0800, Linus Torvalds wrote:
> >> Because this is certainly not the only time migration limiting has
> >> come up, and no, it has absolutely nothing to do with per-cpu page
> >> tables being completely unacceptable.
> >
> > It is for this instance; but sure, it's come up before in other
> > contexts.
>
> Indeed. And one of the really bad outcomes of this is that people are
> forced to use preempt_disable() to prevent migration which entails a
> slew of consequences:
>
> - Using spinlocks where it wouldn't be needed otherwise
> - Spinwaiting instead of sleeping
> - The whole crazyness of doing copy_to/from_user_in_atomic() along
> with the necessary out of line error handling.
> - ....
>
> The introduction of per-cpu storage happened almost 20 years ago (2002)
> and still the only answer we have is preempt_disable().
IIRC the first time this migrate_disable() stuff came up was when Chris
Lameter did SLUB. Eventually he settled for that cmpxchg_double()
approach (which is somewhat similar to userspace rseq) which is vastly
superiour and wouldn't have happened had we provided migrate_disable().
As already stated, per-cpu page-tables would allow for a much saner kmap
approach, but alas, x86 really can't sanely do that (the archs that have
separate kernel and user page-tables could do this, and how we cursed
x86 didn't have that when meltdown happened).
[ and using fixmaps in the per-cpu memory space _could_ work, but is a
giant pain because then all accesses need GS prefix and blah... ]
And I'm sure there's creative ways for other problems too, but yes, it's
hard.
Anyway, clearly I'm the only one that cares, so I'll just crawl back
under my rock...
next prev parent reply other threads:[~2020-11-20 9:29 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 19:48 [patch V4 0/8] mm/highmem: Preemptible variant of kmap_atomic & friends Thomas Gleixner
2020-11-18 19:48 ` [patch V4 1/8] mm/highmem: Provide and use CONFIG_DEBUG_KMAP_LOCAL Thomas Gleixner
2020-11-18 19:48 ` [patch V4 2/8] mm/highmem: Provide CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP Thomas Gleixner
2020-11-18 21:13 ` Linus Torvalds
2020-11-19 8:46 ` Mel Gorman
2020-11-19 17:19 ` Linus Torvalds
2020-11-18 19:48 ` [patch V4 3/8] x86: Support kmap_local() forced debugging Thomas Gleixner
2021-01-06 23:01 ` [BUG] from " Steven Rostedt
2021-01-07 1:03 ` Linus Torvalds
2021-01-07 1:16 ` Steven Rostedt
2021-01-07 1:49 ` Steven Rostedt
2021-01-07 1:49 ` Jakub Kicinski
2021-01-07 2:11 ` Willem de Bruijn
2021-01-07 4:44 ` Willem de Bruijn
2021-01-07 19:47 ` Linus Torvalds
2021-01-07 20:52 ` Steven Rostedt
2021-01-07 21:07 ` Willem de Bruijn
2020-11-18 19:48 ` [patch V4 4/8] sched: Make migrate_disable/enable() independent of RT Thomas Gleixner
2020-11-19 9:38 ` Mel Gorman
2020-11-19 11:14 ` Peter Zijlstra
2020-11-19 12:14 ` Mel Gorman
2020-11-19 14:17 ` Steven Rostedt
2020-11-19 17:23 ` Linus Torvalds
2020-11-19 18:28 ` Peter Zijlstra
2020-11-20 1:33 ` Thomas Gleixner
2020-11-20 9:29 ` Peter Zijlstra [this message]
2020-11-22 23:16 ` Andy Lutomirski
2020-11-23 21:15 ` Thomas Gleixner
2020-11-23 21:25 ` Thomas Gleixner
2020-11-23 22:07 ` Andy Lutomirski
2020-11-23 23:10 ` Thomas Gleixner
2020-11-18 19:48 ` [patch V4 5/8] sched: highmem: Store local kmaps in task struct Thomas Gleixner
2020-11-19 11:33 ` Peter Zijlstra
2020-11-19 11:51 ` Peter Zijlstra
2020-11-19 12:12 ` Peter Zijlstra
2020-11-19 14:11 ` Thomas Gleixner
2020-11-18 19:48 ` [patch V4 6/8] mm/highmem: Provide kmap_local* Thomas Gleixner
2020-11-18 19:48 ` [patch V4 7/8] io-mapping: Provide iomap_local variant Thomas Gleixner
2020-11-18 19:48 ` [patch V4 8/8] x86/crashdump/32: Simplify copy_oldmem_page() Thomas Gleixner
2020-11-24 8:03 ` [patch V4 0/8] mm/highmem: Preemptible variant of kmap_atomic & friends Peter Zijlstra
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=20201120092928.GA3021@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=daniel@ffwll.ch \
--cc=dietmar.eggemann@arm.com \
--cc=hch@lst.de \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=willy@infradead.org \
--cc=x86@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