4GB limit with netstat

Michal Mertl mime at traveller.cz
Wed May 21 02:18:51 PDT 2003


I also didn't like the limitation and we had long discussions about 64 bit
counters in Jan 2002. The problem is that there isn't really cheap way to
do safe (atomic) updates of 64 bit numbers on SMP x86. The conclusion at
time was mostly that counting in 64 bit on 32 bit arch was too expensive.

I have a patch which increases the width and adds small api for safe
updating of wide counters (for 4.5 or something).

Other solution is to keep the type of kernel-updated counters and if
needed (on 32 bit archs) have some aggregation counters which would be
once in a while (e.g. 10 times a second) updated with some kernel thread.
I also have proof-of-concept patch with this approach.

As SMPng locking of network stack and drivers is taking place it seems
some counters could be made u_int64 rather cheaply - the structures
containing the counters should be locked for update anyway so the update
can be achieved then by simple means even on 32bit arch.

-- 
Michal Mertl
mime at traveller.cz


More information about the freebsd-stable mailing list