public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rcu: more careful check for the last non-dyntick-idle CPU
Date: Tue, 30 Mar 2010 08:50:24 -0700	[thread overview]
Message-ID: <20100330155023.GA2513@linux.vnet.ibm.com> (raw)
In-Reply-To: <4BB1D524.9050508@cn.fujitsu.com>

On Tue, Mar 30, 2010 at 06:40:36PM +0800, Lai Jiangshan wrote:
> Warning: I just did build test.
> 
> Subject: [PATCH] rcu: more careful check for the last non-dyntick-idle CPU
> 
> If a CPU is not in nohz_cpu_mask, it does not means this
> CPU is a non-dyntick-idle CPU, because this CPU may be offline or not exist.

Good catch, queued, thank you!

							Thanx, Paul

> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
> index 4befb64..6086a7d 100644
> --- a/kernel/rcutree_plugin.h
> +++ b/kernel/rcutree_plugin.h
> @@ -1026,7 +1026,7 @@ int rcu_needs_cpu(int cpu)
> 
>  	/* Don't bother unless we are the last non-dyntick-idle CPU. */
>  	for_each_cpu_not(thatcpu, nohz_cpu_mask)
> -		if (thatcpu != cpu) {
> +		if (cpu_online(thatcpu) && thatcpu != cpu) {
>  			per_cpu(rcu_dyntick_drain, cpu) = 0;
>  			per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
>  			return rcu_needs_cpu_quick_check(cpu);

      reply	other threads:[~2010-03-30 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 10:40 [PATCH] rcu: more careful check for the last non-dyntick-idle CPU Lai Jiangshan
2010-03-30 15:50 ` Paul E. McKenney [this message]

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=20100330155023.GA2513@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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