From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: Dipankar Sarma <dipankar@in.ibm.com>,
"Paul E. McKenney" <paulmck@us.ibm.com>,
Srivatsa Vaddagiri <vatsa@in.ibm.com>,
Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist
Date: Sat, 28 Jan 2006 22:02:01 +0300 [thread overview]
Message-ID: <43DBBFA9.8D5E231A@tv-sign.ru> (raw)
__rcu_process_callbacks() disables interrupts to protect itself
from call_rcu() which adds new entries to ->nxtlist.
However we can check "->nxtlist != NULL" with interrupts enabled,
we can't get "false positives" because call_rcu() can only change
this condition from 0 to 1.
Tested with rcutorture.ko.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- RC-1/kernel/rcupdate.c~ 2006-01-19 18:13:07.000000000 +0300
+++ RC-1/kernel/rcupdate.c 2006-01-29 00:13:24.000000000 +0300
@@ -381,8 +381,8 @@ static void __rcu_process_callbacks(stru
rdp->curtail = &rdp->curlist;
}
- local_irq_disable();
if (rdp->nxtlist && !rdp->curlist) {
+ local_irq_disable();
rdp->curlist = rdp->nxtlist;
rdp->curtail = rdp->nxttail;
rdp->nxtlist = NULL;
@@ -407,9 +407,8 @@ static void __rcu_process_callbacks(stru
rcu_start_batch(rcp);
spin_unlock(&rcp->lock);
}
- } else {
- local_irq_enable();
}
+
rcu_check_quiescent_state(rcp, rdp);
if (rdp->donelist)
rcu_do_batch(rdp);
next reply other threads:[~2006-01-28 17:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-28 19:02 Oleg Nesterov [this message]
2006-01-28 18:49 ` [PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist Dipankar Sarma
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=43DBBFA9.8D5E231A@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@us.ibm.com \
--cc=torvalds@osdl.org \
--cc=vatsa@in.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.