lkml.org 
[lkml]   [2014]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: semantics of reader/writer semaphores in rt patch
    On Sun, Oct 26, 2014 at 12:21:31AM +0200, Thomas Gleixner wrote:
    > On Sun, 26 Oct 2014, Thomas Gleixner wrote:
    > > On Thu, 23 Oct 2014, Chris Friesen wrote:
    > > > Does the RT kernel just disallow this sort of algorithm?
    > >
    > > Yes. For a good reason. Let's add thread C
    > >
    > > A B C
    > > down_read(X)
    > > down_write(X)
    > > lock(Y)
    > > modify data
    > > unlock(Y)
    > > wake(B)
    > > down_read(X)
    > >
    > > Due to the mainline rwsem fairness semantics:
    > >
    > > A holds X, C is blocked on A and B is blocked on A.
    > >
    > > Deadlock, without RT and the single reader restriction being involved.
    > >
    > > So RT does not violate ANY of the existing mainline semantics, it just
    > > imposes a performance impact of not allowing multiple readers.
    >
    > @peterz: It might be worthwhile to have a CONFIG_LOCKDEP=y dependent
    > mode which restricts concurrent readers to 1 in mainline to catch this
    > kind of stuff. Hmm?

    There were patches by ego that fix lockdep's read side tracking. I need
    to find a few spare days to look at those :/


    \
     
     \ /
      Last update: 2014-10-26 09:21    [W:2.571 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site