]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: handle non-existent isolcpus file 1309/head
authorChristian Brauner <christian.brauner@canonical.com>
Mon, 21 Nov 2016 21:31:39 +0000 (22:31 +0100)
committerChristian Brauner <christian.brauner@canonical.com>
Mon, 21 Nov 2016 21:31:39 +0000 (22:31 +0100)
If the file "/sys/devices/system/cpu/isolated" doesn't exist, we can't just
simply bail. We still need to check whether we need to copy the parents cpu
settings.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/cgroups/cgfsng.c

index 285fd98eae36114b7e883286c27dee24e3871e07..d3215d76cec1b4e2a4b7aa91feee9ca78bf16c27 100644 (file)
@@ -454,6 +454,18 @@ static bool filter_and_set_cpus(char *path, bool am_initialized)
        if (!file_exists(__ISOL_CPUS)) {
                /* This system doesn't expose isolated cpus. */
                DEBUG("Path: "__ISOL_CPUS" to read isolated cpus from does not exist.\n");
+               cpulist = posscpus;
+               /* No isolated cpus but we weren't already initialized by
+                * someone. We should simply copy the parents cpuset.cpus
+                * values.
+                */
+               if (!am_initialized) {
+                       DEBUG("Copying cpuset of parent cgroup.");
+                       goto copy_parent;
+               }
+               /* No isolated cpus but we were already initialized by someone.
+                * Nothing more to do for us.
+                */
                goto on_success;
        }