From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Dave Jones <davej@redhat.com>,
"linux-kernel@vger.kernel.org List"
<linux-kernel@vger.kernel.org>
Subject: Re: New RCU related warning due to rcu_preempt_depth() changes
Date: Tue, 17 Apr 2012 08:05:56 -0700 [thread overview]
Message-ID: <20120417150556.GB2404@linux.vnet.ibm.com> (raw)
In-Reply-To: <CA+1xoqdJjTe+BMe_ebMBSg57gs2FA60T_0WKhrHvfDoE8AvCuw@mail.gmail.com>
On Tue, Apr 17, 2012 at 10:42:47AM +0200, Sasha Levin wrote:
> Hi Paul,
>
> It looks like commit 7298b03 ("rcu: Move __rcu_read_lock() and
> __rcu_read_unlock() to per-CPU variables") is causing the following
> warning (I've added the extra fields on the second line):
>
> [ 77.330920] BUG: sleeping function called from invalid context at
> mm/memory.c:3933
> [ 77.336571] in_atomic(): 0, irqs_disabled(): 0, preempt count: 0,
> preempt offset: 0, rcu depth: 1, pid: 5669, name: trinity
> [ 77.344135] no locks held by trinity/5669.
> [ 77.349644] Pid: 5669, comm: trinity Tainted: G W
> 3.4.0-rc3-next-20120417-sasha-dirty #83
> [ 77.354401] Call Trace:
> [ 77.355956] [<ffffffff810e83f3>] __might_sleep+0x1f3/0x210
> [ 77.358811] [<ffffffff81198eaf>] might_fault+0x2f/0xa0
> [ 77.361997] [<ffffffff810e3228>] schedule_tail+0x88/0xb0
> [ 77.364671] [<ffffffff826a01d3>] ret_from_fork+0x13/0x80
>
> As you can see, rcu_preempt_depth() returns 1 when running in that
> context, which looks pretty odd.
Ouch!!!
So it looks like I missed a place where I need to save and restore
the new per-CPU rcu_read_lock_nesting and rcu_read_unlock_special
variables. My (probably hopelessly naive) guess is that I need to add
a rcu_switch_from() and rcu_switch_to() into schedule_tail(), but to
make rcu_switch_from() take the task_struct pointer as an argument,
passing in prev.
Does this make sense, or am I still missing something here?
Thanx, Paul
next prev parent reply other threads:[~2012-04-17 15:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 8:42 New RCU related warning due to rcu_preempt_depth() changes Sasha Levin
2012-04-17 15:05 ` Paul E. McKenney [this message]
2012-04-17 15:36 ` Sasha Levin
2012-04-17 15:53 ` Paul E. McKenney
2012-04-17 16:45 ` Paul E. McKenney
2012-04-18 5:29 ` Sasha Levin
2012-04-18 14:11 ` Paul E. McKenney
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=20120417150556.GB2404@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=davej@redhat.com \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.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