client: refactor cpuset partitioning (#18371)

* client: refactor cpuset partitioning

This PR updates the way Nomad client manages the split between tasks
that make use of resources.cpus vs. resources.cores.

Previously, each task was explicitly assigned which CPU cores they were
able to run on. Every time a task was started or destroyed, all other
tasks' cpusets would need to be updated. This was inefficient and would
crush the Linux kernel when a client would try to run ~400 or so tasks.

Now, we make use of cgroup heirarchy and cpuset inheritence to efficiently
manage cpusets.

* cr: tweaks for feedback
This commit is contained in:
Seth Hoenig
2023-09-12 09:11:11 -05:00
committed by GitHub
parent 77ca0bb8af
commit 2e1974a574
57 changed files with 1225 additions and 236 deletions

View File

@@ -299,7 +299,7 @@ func basicTask(t *testing.T, name string, taskConfig *TaskConfig) *drivers.TaskC
LinuxResources: &drivers.LinuxResources{
MemoryLimitBytes: 134217728,
CPUShares: 100,
CpusetCgroupPath: cgroupslib.LinuxResourcesPath(allocID, name),
CpusetCgroupPath: cgroupslib.LinuxResourcesPath(allocID, name, false),
},
},
}