lkml.org 
[lkml]   [2009]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] cgroup: fix reverse unlock sequence in cgroup_get_sb
    * menage@google.com <menage@google.com> [2009-07-21 08:34:51]:

    > On Tue, Jul 21, 2009 at 5:01 AM, Balbir Singh<balbir@linux.vnet.ibm.com> wrote:
    > >
    > > lock(A)
    > > lock(B)
    > > unlock(A)
    > > unlock(B)
    > >
    > > Tomorrow if a unsuspecting programmer does this
    > >
    > > lock(A)
    > > lock(B)
    > > unlock(A)
    > >
    > > code block
    > >
    > > unlock(B)
    > >
    > >
    > > What protects code block? lock B? Is that the intention?
    > >
    >
    > An "unsuspecting programmer" shouldn't be adding code to
    > multi-threaded routines without thoroughly understanding the locking.
    >

    Agreed, but why leave behind places for people to do so. There is the
    consistency factor as well, see below.


    > I guess there's no harm in this patch, but as Li says, it doesn't
    > really change anything.
    >

    Well all the other places do it right in the same routine.

    --
    Balbir


    \
     
     \ /
      Last update: 2009-07-21 17:49    [W:2.648 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site