From: Mel Gorman <mgorman@techsingularity.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Michal Hocko <mhocko@kernel.org>,
Christoph Lameter <cl@linux.com>,
Vlastimil Babka <vbabka@suse.cz>,
Dmitry Vyukov <dvyukov@google.com>, Tejun Heo <tj@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
syzkaller <syzkaller@googlegroups.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: mm: deadlock between get_online_cpus/pcpu_alloc
Date: Wed, 8 Feb 2017 12:26:12 +0000 [thread overview]
Message-ID: <20170208122612.wasq72hbj4nkh7y3@techsingularity.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1702081253590.3536@nanos>
On Wed, Feb 08, 2017 at 01:02:07PM +0100, Thomas Gleixner wrote:
> On Wed, 8 Feb 2017, Michal Hocko wrote:
> > On Tue 07-02-17 23:25:17, Thomas Gleixner wrote:
> > > On Tue, 7 Feb 2017, Christoph Lameter wrote:
> > > > On Tue, 7 Feb 2017, Michal Hocko wrote:
> > > >
> > > > > I am always nervous when seeing hotplug locks being used in low level
> > > > > code. It has bitten us several times already and those deadlocks are
> > > > > quite hard to spot when reviewing the code and very rare to hit so they
> > > > > tend to live for a long time.
> > > >
> > > > Yep. Hotplug events are pretty significant. Using stop_machine_XXXX() etc
> > > > would be advisable and that would avoid the taking of locks and get rid of all the
> > > > ocmplexity, reduce the code size and make the overall system much more
> > > > reliable.
> > >
> > > Huch? stop_machine() is horrible and heavy weight. Don't go there, there
> > > must be simpler solutions than that.
> >
> > Absolutely agreed. We are in the page allocator path so using the
> > stop_machine* is just ridiculous. And, in fact, there is a much simpler
> > solution [1]
> >
> > [1] http://lkml.kernel.org/r/20170207201950.20482-1-mhocko@kernel.org
>
> Well, yes. It's simple, but from an RT point of view I really don't like
> it as we have to fix it up again.
>
> On RT we solved the problem of the page allocator differently which allows
> us to do drain_all_pages() from the caller CPU as a side effect. That's
> interesting not only for RT, it's also interesting for NOHZ FULL scenarios
> because you don't inflict the work on the other CPUs.
>
> https://git.kernel.org/cgit/linux/kernel/git/rt/linux-rt-devel.git/commit/?h=linux-4.9.y-rt-rebase&id=d577a017da694e29a06af057c517f2a7051eb305
>
It may be worth noting that patches in Andrew's tree no longer disable
interrupts in the per-cpu allocator and now per-cpu draining will
be from workqueue context. The reasoning was due to the overhead of
the page allocator with figures included. Interrupts will bypass the
per-cpu allocator and use the irq-safe zone->lock to allocate from
the core. It'll collide with the RT patch. Primary patch of interest is
http://www.ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-only-use-per-cpu-allocator-for-irq-safe-requests.patch
The draining from workqueue context may be a problem for RT but one
option would be to move the drain to only drain for high-order pages
after direct reclaim combined with only draining for order-0 if
__alloc_pages_may_oom is about to be called.
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-02-08 12:26 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-29 12:44 Dmitry Vyukov
2017-01-29 17:22 ` Vlastimil Babka
2017-01-30 15:48 ` Dmitry Vyukov
2017-02-06 19:13 ` Dmitry Vyukov
2017-02-06 22:05 ` Mel Gorman
2017-02-07 8:48 ` Michal Hocko
2017-02-07 9:23 ` Vlastimil Babka
2017-02-07 9:46 ` Mel Gorman
2017-02-07 9:53 ` Michal Hocko
2017-02-07 10:42 ` Mel Gorman
2017-02-07 11:13 ` Mel Gorman
2017-02-07 9:43 ` Mel Gorman
2017-02-07 9:49 ` Vlastimil Babka
2017-02-07 10:05 ` Michal Hocko
2017-02-07 10:28 ` Mel Gorman
2017-02-07 10:35 ` Michal Hocko
2017-02-07 11:34 ` Mel Gorman
2017-02-07 11:43 ` Michal Hocko
2017-02-07 11:54 ` Vlastimil Babka
2017-02-07 12:08 ` Michal Hocko
2017-02-07 12:37 ` Michal Hocko
2017-02-07 12:43 ` Vlastimil Babka
2017-02-07 12:48 ` Michal Hocko
2017-02-07 13:57 ` Vlastimil Babka
2017-02-07 13:58 ` Mel Gorman
2017-02-07 14:19 ` Michal Hocko
2017-02-07 15:34 ` Michal Hocko
2017-02-07 16:22 ` Mel Gorman
2017-02-07 16:41 ` Michal Hocko
2017-02-07 16:55 ` Christoph Lameter
2017-02-07 22:25 ` Thomas Gleixner
2017-02-08 7:35 ` Michal Hocko
2017-02-08 12:02 ` Thomas Gleixner
2017-02-08 12:21 ` Michal Hocko
2017-02-08 12:26 ` Mel Gorman [this message]
2017-02-08 13:23 ` Thomas Gleixner
2017-02-08 14:03 ` Mel Gorman
2017-02-08 14:11 ` Peter Zijlstra
2017-02-08 15:11 ` Christoph Lameter
2017-02-08 15:21 ` Michal Hocko
2017-02-08 16:17 ` Christoph Lameter
2017-02-08 17:46 ` Thomas Gleixner
2017-02-09 3:15 ` Christoph Lameter
2017-02-09 11:42 ` Thomas Gleixner
2017-02-09 14:00 ` Christoph Lameter
2017-02-09 14:53 ` Thomas Gleixner
2017-02-09 15:42 ` Christoph Lameter
2017-02-09 16:12 ` Thomas Gleixner
2017-02-09 17:22 ` Christoph Lameter
2017-02-09 17:40 ` Thomas Gleixner
2017-02-09 19:15 ` Michal Hocko
2017-02-10 17:58 ` Christoph Lameter
2017-02-08 15:06 ` Christoph Lameter
2017-02-07 17:03 ` Tejun Heo
2017-02-07 20:16 ` Michal Hocko
2017-02-07 13:03 ` Mel Gorman
2017-02-07 13:48 ` Michal Hocko
2017-02-07 11:24 ` Tetsuo Handa
2017-02-07 8:43 ` Michal Hocko
2017-02-07 21:53 ` Thomas Gleixner
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=20170208122612.wasq72hbj4nkh7y3@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=dvyukov@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=syzkaller@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=vbabka@suse.cz \
/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