Distribution: Debian Testing Hardware Environment: Pentium2 Software Environment: tbench Problem Description: The 'bytes' counter in /proc/net/dev wraps after bytes > 2^32. I assume this is a 32-bit processor limitation. How about /proc/net/dev count in kilobytes instead of bytes? Granted, this would break userspace, but in the age of 500gb NFS shares and multi-terrabyte RAID arrays, having a network counter that can only go up to 4gb before wrapping needs a fix. Steps to reproduce: fire up tbench, using 50 clients, and wait about 5 minutes, cat'ing /proc/net/dev the whole time.
There were couple of (relatively) short discussions on linux-kernel, and for now the verdict is "Do it in user space" --Linus. Note: The counters overflow every 2^32 bytes only on 32-bit architectures, 64-bit architectures handle the counters as 64-bits.
Created attachment 4090 [details] Linux 2.6.9 64-bit net counters This patch avoids wraps after 4 GiB also on 32-bit anarchitectures. Peter Kov
Created attachment 4091 [details] Linux 2.4.27 64-bit net counters This patch avoids wraps after 4 GiB also on 32-bit anarchitectures. Peter Kov
It is not that easy. 64-bit operations are not atomic on 32-bit architectures. My implementation of a patch to solve it is on my website http://shells.gnugeneration.com/~jeffpc/. Jeff.
Downstream bug report: http://bugs.gentoo.org/show_bug.cgi?id=67614
I just tried cat /proc/net/dev on my 2.6.17-rc2 x86_64 kernel. My eth0 rx bytes value: 15847163310; my eth0 tx bytes value: 11484555682. Both are larger than 2^32. I'm willing to say that the Gentoo report is invalid and close the bug. 32-bit kernels will be restricted to 32-bit values and 64-bit kernels will be restricted to 64-bit values. If you want better parsing, then, as Linus said, make a userspace tool handle it. Anyone have a problem with the bug being closed?
No responses, closing bug. Yes, it is possible that the downstream bug was invalid, since there is no hard evidence there.
*** Bug 7069 has been marked as a duplicate of this bug. ***