lkml.org 
[lkml]   [2010]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cls_cgroup: Fix rcu lockdep warning
Peter Zijlstra wrote:
> On Thu, 2010-09-02 at 14:30 +0800, Li Zefan wrote:
>> Calling task_subsys_state() without holding rcu_read_lock or
>> cgroup_mutex can cause lockdep warning.
>>
>
> That is not a suitable changelog.
>
> Was the warning correct? Is your patch correct? What does RCU protect
> here and why can we use classid after dropping it.
>
> Simply frobbing code to make the warning go away is not good.
>
>

task->cgroups and task->cgroups->subsys[i] are protected by RCU.
So we avoid accessing invalid pointers here. This can happen,
for example, when you are deref those pointers while someone move
@task from one cgroup to another.

otoh, there is no lock rule for ->classid.


\
 
 \ /
  Last update: 2010-09-03 03:07    [W:0.056 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site