Crate ioprio[][src]

Expand description

This is a simple crate for managing Linux-specific I/O priorities, which are usable with interfaces such as io_uring, Linux AIO, and can also be set globally for a single process or group.

Note that these priorities are Linux-specific, and the actual interpretation of what these 16-bit masks is only defined in linux/ioprio.h and linux/Documentation/block/ioprio.rst, which is only available in the Linux source, despite the syscalls having documentation as man pages. This library is based on Linux 5.10 interface and documentation, although the interface has not changed much whatsoever since it was introduced in Linux 2.6.13.

Also, setting I/O priorities only has an effect when the Completely Fair I/O Scheduler is in use, which is the default I/O scheduler.

Refer to the ioprio_set(2) syscall man page for more information about these API:s.

Structs

BePriorityLevel

I/O priority levels of the best-effort scheduling class, which range from 0-7, reversed.

Pid

Process identifier

Priority

An I/O priority, either associated with a class and per-class data, or the standard priority.

RtPriorityLevel

Real-time I/O priority levels, ranging from the numerical values 0-7, but reversed.

Uid

User identifier

Enums

Class

A priority class, being either real-time (IOPRIO_CLASS_RT), best-effort (IOPRIO_CLASS_BE), or idle (IOPRIO_CLASS_IDLE).

Target

A target, consisting of one or more processes matching the given query.

Traits

SqeExt

An extension trait for iou::SQE, that allows retrieving and setting the I/O priority of each individual I/O event.

Functions

get_priority

Get the I/O priority of the processes of the given target.

set_priority

Set the I/O priority of the processes of the given target.