mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: linux-kernel@vger.kernel.org,
	Dipankar Sarma <dipankar@in.ibm.com>,
	Manfred Spraul <manfred@colorfullife.com>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 3/5] rcu: don't set ->next_pending in rcu_start_batch()
Date: Mon, 9 Jan 2006 11:04:30 -0800	[thread overview]
Message-ID: <20060109190430.GC15083@us.ibm.com> (raw)
In-Reply-To: <43C165C5.71EFC008@tv-sign.ru>

On Sun, Jan 08, 2006 at 10:19:33PM +0300, Oleg Nesterov wrote:
> I think it is better to set ->next_pending in the caller, when
> it is needed. This saves one parameter, and this coincides with
> cpu_quiet() beahaviour, which sets ->completed = ->cur itself.

Makes sense to me!

							Thanx, Paul

Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
> 
> --- 2.6.15/kernel/rcupdate.c~3_NPEND	2006-01-08 21:55:45.000000000 +0300
> +++ 2.6.15/kernel/rcupdate.c	2006-01-08 22:46:13.000000000 +0300
> @@ -249,12 +249,8 @@ static void rcu_do_batch(struct rcu_data
>   * active batch and the batch to be registered has not already occurred.
>   * Caller must hold rcu_state.lock.
>   */
> -static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp,
> -				int next_pending)
> +static void rcu_start_batch(struct rcu_ctrlblk *rcp, struct rcu_state *rsp)
>  {
> -	if (next_pending)
> -		rcp->next_pending = 1;
> -
>  	if (rcp->next_pending &&
>  			rcp->completed == rcp->cur) {
>  		rcp->next_pending = 0;
> @@ -288,7 +284,7 @@ static void cpu_quiet(int cpu, struct rc
>  	if (cpus_empty(rsp->cpumask)) {
>  		/* batch completed ! */
>  		rcp->completed = rcp->cur;
> -		rcu_start_batch(rcp, rsp, 0);
> +		rcu_start_batch(rcp, rsp);
>  	}
>  }
>  
> @@ -423,7 +419,8 @@ static void __rcu_process_callbacks(stru
>  		if (!rcp->next_pending) {
>  			/* and start it/schedule start if it's a new batch */
>  			spin_lock(&rsp->lock);
> -			rcu_start_batch(rcp, rsp, 1);
> +			rcp->next_pending = 1;
> +			rcu_start_batch(rcp, rsp);
>  			spin_unlock(&rsp->lock);
>  		}
>  	} else {
> 

      reply	other threads:[~2006-01-09 19:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-08 19:19 Oleg Nesterov
2006-01-09 19:04 ` 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=20060109190430.GC15083@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=oleg@tv-sign.ru \
    --cc=torvalds@osdl.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

Powered by JetHome