Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753643AbbKZXmU (ORCPT ); Thu, 26 Nov 2015 18:42:20 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:33442 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753357AbbKZXmR (ORCPT ); Thu, 26 Nov 2015 18:42:17 -0500 Message-ID: <1448581333.7954.242.camel@gmail.com> Subject: Re: [PATCH] cgroups: move cpuset specific checks from generic code to cpuset_can_attach (v2) From: Mike Galbraith To: Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, Tejun Heo , Luiz Capitulino , Chao Peng , Vikas Shivappa Date: Thu, 26 Nov 2015 16:42:13 -0700 In-Reply-To: <20151126223230.GA16962@amt.cnet> References: <20151125220117.GA990@amt.cnet> <1448539767.7954.214.camel@gmail.com> <20151126223230.GA16962@amt.cnet> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2446 Lines: 74 On Thu, 2015-11-26 at 20:32 -0200, Marcelo Tosatti wrote: > Move PF_NO_SETAFFINITY and kthreadd_task checks to cpuset cgroups, > where they belong. This makes it possible to attach PF_NO_SETAFFINITY > tasks to Intel CAT cgroup. > > Reported-by: Luiz Capitulino > Signed-off-by: Marcelo Tosatti > Reviewed-by: Chao Peng > > v2: "PF_NO_SETAFFINITY check" -> "PF_NO_SETAFFINITY and kthreadd_task > checks" > > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > index f89d929..0603652 100644 > --- a/kernel/cgroup.c > +++ b/kernel/cgroup.c > @@ -2466,16 +2466,6 @@ static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf, > if (threadgroup) > tsk = tsk->group_leader; > > - /* > - * Workqueue threads may acquire PF_NO_SETAFFINITY and become > - * trapped in a cpuset, or RT worker may be born in a cgroup > - * with no rt_runtime allocated. Just say no. > - */ > - if (tsk == kthreadd_task || (tsk->flags & PF_NO_SETAFFINITY)) { > - ret = -EINVAL; > - goto out_unlock_rcu; > - } > - > get_task_struct(tsk); > rcu_read_unlock(); > > diff --git a/kernel/cpuset.c b/kernel/cpuset.c > index f0acff0..9fff4d6 100644 > --- a/kernel/cpuset.c > +++ b/kernel/cpuset.c > @@ -53,6 +53,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1445,6 +1446,17 @@ static int cpuset_can_attach(struct cgroup_subsys_state *css, > goto out_unlock; > > cgroup_taskset_for_each(task, tset) { > + /* > + * Workqueue threads may acquire PF_NO_SETAFFINITY and become > + * trapped in a cpuset, or RT worker may be born in a cgroup > + * with no rt_runtime allocated. Just say no. > + */ > + if (task == kthreadd_task || > + (task->flags & PF_NO_SETAFFINITY)) { > + ret = -EINVAL; > + goto out_unlock; > + } > + > ret = task_can_attach(task, cs->cpus_allowed); > if (ret) > goto out_unlock; Note the rt_runtime reference in the comment, that wasn't about cpuset. The kthreadd wants to remain immune to all fiddlings methinks. -Mike -- 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/