Re: [PATCH - RFC] [1/5] 64-bit network statistics - generic net

From: Linus Torvalds (
Date: Thu Jul 03 2003 - 22:08:03 EST

On Thu, 3 Jul 2003, Jeff Sipek wrote:
> The variables for network statistics (in struct net_device_stats) are unsigned
> longs. On 32-bit architectures, this makes them overflow every 4GB or 2^32
> packets. The following series of patches [against 2.5.74] makes the
> statistics variable type configurable. The default is to leave everything the
> way it was (unsigned long). However, when NETSTATS64 is set in the config,
> the statistics use 64-bit variables (u_int64_t) - this works only on 32-bit
> architectures.

Please do this in user space. The "overflow every 2^32 packets" thing is
_not_ a problem, if you just gather the statistics at any kind of
reasonable interval.

I'd hate to penalise performance for something like this. We have
generally avoided locking _entirely_ for statistics, exactly because
people felt that there are major performance issues wrt network packet
handling, and that "perfect statistics" aren't important enough to
penalize performance over.

Remember: "perfect is the enemy of good".


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:22 EST