IoPriority Type
One Linux I/O-scheduling priority as configured through `Command.IoPriority`: an `IoPriorityClass` and, for the two levelled classes, the level within it. The pair `ioprio_set(2)` itself encodes into a single value. Built only through the three validating factories below — `Idle`, `BestEffort level`, `RealTime level` — which reject an out-of-range level at that boundary with `ArgumentOutOfRangeException` rather than clamping it into range or handing the kernel a value it would refuse later. **Lower levels mean higher priority**, which is the kernel's own convention and the opposite of how `Priority` reads: `BestEffort 0` is the most aggressive best-effort setting and `BestEffort 7` the politest.
Instance members
| Instance member |
Description
|
|
The class this priority is in.
|
Full Usage:
this.Level
Returns: int
|
The level within `Class`, `0` (highest priority) through `MaxLevel` (lowest). Reads `0` for `IoPriorityClass.Idle`, which has no level at all — the kernel ignores the level field in that class, so there is no meaningful number to report and `0` is the value that is sent.
|
Static members
| Static member |
Description
|
|
The ordinary best-effort class at `level` (`0` highest priority through `MaxLevel` lowest). `BestEffort 7` is the usual choice for work that should yield to interactive users but still make steady progress. Needs no privilege. A `level` outside `0..MaxLevel` raises `ArgumentOutOfRangeException` here, at the construction boundary — never clamped into range, and never carried as far as the kernel.
|
|
The politest setting: I/O only while the block device is otherwise idle (`IoPriorityClass.Idle`). Needs no privilege.
|
Full Usage:
IoPriority.MaxLevel
Returns: int
|
The highest level number the kernel accepts (`IOPRIO_NR_LEVELS - 1`). Levels run `0`..`MaxLevel`, lowest number = highest priority. Published so a config layer can validate a level it read as text against the same bound the factories enforce, instead of repeating the number.
|
|
The real-time class at `level` (`0` highest priority through `MaxLevel` lowest). **Needs `CAP_SYS_ADMIN`** (or `CAP_SYS_NICE` on Linux ≥ 5.14) and can starve every other disk user — see `IoPriorityClass.RealTime` before reaching for it. A `level` outside `0..MaxLevel` raises `ArgumentOutOfRangeException` here, at the construction boundary — never clamped into range, and never carried as far as the kernel.
|
ProcessKit API Reference