[ltt-dev] [PATCH 07/10] call_rcu: remove write-only qlen variable

Mathieu Desnoyers compudj at krystal.dyndns.org
Wed Jun 8 19:30:13 EDT 2011


* Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote:
> On Wed, Jun 08, 2011 at 06:46:20PM -0400, Mathieu Desnoyers wrote:
> > * Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote:
> > > On Wed, Jun 08, 2011 at 06:15:30PM -0400, Mathieu Desnoyers wrote:
> > > > * Paolo Bonzini (pbonzini at redhat.com) wrote:
> > > > > The qlen variable is write-only, we can remove it easily.
> > > > 
> > > > I defer to Paul for this one: he likes keeping qlen there so the
> > > > debugger can show the list state, which is useful for debugging. I'll
> > > > let you two figure out how to come to an agreement. ;)
> > > 
> > > Indeed, I have often used gdb to read ->qlen.  ;-)
> > 
> > So maybe adding a comment besides qlen stating the reason why it's there
> > (e.g. for debugging purposes) might be appropriate ?
> 
> Good point!  How about the following?

Merged, thanks!

Mathieu

> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> Add comment to flag purpose of the ->qlen field
> 
> It is write-only, but is needed for debugging purposes.
> 
> Signed-off-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
> 
> diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h
> index cfe1cce..9beb58c 100644
> --- a/urcu-call-rcu-impl.h
> +++ b/urcu-call-rcu-impl.h
> @@ -48,7 +48,7 @@ struct call_rcu_data {
>  	unsigned long flags;
>  	pthread_mutex_t mtx;
>  	int futex;
> -	unsigned long qlen;
> +	unsigned long qlen; /* maintained for debugging. */
>  	pthread_t tid;
>  	int cpu_affinity;
>  	struct cds_list_head list;
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list