I've written virtual input drivers for Linux, and a server that communicates with them via /dev nodes. Now, one of them is a virtual mouse and it's quite important that what the signal server receives gets to the driver as soon as possible for the mouse to feel smooth.
For that reason I set ionice for the server process to 1 (still not to get priority over important linux daemons):
if (ioprio_set(IOPRIO_WHO_PROCESS,getpid(), 1 | IOPRIO_CLASS_RT << IOPRIO_CLASS_SHIFT) == -1) {
logger->error("ioprio_set() error",errno);
}
But I'm not certain that it even is worth it. Difference, even if any, is not noticable. Are the character special files in /dev/ considered when it comes to I/O priority, despite that no access to the actual disk is given?
As far as I know, the layer in the OS that ionice
affects is the I/O scheduler. At least up to kernel 2.6.17, cfq
was the only scheduler to actually support ionice
and I believe nothing has changed, at least with regard to the default schedulers the kernel provides.
I/O schedulers are only used with block devices, where it is possible to queue operations or change their order, delay or merge them etc. (see here for example). This is also in line with the fact that you can change the scheduler via /sys
virtual filesystem for block devices only (files such as /sys/devices/pci0000:00/0000:00:08.0/host0/target0:0:0/0:0:0:0/block/sda/queue/scheduler
). Your mouse driver is a character device and as such, it is not at all influenced by the I/O scheduler or ionice
.