Skip to content

Commit

Permalink
libct/cg/sd/v2: add IOWeight property support
Browse files Browse the repository at this point in the history
Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Apr 19, 2023
1 parent 9b4d723 commit c1aaf2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/systemd.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ The following tables summarize which properties are translated.
| memory.reservation | MemoryLow | |
| memory.swap | MemorySwapMax | |
| cpu.shares | CPUWeight | |
| blockIO.weight | IOWeight | |
| pids.limit | TasksMax | |
| cpu.cpus | AllowedCPUs | v244 |
| cpu.mems | AllowedMemoryNodes | v244 |
Expand Down
7 changes: 7 additions & 0 deletions libcontainer/cgroups/systemd/v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ func genV2ResourcesProperties(dirPath string, r *configs.Resources, cm *dbusConn
return nil, err
}

if r.BlkioWeight != 0 {
v := cgroups.ConvertBlkIOToIOWeightValue(r.BlkioWeight)
properties = append(properties,
newProp("IOWeight", v))
}
// TODO: add r.BlkioWeightDevice -> newProp("IODeviceWeight", ...)

// ignore r.KernelMemory

// convert Resources.Unified map to systemd properties
Expand Down

0 comments on commit c1aaf2a

Please sign in to comment.