From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: hidave.darkstar@gmail.com, akpm@linux-foundation.org,
fzu@wemgehoertderstaat.de, mingo@elte.hu, ego@in.ibm.com,
dipankar@in.ibm.com, niv@us.ibm.com, dvhltc@us.ibm.com
Subject: [PATCH] Remove never-migrates assumption from rcu_process_callbacks()
Date: Thu, 28 Feb 2008 11:51:07 -0800 [thread overview]
Message-ID: <20080228195107.GA31203@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080228002110.GA20091@linux.vnet.ibm.com>
Hello again!
This patch fixes a potentially invalid access to a per-CPU variable in
rcu_process_callbacks(). This per-CPU access needs to be done in such
a way as to guarantee that the code using it cannot move to some other
CPU before all uses of the value accessed have completed. Even though
this code is currently only invoked from softirq context, which currrently
cannot migrate to some other CPU, life would be better if this
code did not silently make such an assumption.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
rcupreempt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff -urpNa -X dontdiff linux-2.6.25-rc3-rcuoffline/kernel/rcupreempt.c linux-2.6.25-rc3-rcuoffline-fp/kernel/rcupreempt.c
--- linux-2.6.25-rc3-rcuoffline/kernel/rcupreempt.c 2008-02-26 17:04:17.000000000 -0800
+++ linux-2.6.25-rc3-rcuoffline-fp/kernel/rcupreempt.c 2008-02-27 23:04:18.000000000 -0800
@@ -736,9 +736,11 @@ static void rcu_process_callbacks(struct
{
unsigned long flags;
struct rcu_head *next, *list;
- struct rcu_data *rdp = RCU_DATA_ME();
+ struct rcu_data *rdp;
- spin_lock_irqsave(&rdp->lock, flags);
+ local_irq_save(flags);
+ rdp = RCU_DATA_ME();
+ spin_lock(&rdp->lock);
list = rdp->donelist;
if (list == NULL) {
spin_unlock_irqrestore(&rdp->lock, flags);
next prev parent reply other threads:[~2008-02-28 19:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-28 0:21 [PATCH] Fix hibernate/resume in presence of PREEMPT_RCU and hotplug Paul E. McKenney
2008-02-28 5:05 ` Gautham R Shenoy
2008-02-28 19:43 ` Paul E. McKenney
2008-02-28 19:51 ` Paul E. McKenney [this message]
2008-02-28 19:53 ` [PATCH] Remove never-migrates assumption from rcu_process_callbacks() Ingo Molnar
2008-02-28 19:54 ` Ingo Molnar
2008-02-28 23:10 ` 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=20080228195107.GA31203@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=dipankar@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=ego@in.ibm.com \
--cc=fzu@wemgehoertderstaat.de \
--cc=hidave.darkstar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=niv@us.ibm.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