Messages in this thread | | | From | Bernd Eckenfels <> | Subject | Re: [PATCH - RFC] [1/5] 64-bit network statistics - generic net | Date | Sat, 05 Jul 2003 21:58:20 +0200 |
| |
In article <200307041357.32871.jeffpc@optonline.net> you wrote: > If one cpu tries to read a u_int64_t variable while another tries to > update it, the worst case scenario is that the reader will get the high > 32-bits before the write, and low 32-bit after the write, now if the counter > overflow, the number would be off by 4GB! (This only applies to 32-bit > architectures.) True, there are cache coherency algorithms, etc...
a reader like ifconfig can easyly work around this with multiple tries, but incremeting those variables wont work that easy, and therefore needs a lock, which will be a major pita.
64bit counters should be a result of lockless per-cpu network counters (32bit) with some kind of async merging.
Or we wait till 64bit hardware is more common :)
Greetings Bernd -- eckes privat - http://www.eckes.org/ Project Freefire - http://www.freefire.org/ - 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/
| |