Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751920AbbBLVt5 (ORCPT ); Thu, 12 Feb 2015 16:49:57 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:54817 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751775AbbBLVtz (ORCPT ); Thu, 12 Feb 2015 16:49:55 -0500 Date: Thu, 12 Feb 2015 21:49:51 +0000 From: Serge Hallyn To: linux-kernel@vger.kernel.org, tj@kernel.org, lizefan@huawei.com Cc: =?iso-8859-1?Q?St=E9phane?= Graber , christianvanbrauner@gmail.com Subject: cpusets in non-unified hierarchy broken? Message-ID: <20150212214950.GB10662@ubuntumail> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1904 Lines: 59 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/