From: Mark J Roberts <mjr@znex.org>
To: Chris Wedgwood <cw@f00f.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Annoying /proc/net/dev rollovers.
Date: Sun, 16 Feb 2003 20:46:05 -0600 [thread overview]
Message-ID: <20030217024605.GB246@znex> (raw)
In-Reply-To: <20030217014111.GA2244@f00f.org>
Chris Wedgwood:
> How often does it happen?
When the windows box behind my NAT is using all of my 640kbit/sec
downstream to download movies, it takes a little over 14 hours to
download four gigabytes and roll over the byte counter. This means
ifconfig is mostly useless for getting an idea of how much I've
downloaded, which is something very useful to me.
> > total_rx_bytes += rx_bytes;
>
> if lval is 64-bit, then this cannot be done reliably on all
> architectures
I'm not sure why. I realize that x86 can't do atomic 64-bit
operations, but what I propose is to leave the 32-bit rx_bytes code
the way it is, and just have some heuristic for updating the 64-bit
value every so often, which can be done under a lock, so there would
be no opportunity for races to corrupt the counter. (This is also an
optimization since there needn't be any locks in the actual packet
handling code.)
But I admit I'm no expert programmer, and I might be suggesting
nonsense. In any case, the bug is real, the ifconfig output is
misleading, and I think it should be fixed one way or another.
next prev parent reply other threads:[~2003-02-17 2:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-16 22:16 Annoying /proc/net/dev rollovers Mark J Roberts
2003-02-17 1:41 ` Chris Wedgwood
2003-02-17 2:46 ` Mark J Roberts [this message]
2003-02-17 3:24 ` Jeff Garzik
2003-02-17 4:21 ` Chris Wedgwood
2003-02-17 10:35 ` Matti Aarnio
2003-02-18 4:58 ` David Lang
2003-02-18 13:28 ` Matti Aarnio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030217024605.GB246@znex \
--to=mjr@znex.org \
--cc=cw@f00f.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox