[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1204091747470.4449@chino.kir.corp.google.com>
Date: Mon, 9 Apr 2012 17:52:50 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Hiroyuki Kamezawa <kamezawa.hiroyuki@...il.com>
cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>, Tejun Heo <tj@...nel.org>,
Mike Galbraith <mgalbraith@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...hat.com>,
Paul Menage <paul@...lmenage.org>,
LKML <linux-kernel@...r.kernel.org>,
Li Zefan <lizefan@...wei.com>
Subject: Re: [patch 0/2] cpusets, cpu_cgroup: disallow attaching kthreadd
On Sun, 8 Apr 2012, Hiroyuki Kamezawa wrote:
> I'm sorry if I didn't read e-mails while a trip....let me understand...
>
> - Tejun at el, tries to disallow to move kthreadd into cgroups other than root.
> - You wants to account kthreadd's activity under memg at el.
>
memcg isn't the only use case, you can also use it for cpuacct and any
other future cgroup that wants to do so.
> Then, 2 question from me is....
> 1. If this patch only affects kthreadd, you can move other
> kthread. Is this correct ?
>
Yes, but not those that are forked by kthreadd at runtime without some
delay between the fork and attaching it to a different cgroup. With memcg
slab accounting, for example, allocating the task_struct for the kthread
should appropriately be accounted for in a non-root memcg.
Keep in mind that this isn't only limited to memcg, I've just used it to
illustrate how account for slab is useful. I don't know everybody's use
cases where they may want to do the same thing so I've been arguing
against unnecessarily restricting it from all cgroups other than those
that require it (cpuset and cpu).
Using cpusets as an example, we can even completely remove the restriction
on attaching all PF_THREAD_BOUND threads by not allowing them only if the
destination cpuset has mems that are disjoint from the bound cpu and
disallow changing the mems to be disjoint from a member's bound cpu.
So then we won't even need the restriction for some PF_THREAD_BOUND
threads for cpusets. It's not even a rare restriction: users can easily
use sched_setaffinity() to restrict their scheduling to a subset of their
set of allowed mems.
I haven't looked at the changes needed for the cpu cgroup, but I'm
assuming it will be even easier: disallow attaching kthreadd without rt
allocation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists