lkml.org 
[lkml]   [2012]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2012-04-10 02:55    [W:0.100 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site