Add I/O priority

Signed-off-by: utam0k <k0ma@utam0k.jp>
This commit is contained in:
utam0k
2023-03-24 12:22:25 +00:00
parent a1acca9acb
commit bfbd0305ba
10 changed files with 124 additions and 1 deletions
+11
View File
@@ -222,6 +222,9 @@ type Config struct {
// Personality contains configuration for the Linux personality syscall.
Personality *LinuxPersonality `json:"personality,omitempty"`
// IOPriority is the container's I/O priority.
IOPriority *IOPriority `json:"io_priority,omitempty"`
}
// Scheduler is based on the Linux sched_setattr(2) syscall.
@@ -283,6 +286,14 @@ func ToSchedAttr(scheduler *Scheduler) (*unix.SchedAttr, error) {
}, nil
}
var IOPrioClassMapping = map[specs.IOPriorityClass]int{
specs.IOPRIO_CLASS_RT: 1,
specs.IOPRIO_CLASS_BE: 2,
specs.IOPRIO_CLASS_IDLE: 3,
}
type IOPriority = specs.LinuxIOPriority
type (
HookName string
HookList []Hook