@straber: I don't think this is a kernel bug after all.

You said that LXD will not alter the CPU pinning in any way. But it must
write _something_ to cpuset.cpus before you can add any tasks to the
cgroup. So I assume that by "not altering" you mean it just copies the
value from the parent cgroup. But by doing that you are including the
isolated CPUs in the cpuset. And based on Documentation/kernel-
parameters.txt, adding the isolated CPUs to the cpuset is a supported
way of scheduling tasks to the isolated CPU.

If the kernel be default inherited the cpuset.cpus value from its parent
it would be reasonable for it to keep the same behavior wrt isolated
CPUs. But since you have to write a value I don't think there's any way
the kernel can know whether or not you meant to include isolated CPUs. I
think LXD will have to exclude them unless explicitly told not to.

Note that the base cpuset must contain all possible CPUs, as any child
cpuset must be a subset of its parent.

The behavior I describe in #7 is still a bit weird though. I missed a
point there, that cpuset.cpus had been written to and so the scheduler
domains were rebuilt. I suspect it has to do with the fact that the load
balancer won't migrate tasks to/from isolated CPUs. If the first task
you added to the set was on a non-isolated CPU then it won't be migrated
to an isolated CPU. And since (I think) any of its children will start
on the same CPU as the parent process they wouldn't be migrated to an
isolated CPU either. So in effect it still excludes the isolated CPU
despite the scheduler domain being recalculated.

One other thing does look a bit fishy. The base cgroup is special in
that the cpus_allowed for tasks excludes the isolated cpus unless
explicitly allowed via the CPU affinity syscalls. But if I move the task
to a child cpuset then back to the base cpuset it sill has the isolated
CPUs present in cpus_allowed.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1623143

Title:
  Linux container does not take same cpu configuration as kernet's hosts

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1623143/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to