lkml.org 
[lkml]   [2008]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: fix another race when reading /proc/sched_debug
KAMEZAWA Hiroyuki wrote:
> On Mon, 15 Dec 2008 11:43:49 +0100
> Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>
>>> + if (cgroup_is_removed(cgroup) || !cgroup->dentry)
>>> + return;
>>> cgroup_path(cgroup, path, sizeof(path));
>>> + }
>> Perhaps wrap that check in a cgroup_*() helper? That would avoid the
>> duplication, be clearer and not open code the ->dentry assumption.
>>
>> cgroup_is_active() perhaps?
>>

We are fixing this particular race, so open code and comment can document
the problem clearer.

And this wrapper shouldn't be used by other cgroup users, if one needs to
do these checks, he should have a reason and comment is needed to explain
what's happening.

Also, I can't think out an appropriate name..

>
> I vote for cgroup_is_populated().
>

But non-populated means the directory isn't filled up with control files,
this function name doesn't indicate if the dir dentry itself is valid or not..



\
 
 \ /
  Last update: 2008-12-16 06:53    [W:0.141 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site