Re: 64 bit netdev stats counter

From: Andrew Morton (akpm@zip.com.au)
Date: Fri Jul 12 2002 - 17:27:09 EST


"David S. Miller" wrote:
>
> From: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Date: 13 Jul 2002 00:20:53 +0100
>
> gcc will output
>
> increment low 32bit
> if zero
> increment high
>
> Which means we can rapidly get 2^32 out of sync
>
> True and this equals the "fix" suggested C code involving
> two 32-bit counters that the original author posted :-)
>

Could you make the counters per-cpu and only add them all up
in the rare case where someone wants to read the stats?

And then change all the drivers ;)

-
-
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