public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* cpusets in non-unified hierarchy broken?
@ 2015-02-12 21:49 Serge Hallyn
  2015-02-13  2:16 ` Zefan Li
  0 siblings, 1 reply; 2+ messages in thread
From: Serge Hallyn @ 2015-02-12 21:49 UTC (permalink / raw)
  To: linux-kernel, tj, lizefan; +Cc: Stéphane Graber, christianvanbrauner

Hi,

as of some point in 3.18, cpuset.cpus doesn't seem to be
enforced any more.  I don't see an obvious reason in the
code, but it seems likely to be related to the effective_cpus.

If I mount -t cgroup -o cpuset cpuset /mnt and then mkdir /mnt/lxc,
then /mnt/lxc has:

====================================================
ubuntu@cpuset1:~$ cat /mnt/lxc/cpuset.effective_cpus

ubuntu@cpuset1:~$ cat /mnt/lxc/cpuset.cpus
0-3
====================================================

while

====================================================
ubuntu@cpuset1:~$ cat /mnt/cpuset.effective_cpus
0-3
ubuntu@cpuset1:~$ cat /mnt/cpuset.cpus
0-3
====================================================

My understanding is that effective_cpus in /lxc should be
the /cpuset.effective_cpus & /lxc/cpuset.cpus.  But that
doesn't seem to be the case.  So then, when I start a
container confined to a single cpu (which will use cgroup
/lxc/c1, for instance) then it looks like:

====================================================
ubuntu@cpuset1:~$ cat /mnt/lxc/v1/cpuset.effective_cpus

ubuntu@cpuset1:~$ cat /mnt/lxc/v1/cpuset.cpus
1
====================================================

While the /proc/self/status inside that container and cgroup
shows:

====================================================
root@v1:~# grep -i cpu /proc/self/status
Cpus_allowed:   f
Cpus_allowed_list:      0-3
====================================================

Christian, who originally found this and reported it at
https://github.com/lxc/lxc/issues/427 , also tested that in fact
the tasks are not confined (so it's not just an issue of
improper reporting, it seems)

thanks,
-serge

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cpusets in non-unified hierarchy broken?
  2015-02-12 21:49 cpusets in non-unified hierarchy broken? Serge Hallyn
@ 2015-02-13  2:16 ` Zefan Li
  0 siblings, 0 replies; 2+ messages in thread
From: Zefan Li @ 2015-02-13  2:16 UTC (permalink / raw)
  To: Serge Hallyn; +Cc: linux-kernel, tj, Stéphane Graber, christianvanbrauner

On 2015/2/13 5:49, Serge Hallyn wrote:
> Hi,
> 
> as of some point in 3.18, cpuset.cpus doesn't seem to be
> enforced any more.  I don't see an obvious reason in the
> code, but it seems likely to be related to the effective_cpus.
> 
> If I mount -t cgroup -o cpuset cpuset /mnt and then mkdir /mnt/lxc,
> then /mnt/lxc has:
> 
> ====================================================
> ubuntu@cpuset1:~$ cat /mnt/lxc/cpuset.effective_cpus
> 
> ubuntu@cpuset1:~$ cat /mnt/lxc/cpuset.cpus
> 0-3

This happens when you enable cgroup.clone_children.

Thanks for reporting this bug! Will fix it soon.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-13  2:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-12 21:49 cpusets in non-unified hierarchy broken? Serge Hallyn
2015-02-13  2:16 ` Zefan Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox