• Ben Blum's avatar
    cgroups: add per-thread subsystem callbacks · f780bdb7
    Ben Blum authored
    Add cgroup subsystem callbacks for per-thread attachment in atomic contexts
    
    Add can_attach_task(), pre_attach(), and attach_task() as new callbacks
    for cgroups's subsystem interface.  Unlike can_attach and attach, these
    are for per-thread operations, to be called potentially many times when
    attaching an entire threadgroup.
    
    Also, the old "bool threadgroup" interface is removed, as replaced by
    this.  All subsystems are modified for the new interface - of note is
    cpuset, which requires from/to nodemasks for attach to be globally scoped
    (though per-cpuset would work too) to persist from its pre_attach to
    attach_task and attach.
    
    This is a pre-patch for cgroup-procs-writable.patch.
    Signed-off-by: default avatarBen Blum <bblum@andrew.cmu.edu>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Li Zefan <lizf@cn.fujitsu.com>
    Cc: Matt Helsley <matthltc@us.ibm.com>
    Reviewed-by: default avatarPaul Menage <menage@google.com>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Miao Xie <miaox@cn.fujitsu.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    f780bdb7
cgroup_freezer.c 9.36 KB