lkml.org 
[lkml]   [2017]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v4 15/15] lockdep: Crossrelease feature documentation
    On Wed, Jan 18, 2017 at 08:54:28PM +0900, Byungchul Park wrote:
    > On Wed, Jan 18, 2017 at 12:03:17PM +0100, Peter Zijlstra wrote:
    > > On Wed, Jan 18, 2017 at 07:53:47PM +0900, Byungchul Park wrote:
    > > > On Wed, Jan 18, 2017 at 02:42:30PM +0800, Boqun Feng wrote:
    > > > > On Fri, Dec 09, 2016 at 02:12:11PM +0900, Byungchul Park wrote:
    > > > > [...]
    > > > > > +Example 1:
    > > > > > +
    > > > > > + CONTEXT X CONTEXT Y
    > > > > > + --------- ---------
    > > > > > + mutext_lock A
    > > > > > + lock_page B
    > > > > > + lock_page B
    > > > > > + mutext_lock A /* DEADLOCK */
    > > > >
    > > > > s/mutext_lock/mutex_lock
    > > >
    > > > Thank you.
    > > >
    > > > > > +Example 3:
    > > > > > +
    > > > > > + CONTEXT X CONTEXT Y
    > > > > > + --------- ---------
    > > > > > + mutex_lock A
    > > > > > + mutex_lock A
    > > > > > + mutex_unlock A
    > > > > > + wait_for_complete B /* DEADLOCK */
    > > > >
    > > > > I think this part better be:
    > > > >
    > > > > CONTEXT X CONTEXT Y
    > > > > --------- ---------
    > > > > mutex_lock A
    > > > > mutex_lock A
    > > > > wait_for_complete B /* DEADLOCK */
    > > > > mutex_unlock A
    > > > >
    > > > > , right? Because Y triggers DEADLOCK before X could run mutex_unlock().
    > > >
    > > > There's no different between two examples.
    > >
    > > There is..
    > >
    > > > No matter which one is chosen, mutex_lock A in CONTEXT X cannot be passed.
    > >
    > > But your version shows it does mutex_unlock() before CONTEXT Y does
    > > wait_for_completion().
    > >
    > > The thing about these diagrams is that both columns are assumed to have
    > > the same timeline.
    >
    > X cannot acquire mutex A because Y already acquired it.
    >
    > In order words, all statements below mutex_lock A in X cannot run.

    But your timeline shows it does, which is the error that Boqun pointed
    out.

    \
     
     \ /
      Last update: 2017-01-18 13:30    [W:4.357 / U:0.540 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site