Re: 64 bit netdev stats counter

From: David S. Miller (davem@redhat.com)
Date: Fri Jul 12 2002 - 16:58:35 EST


   From: Matt Stegman <matts@ksu.edu>
   Date: Fri, 12 Jul 2002 17:02:07 -0500 (CDT)

   On 12 Jul 2002, Stephen Hemminger wrote:
   
> 64 bit values are not atomic so on x86 there will be glitches if this
> ever wraps over on an SMP machine. One other engineer is already
> adressing this for inode values like size; but this would introduce the
> same problem for network stuff.
   
   One other solution I thought of would be to have an rx_bytes_wrap counter
   in the struct.

32-bit values aren't atomic either, what is the issue?
We don't use atomic_t ops on these counters so they aren't
guarenteed in any way right now even. GCC is going to
output "incl MEM" or similar for net_stats->counter++, since
it lacks the 'lock;' prefix it is not atomic.
-
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/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:24 EST