Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2003 11:25:01 +0200
From:      Nils Vogels <nivo+freebsd-stable@yuckfou.org>
To:        freebsd-stable@freebsd.org
Subject:   Re: 4GB limit with netstat
Message-ID:  <20030522092501.GZ10795@imhotep.yuckfou.org>
In-Reply-To: <20030521104442.G65751@prg.traveller.cz>
References:  <20030521104442.G65751@prg.traveller.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 21, 2003 at 11:18:48AM +0200, Michal Mertl (MM) wrote:
MM> I also didn't like the limitation and we had long discussions about 64 bit
MM> counters in Jan 2002. The problem is that there isn't really cheap way to
MM> do safe (atomic) updates of 64 bit numbers on SMP x86. The conclusion at
MM> time was mostly that counting in 64 bit on 32 bit arch was too expensive.

To start off, I am not a kernel coder by any means, so what I'm about to say
might sound totally outrageous for various reasons :)

Wouldn't it be possible to still do the actual counting of packets/bytes in
32b, but keep an additional counter somewhere that simply tracks the number of
times the 32b counter has rolled over?

The tools that query the counters could then also check how many times the
counter has rolled over and simply add the appropriate number of
bytes/packets to the returned result.

Greetings,

Nils.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030522092501.GZ10795>