I've reimplemented this idea multiple times and have finally settled on the following.
The idea is simple: Replace isrdmsr with a bit vector that has flags for reading, writing, and polling, along with a set of flags for when to read MPERF (at the start of the op, at the end, and before each polled read).
This feature is the best way to get a handle on how long it takes for certain MSRs to be updated, e.g., energy and temperature. It can also be useful for implementing what is effectively a userspace signal: the op completes (and the ioctl() returns) when the value of the given MSR changes.
I've reimplemented this idea multiple times and have finally settled on the following.
The idea is simple: Replace
isrdmsrwith a bit vector that has flags for reading, writing, and polling, along with a set of flags for when to read MPERF (at the start of the op, at the end, and before each polled read).This feature is the best way to get a handle on how long it takes for certain MSRs to be updated, e.g., energy and temperature. It can also be useful for implementing what is effectively a userspace signal: the op completes (and the
ioctl()returns) when the value of the given MSR changes.