From mboxrd@z Thu Jan 1 00:00:00 1970 From: paulmck@linux.vnet.ibm.com (Paul E. McKenney) Date: Wed, 8 Jun 2011 16:25:16 -0700 Subject: [ltt-dev] [PATCH 07/10] call_rcu: remove write-only qlen variable In-Reply-To: References: <1307523558-16960-1-git-send-email-pbonzini@redhat.com> <1307523558-16960-8-git-send-email-pbonzini@redhat.com> <20110608224225.GK2324@linux.vnet.ibm.com> Message-ID: <20110608232516.GL2324@linux.vnet.ibm.com> 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? 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 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;