[lkml]   [2008]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] sched: fix another race when reading /proc/sched_debug
Paul Menage wrote:
> On Sun, Dec 14, 2008 at 5:50 PM, KAMEZAWA Hiroyuki
> <> wrote:
>> at creation:
>> - cpu_cgroup_populate() should record "tg" that "this cgroup has valid dentry"
>> at deletion
> Wouldn't moving the call to cgroup_create_dir() to before doing
> subsystem initialization fix this problem more straightforwardly? Then
> by the time the cpu subsytem create() callback is called, dentry will
> already be valid.

Yes, it's true, and actually it was the first idea came into my mind when I
started to fix this bug. But I was not sure whether this is an apropriate way.
Now I think it's ok, and we'd better add a comment to indicate we want to
make cgrp->dentry valid before calling subsystem create() method.

Note in print_cfs_rq(), due to the race, tg->css.cgroup can be NULL.
Fortunately, the code checks this condition, but I think it's just by accident
but not awaring there is a race.

 \ /
  Last update: 2008-12-16 10:43    [W:0.054 / U:3.152 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site