Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750701AbWAITEJ (ORCPT ); Mon, 9 Jan 2006 14:04:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750702AbWAITEJ (ORCPT ); Mon, 9 Jan 2006 14:04:09 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:62944 "EHLO e36.co.us.ibm.com") by vger.kernel.org with ESMTP id S1750701AbWAITEI (ORCPT ); Mon, 9 Jan 2006 14:04:08 -0500 Date: Mon, 9 Jan 2006 11:04:30 -0800 From: "Paul E. McKenney" To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, Dipankar Sarma , Manfred Spraul , Linus Torvalds , Andrew Morton Subject: Re: [PATCH 3/5] rcu: don't set ->next_pending in rcu_start_batch() Message-ID: <20060109190430.GC15083@us.ibm.com> Reply-To: paulmck@us.ibm.com References: <43C165C5.71EFC008@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43C165C5.71EFC008@tv-sign.ru> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1884 Lines: 53 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 > Signed-off-by: Oleg Nesterov > > --- 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 { > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/