• Shaohua Li's avatar
    kthread: add a mechanism to store cgroup info · 05e3db95
    Shaohua Li authored
    kthread usually runs jobs on behalf of other threads. The jobs should be
    charged to cgroup of original threads. But the jobs run in a kthread,
    where we lose the cgroup context of original threads. The patch adds a
    machanism to record cgroup info of original threads in kthread context.
    Later we can retrieve the cgroup info and attach the cgroup info to jobs.
    
    Since this mechanism is only required by kthread, we store the cgroup
    info in kthread data instead of generic task_struct.
    Acked-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarShaohua Li <shli@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    05e3db95
kthread.c 33.5 KB