Re: patch] cpusets, cgroups: disallow attaching kthreadd

From: Peter Zijlstra
Date: Thu Oct 20 2011 - 06:32:17 EST


On Wed, 2011-10-19 at 12:47 -0700, David Rientjes wrote:
> On Wed, 19 Oct 2011, Peter Zijlstra wrote:
>
> > My thinking is that kthreadd is the mother of all kernel threads and the
> > kernel assumes it can spawn kthreads without constraints, a valid
> > assumption IMO.
> >
>
> Cgroups don't necessarily imply constraints,

And yet they're called: Control Groups..

> though, you could devise a
> cgroup to just do monitoring or statistics tracking for an aggregate of
> tasks and placing kthreadd in such a cgroup would make perfect sense
> because then, since children are forked in the same cgroup, you can
> monitor or gather statistics for all kthreads. This can be your only
> cgroup on the system.

I guess you could, but does it really make sense? Also, you could sort
this by extending the cgroup interface to explicitly distinct between
controllers and !controllers.

> Cpusets, though, does imply cpu constraints, which is why we decline
> PF_THREAD_BOUND threads from moving in the first place, which is the
> source of Mike's issue. It's can_attach() function can explicitly decline
> kthreadd as well since the cpu constraints of both types of threads should
> never be altered by either cpusets or sched_setaffinity().

Yeah, and I'm saying we want to exclude _all_ controllers from placing
constraints on kthreadd, even those that might not immediately break
stuff.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/