From: Peter Zijlstra <peterz@infradead.org>
To: balbir@linux.vnet.ibm.com
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org,
Nick Piggin <nickpiggin@yahoo.com.au>,
Rik van Riel <riel@redhat.com>
Subject: Re: [RFC][PATCH] mm: couple rcu and memory reclaim
Date: Mon, 24 Sep 2007 14:58:55 +0200 [thread overview]
Message-ID: <20070924145855.662b1489@twins> (raw)
In-Reply-To: <46F7B21E.3030007@linux.vnet.ibm.com>
On Mon, 24 Sep 2007 18:18:30 +0530 Balbir Singh
<balbir@linux.vnet.ibm.com> wrote:
> Peter Zijlstra wrote:
> >>> Only kswapd can do this, direct reclaim has deadlock potential.
> >> Yes, but not in all cases, do you want to add any gfp_mask
> >> based smartness for direct reclaim?
> >
> > gfp_mask doesn't carry the needed information. It depends on whether
> > the current context holds a rcu_read_lock().
> >
>
> What I meant was that nobody would hold rcu_read_lock() and pass
> gfp_mask of GFP_KERNEL in scan_control or to do_try_to_free_pages()
>
> > so something like:
> >
> > rcu_read_lock()
> > foo = kmalloc(sizeof(foo))
>
> At this point, you really can't use GFP_KERNEL, since rcu_read_lock()
> disables pre-emption in the current kernel, ideally you should see
> a might_sleep() BUG.
>
> > new_slab()
> > __alloc_pages()
> > try_to_free_pages()
> > synchronise_rcu() <-- deadlock
> > rcu_read_unlock()
I guess I've been using preemptibe rcu for way too long. Would need to
clean up some of -rt to make this true there, but should be doable
indeed.
next prev parent reply other threads:[~2007-09-24 12:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-24 8:45 [RFC][PATCH] mm: couple rcu and memory reclaim Peter Zijlstra
2007-09-24 10:42 ` Balbir Singh
2007-09-24 11:06 ` Peter Zijlstra
2007-09-24 11:22 ` Balbir Singh
2007-09-24 11:50 ` Peter Zijlstra
2007-09-24 12:48 ` Balbir Singh
2007-09-24 12:58 ` Peter Zijlstra [this message]
2007-09-28 20:13 ` Nick Piggin
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=20070924145855.662b1489@twins \
--to=peterz@infradead.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=paulmck@linux.vnet.ibm.com \
--cc=riel@redhat.com \
/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