[lkml]   [2003]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectAnnoying /proc/net/dev rollovers.
The rolling-over of /proc/net/dev fields annoys me.

I read a couple threads about the issue and saw a lot of whimpering
about how locking would be such a pain to implement in lieu of
32-bit atomicity.

Alan Cox pointed out in one of them that accurate info could be
collected through "the firewalling facilities", which I take to mean
the ipt_counters structure. The caveat is that it only provides
packet and byte counts.

One alternative to throwing locks around everything accessing those
fields is to update a 64-bit counter asynchronously. Has this been
considered? It would entail atomically executing

total_rx_bytes += rx_bytes;
rx_bytes = 0;

and merely ensuring that rx_bytes does not roll over between calls.
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

 \ /
  Last update: 2005-03-22 13:33    [W:0.008 / U:1.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site