vmstat's entries type

Brian Candler B.Candler at pobox.com
Sat Jul 29 21:15:37 UTC 2006


On Sun, Jul 30, 2006 at 06:56:55AM +1000, Peter Jeremy wrote:
> On Sat, 2006-Jul-29 18:13:32 +0200, Michal Mertl wrote:
> >#define PCPU_LAZY_INC(var)      (++*PCPU_PTR(var))
> 
> I missed that.
> 
> >and function vcnt from sys/vm/vm_meter.c
> 
> vcnt() accumulates multiple 32-bit counters into a 32-bit result.  Getting
> a 64-bit result means additionally tracking overflows in each counter.

But if you have per-CPU counters, there's no problem with accumulating
64-bit values in the first place.

So in the above macro I don't see why 'var' can't be a pointer to a
uint64_t, with relevant minor changes to vcnt() of course.

Regards,

Brian.


More information about the freebsd-current mailing list