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
    On Thu, Sep 02, 2010 at 10:05:51AM -0700, David Miller wrote:
    > From: Peter Zijlstra <peterz@infradead.org>
    > Date: Thu, 02 Sep 2010 12:38:36 +0200
    >
    > > 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.
    >
    > In fact shouldn't this be a rcu_dereference() or similar?

    The rcu_dereference() is there, just buried in task_subsys_state_check()
    which is called from task_subsys_state(). The code extracts the classid,
    which is an integer, so the RCU-protected pointer does not leak out of
    the RCU read-side critical section.

    So this is OK, but the changelog should indeed say why it is OK.

    Thanx, Paul


    \
     
     \ /
      Last update: 2010-09-02 19:19    [W:0.027 / U:33.040 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site