Re: [PATCH v2] l2tp: use per-cpu variables for u64_stats updates
From: Ben Greear <hidden>
Date: 2012-06-27 21:40:29
On 06/27/2012 02:32 PM, Eric Dumazet wrote:
On Wed, 2012-06-27 at 23:20 +0200, Eric Dumazet wrote:quoted
On Wed, 2012-06-27 at 13:58 -0700, Ben Greear wrote:quoted
It's worse than that: Even on 64-bit kernels, counters that are returned by netlink and /proc/net/dev as 64-bit may still wrap themselves at 32-bit intervals.Really ? Thats incredible you dont send a bug report then.A bug report to the application author, not the kernel.
Yeah, application author was me.
/proc/net/dev is an ASCII file, and nothing gives the width of a field. Therefore, an application should cope with all cases (counter being a 32bit or 64bit integer), wrapping included. Note that this has little to do with the application or kernel being 32/64 bit code.
Notice that the netlink stats are claiming 64-bit and they are not (always) 64-bit. That is a nice binary API that is still wrapping before its time in many cases. There may be good performance reasons for keeping some counters at 32-bit, but it plays merry hell with anyone wanting to optimize an application to poll less often for stats that are supposedly 64-bit. Thanks, Ben -- Ben Greear [off-list ref] Candela Technologies Inc http://www.candelatech.com