per-cpu counters (Re: svn commit: r190967 - head/sys/netinet)
Robert Watson
rwatson at FreeBSD.org
Sun Apr 12 15:33:25 UTC 2009
On Sun, 12 Apr 2009, Poul-Henning Kamp wrote:
> In message <alpine.BSF.2.00.0904121525540.19879 at fledge.watson.org>, Robert
> Wats on writes:
>
>> I have a project along these lines in progress, and will post the proposal
>> to arch@ once I've finished prototyping it. In particular, it provides
>> common implementations of "reset" and "report" in order to expose a single
>> userspace version of the structure via sysctl.
>
> Please don't export them via sysctl.
>
> Export them via mmap(2) like we already do with the disk I/O statistics.
>
> That way monitoring the counters becomes a no-syscall operation.
The sysctls already exist, and are used by both built-in and third-party
monitoring tools. Given the 8.0 timeline and the list of other things to get
done before 8.0, I'm happy to solve the per-CPU counter problem as it is
necessary to do so, but I don't have time to solve the mmap'd per-CPU counter
problem, as it's not necessary to do so. In the current design the per-CPU
counter framework allocates the storage for the counters, so it should be easy
to add that feature later.
Robert N M Watson
Computer Laboratory
University of Cambridge
More information about the svn-src-head
mailing list