Subject: Re: [patch 4/4] tcp: statistics not read_mostly

From: Stephen Hemminger <[email-masked]>
Date: Mon, 12 Mar 2007 14:26:47 -0700

On Mon, 12 Mar 2007 14:15:50 -0700 (PDT)
David Miller <[email-masked]> wrote:

> From: Stephen Hemminger <[email-masked]>
> Date: Mon, 12 Mar 2007 14:08:21 -0700
> 
> > The TCP statistics shouldn't be located in the middle of the
> > read_mostly section surrounded by sysctl values.
> > Move EXPORT_SYMBOL next to data like other declarations near by.
> > 
> > Signed-off-by: Stephen Hemminger <[email-masked]>
> 
> Stephen, they are pointers to the statistics, not the statistic
> counters themselves.  We're marking the _pointers_ as __read_mostly
> here.
> 
> When Eric originally submitted the change to add __read_mostly here I
> didn't understand it either.
> 
> Look at the definition of DEFINE_SNMP_STAT().

Okay, that's confusing. And maybe the comment suggests future work:

/* 
 * FIXME: On x86 and some other CPUs the split into user and softirq parts
 * is not needed because addl $1,memory is atomic against interrupts (but 
 * atomic_inc would be overkill because of the lock cycles). Wants new 
 * nonlocked_atomic_inc() primitives -AK
 */ 
-- 
Stephen Hemminger <[email-masked]>