From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753475AbbCBGQn (ORCPT ); Mon, 2 Mar 2015 01:16:43 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:34313 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbbCBGQl (ORCPT ); Mon, 2 Mar 2015 01:16:41 -0500 Message-ID: <54F40043.9050201@huawei.com> Date: Mon, 2 Mar 2015 14:16:35 +0800 From: Zefan Li User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Tejun Heo CC: Christian Brauner , Serge Hallyn , =?GB2312?B?U3SopnBoYW5lIEdyYWJlcg==?= , LKML , Cgroups Subject: Re: [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled References: <54DD6D55.2070603@huawei.com> In-Reply-To: <54DD6D55.2070603@huawei.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.18.230] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tejun, Could you pick up those bug fixes? Or should I ask Ingo/akpm to take care of them? On 2015/2/13 11:19, Zefan Li wrote: > If clone_children is enabled, effective masks won't be initialized > due to the bug: > > # mount -t cgroup -o cpuset xxx /mnt > # echo 1 > cgroup.clone_children > # mkdir /mnt/tmp > # cat /mnt/tmp/ > # cat cpuset.effective_cpus > > # cat cpuset.cpus > 0-15 > > And then this cpuset won't constrain the tasks in it. > > Either the bug or the fix has no effect on unified hierarchy, as > there's no clone_chidren flag there any more. > > Reported-by: Christian Brauner > Reported-by: Serge Hallyn > Cc: # 3.17+ > Signed-off-by: Zefan Li > --- > kernel/cpuset.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/cpuset.c b/kernel/cpuset.c > index 64b257f..7e9d711 100644 > --- a/kernel/cpuset.c > +++ b/kernel/cpuset.c > @@ -1992,7 +1992,9 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) > > spin_lock_irq(&callback_lock); > cs->mems_allowed = parent->mems_allowed; > + cs->effective_mems = parent->mems_allowed; > cpumask_copy(cs->cpus_allowed, parent->cpus_allowed); > + cpumask_copy(cs->effective_cpus, parent->cpus_allowed); > spin_unlock_irq(&callback_lock); > out_unlock: > mutex_unlock(&cpuset_mutex); >