All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Zefan Li <lizefan@huawei.com>
Cc: "Tejun Heo" <tj@kernel.org>,
	"Christian Brauner" <christianvanbrauner@gmail.com>,
	"Serge Hallyn" <serge.hallyn@ubuntu.com>,
	"Stéphane Graber" <stgraber@ubuntu.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Cgroups <cgroups@vger.kernel.org>
Subject: Re: [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled
Date: Fri, 13 Feb 2015 07:19:02 +0100	[thread overview]
Message-ID: <20150213061902.GA26332@mail.hallyn.com> (raw)
In-Reply-To: <54DD6D55.2070603@huawei.com>

Quoting Zefan Li (lizefan@huawei.com):
> 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 <christianvanbrauner@gmail.com>
> Reported-by: Serge Hallyn <serge.hallyn@ubuntu.com>

Thanks - this give sme the correct output in /proc/self/status and
cpuest.cpus.  (I didn't do a stress test but that seems unlikely to
be broken)

Tested-by: Serge Hallyn <serge.hallyn@canonical.com>

> Cc: <stable@vger.kernel.org> # 3.17+
> Signed-off-by: Zefan Li <lizefan@huawei.com>
> ---
>  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);
> -- 
> 1.8.0.2
> 
> --
> 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/

  parent reply	other threads:[~2015-02-13  6:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13  3:19 [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled Zefan Li
2015-02-13  3:19 ` Zefan Li
     [not found] ` <54DD6D55.2070603-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-02-13  3:20   ` [PATCH 2/3] cpuset: fix a warning when clearing configured masks in old hierarchy Zefan Li
2015-02-13  3:20     ` Zefan Li
2015-02-13  3:21   ` [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled Zefan Li
2015-02-13  3:21     ` Zefan Li
2015-02-13  3:58   ` [PATCH 3/3] cpuset: Fix cpuset sched_relax_domain_level Zefan Li
2015-02-13  3:58     ` Zefan Li
2015-02-13  6:19 ` Serge E. Hallyn [this message]
2015-03-02  6:16 ` [PATCH 1/3] cpuset: initialize effective masks when clone_children is enabled Zefan Li
2015-03-02 16:55   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150213061902.GA26332@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=cgroups@vger.kernel.org \
    --cc=christianvanbrauner@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=serge.hallyn@ubuntu.com \
    --cc=stgraber@ubuntu.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.