vmstat's entries type

Peter Jeremy peterjeremy at optushome.com.au
Sat Jul 29 20:52:27 UTC 2006


On Sat, 2006-Jul-29 21:05:29 +0200, Sten Daniel Srsdal wrote:
>Peter Jeremy wrote:
>> In a MP configuration where it doesn't particularly matter if a
>> particular update gets counted this time or next time, I think the
>> cheapest option is to have per-CPU 32-bit counters (so no locks are
>> needed to update the counters) with a polling function to accumulate
>> all the individual counters into a 64-bit total.  This pushes the cost
>> from the update (very frequent) into the read (which is relatively
>> infrequent), for a lower overall cost.

>Is caching necessary somewhere or can the function return the value
>directly without storing the global accumulated counter?

If you want a 64-bit final result that takes into account overflows
in the 32-bit per-CPU counters, then you will need some way to keep
track of the number of overflows in each counter.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060729/6fce5789/attachment.pgp


More information about the freebsd-current mailing list