tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Heads up: moving some uvmexp stat to being per-cpu



On Tue, 14 Dec 2010 20:49:14 -0800
Matt Thomas <matt%3am-software.com@localhost> wrote:

> I have a fairly large but mostly simple patch which changes the stats 
> collected in
> uvmexp for faults, intrs, softs, syscalls, and traps from 32 bit to 64 bits 
> and
> puts them in cpu_data (in cpu_info).  This makes more accurate and a little 
> cheaper
> to update on 64bit systems.

I like the cleanliness of the changes;

A potential issue I see is how heavy this becomes on some 32-bit CPUs
i.e. m68k, where I see for instance 1 instruction being replaced by 9
instructions (including registers save/restore) to increment a
counter.  I'm not sure if in practice this will really affect
performance, or if it's worth benchmarking for those architectures,
however.

If it turned out to be a problem, I could see two possible solutions:
an option to disable some stat counters on slow systems (values could
simply remain 0 in that case), or a new counter type say,
cpustatcount_t and macros defined by the MD code to use 32-bit
cpu-specific counters where necessary, getting compiled/exported to
userland using 64-bit at statistics request time to avoid
compat/userland complications...

Thanks,
-- 
Matt


Home | Main Index | Thread Index | Old Index