Followups: performance counters, ksplice, and fsnotify
Posted Dec 19, 2008 5:02 UTC (Fri) by deater
In reply to: Followups: performance counters, ksplice, and fsnotify
Parent article: Followups: performance counters, ksplice, and fsnotify
I wonder where this sentiment that hardware specific stuff doesn't belong
into the kernel comes from. I thought one of the kernel's main purposes
was to abstract the hardware and hide it from user space. Why then put
hardware specific stuff into user space libraries instead of the kernel?
The kernel should abstract the hardware, but in as minimal way as possible. With performance counters this means that the kernel should enable starting and stopping of monitoring, enforce some sanity checks, and provide user-space with a common way to set up events.
What it does *not* mean is including 200k of library code that maps meaningful textual names to the numeric counter identifiers, or including all the subtle limitations of the counters (not all counters can count all events, not all counters are available on all steppings of a CPU, etc).
Putting that all into the kernel would definitely be a losing proposition. Perfmon does it from userspace. Ingo's method would have it all in the kernel.
This is a similar argument about whether video4linux should include format conversions into the kernel or not.
It's important to know what the correct level of abstraction for your interface is.
to post comments)