Re: [patch] cpusets, cgroups: disallow attaching kthreadd

From: Mike Galbraith
Date: Tue Oct 11 2011 - 12:57:23 EST


On Tue, 2011-10-11 at 16:08 +0200, Peter Zijlstra wrote:
> On Mon, 2011-10-10 at 09:43 -0700, Tejun Heo wrote:
>
> > Yes, I think we need something like this. wq workers were using
> > PF_THREAD_BOUND to prevent diddling from userland which made some
> > unhappy.
>
> But that can be properly fixed.
>
> > Maybe we need a flag to properly indicate "don't diddle with
> > this thread from userland"? But, then, mainline kernel wouldn't need
> > the current PF_THREAD_BOUND at all. Peter, Steven, what do you think?
>
> Strict per-cpu affinity that is needed for correctness and disallows
> sched_setaffinity() is something entirely different from not being
> allowed to put something in a cgroup.

Agreed. The proposed patchlet is purely a practical matter.

> As to not allowing to put in a cgroup thing, is there anything other
> than kthreadd for which we need to enforce that? So far I've mostly
> treated it like: root can do stupid things, this is one of them, don't
> do that then.

Yeah, that's the other side of the coin. The only thing I can think of
justifying a response other than "well, gee, don't do that" is that Joe
User shouldn't need to know or care about kernel workqueue details.

I don't know of anything other than kthreadd where moving it here, or
over yonder matters one bit.

-Mike

--
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/