Skip to content
Snippets Groups Projects
Commit 70c26991 authored by Matthieu Hautreux's avatar Matthieu Hautreux
Browse files

task/cgroup: correct a regression in cpuset management

The addition of the default slurm cg with the cpuset subsystem was
incomplete preventing from having a working solution. The contents
of cpuset.cpus and cpuset.mems were not replicated from the parent
resulting in "No space left on device" errors when trying to add
tasks to the step cg.
parent 422fe175
No related branches found
No related tags found
No related merge requests found
...@@ -168,6 +168,7 @@ extern int task_cgroup_cpuset_create(slurmd_job_t *job) ...@@ -168,6 +168,7 @@ extern int task_cgroup_cpuset_create(slurmd_job_t *job)
size_t cpus_size; size_t cpus_size;
char* slurm_cgpath ; char* slurm_cgpath ;
xcgroup_t slurm_cg;
/* create slurm root cg in this cg namespace */ /* create slurm root cg in this cg namespace */
slurm_cgpath = task_cgroup_create_slurm_cg(&cpuset_ns); slurm_cgpath = task_cgroup_create_slurm_cg(&cpuset_ns);
...@@ -175,6 +176,25 @@ extern int task_cgroup_cpuset_create(slurmd_job_t *job) ...@@ -175,6 +176,25 @@ extern int task_cgroup_cpuset_create(slurmd_job_t *job)
return SLURM_ERROR; return SLURM_ERROR;
} }
/* check that this cgroup has cpus allowed or initialize them */
if (xcgroup_load(&cpuset_ns,&slurm_cg,slurm_cgpath)
!= XCGROUP_SUCCESS) {
error("task/cgroup: unable to load slurm cpuset xcgroup");
xfree(slurm_cgpath);
return SLURM_ERROR;
}
rc = xcgroup_get_param(&slurm_cg,"cpuset.cpus",&cpus,&cpus_size);
if (rc != XCGROUP_SUCCESS || cpus_size == 1) {
/* initialize the cpusets as it was inexistant */
if (_xcgroup_cpuset_init(&slurm_cg) !=
XCGROUP_SUCCESS) {
xfree(slurm_cgpath);
xcgroup_destroy(&slurm_cg);
return SLURM_ERROR;
}
}
xfree(cpus);
/* build user cgroup relative path if not set (should not be) */ /* build user cgroup relative path if not set (should not be) */
if (*user_cgroup_path == '\0') { if (*user_cgroup_path == '\0') {
if (snprintf(user_cgroup_path, PATH_MAX, if (snprintf(user_cgroup_path, PATH_MAX,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment