From: Oleg Nesterov <oleg@tv-sign.ru>
To: vatsa@in.ibm.com
Cc: linux-kernel@vger.kernel.org,
Dipankar Sarma <dipankar@in.ibm.com>,
Manfred Spraul <manfred@colorfullife.com>,
Linus Torvalds <torvalds@osdl.org>,
"Paul E. McKenney" <paulmck@us.ibm.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2/5] rcu: don't check ->donelist in __rcu_pending()
Date: Mon, 09 Jan 2006 17:51:08 +0300 [thread overview]
Message-ID: <43C2785C.4E937748@tv-sign.ru> (raw)
In-Reply-To: 20060109093141.GA10811@in.ibm.com
Srivatsa Vaddagiri wrote:
> On Sun, Jan 08, 2006 at 10:19:24PM +0300, Oleg Nesterov wrote:
> > ->donelist becomes != NULL only in rcu_process_callbacks().
> >
> > rcu_process_callbacks() always calls rcu_do_batch() when
> > ->donelist != NULL.
> >
> > rcu_do_batch() schedules rcu_process_callbacks() again if
> > ->donelist was not flushed entirely.
> >
> > So ->donelist != NULL means that rcu_tasklet is either
> > TASKLET_STATE_SCHED or TASKLET_STATE_RUN, we don't need to
> > check it in __rcu_pending().
>
> Do I smell a bug wrt CPU Hotplug here? Basically, I see that we do
> a rcu_move_batch of ->curlist and ->nxtlist of the dead CPU. Why not
> ->donelist?
After the quick reading CPU Hotplug code I think you are right, there
is a bug in rcu_offline_cpu(). It should also move ->donelist, it is
lost otherwise.
> If we have to do a rcu_move_batch of ->donelist also,
> then perhaps the ->donelist != NULL check is required in
> rcu_pending?
rcu_move_batch() always adds entries to the ->nxttail, so I think
this patch is correct.
> This is considering that the RCU tasklet of the dead
> CPU is killed (rather than moved over to a different CPU).
Yes, it is killed explicitly in rcu_offline_cpu() via tasklet_kill_immediate().
Note that we can't remove this tasklet_kill_immediate() and rely on
takeover_tasklets(). rcu_process_callbacks() does __get_cpu_var(),
so it can't find orphaned rcu_data anyway if the tasklet was moved
to another cpu.
So, do we need something like this (untested, uncompiled) patch or not?
--- 2.6.15/kernel/rcupdate.c~ 2006-01-09 20:23:32.000000000 +0300
+++ 2.6.15/kernel/rcupdate.c 2006-01-09 20:26:20.000000000 +0300
@@ -355,8 +355,9 @@ static void __rcu_offline_cpu(struct rcu
spin_unlock_bh(&rcp->lock);
rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
-
+ rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail);
}
+
static void rcu_offline_cpu(int cpu)
{
struct rcu_data *this_rdp = &get_cpu_var(rcu_data);
Oleg.
next prev parent reply other threads:[~2006-01-09 13:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-08 19:19 [PATCH 2/5] rcu: don't check ->donelist in __rcu_pending() Oleg Nesterov
2006-01-08 22:00 ` Paul E. McKenney
2006-01-09 9:31 ` Srivatsa Vaddagiri
2006-01-09 14:51 ` Oleg Nesterov [this message]
2006-01-09 13:42 ` Srivatsa Vaddagiri
2006-01-09 15:33 ` Oleg Nesterov
2006-01-09 18:59 ` Paul E. McKenney
2006-01-09 20:31 ` Oleg Nesterov
2006-01-09 19:59 ` Paul E. McKenney
2006-01-10 9:58 ` Srivatsa Vaddagiri
2006-01-10 14:24 ` [PATCH] rcu: fix hotplug-cpu ->donelist leak Oleg Nesterov
2006-01-11 5:01 ` Paul E. McKenney
2006-01-11 16:28 ` Paul E. McKenney
2006-01-11 19:25 ` Oleg Nesterov
2006-01-11 18:21 ` Paul E. McKenney
2006-01-10 14:27 ` [PATCH 2/5] rcu: don't check ->donelist in __rcu_pending() Oleg Nesterov
2006-01-10 18:13 ` 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=43C2785C.4E937748@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).