Re: [PATCH - RFC] [1/5] 64-bit network statistics - generic net

From: Jeff Sipek (jeffpc@optonline.net)
Date: Fri Jul 04 2003 - 00:27:56 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 03 July 2003 23:08, Linus Torvalds wrote:
> Please do this in user space. The "overflow every 2^32 packets" thing is
> _not_ a problem, if you just gather the statistics at any kind of
> reasonable interval.

The packet counters are fine (for now, that is), but the tx_bytes and rx_bytes
counters need those 64-bits. 4GB (= 2^32 bytes) is not enough. For example:

- - gigabit ethernet will cause 32-bit counters to overflow about every 34
seconds (at full speed.)
- - 10Gb/s ethernet will only take about 3.4 seconds
- - a user like me, who has 5Mbit/s connection to the net can cause the counter
to overflow in 1 hour 54 minutes

(Most of the time, the devices are not maxed out, but we have to check the
worst case scenario.) Now, how often should the user space
statistics-gathering program should run? Well, at least every 30 seconds, for
now that should be good, but the rein of 10Gb/s is approaching...

> I'd hate to penalise performance for something like this. We have
> generally avoided locking _entirely_ for statistics, exactly because
> people felt that there are major performance issues wrt network packet
> handling, and that "perfect statistics" aren't important enough to
> penalize performance over.

I agree with you, that is why I made it optional so the user may choose to
sacrifice performace for statistics when needed.

Additionally, I am sure there is a way of optimizing the patch I wrote (i.e.
actual transmition is locked with a lock from struct net_device.) I am aware
that this patch is a major undertaking, but it is only a matter of time
before someone will have to do it anyway.

> Remember: "perfect is the enemy of good".

Very true.

Jeff.

- --
Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former.
                - Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/BRBjwFP0+seVj/4RAnDSAJ90uOIpgtk0O7YLSsdj97kNbhr/jgCgrmlS
GYbA4luLnY7bli1jYVuZD3s=
=7zXz
-----END PGP SIGNATURE-----

-
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 07 2003 - 22:00:22 EST