Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-23 Thread Boqun Feng
On Sat, Aug 19, 2017 at 03:34:01PM +0200, Arnd Bergmann wrote: > On Sat, Aug 19, 2017 at 2:51 PM, Arnd Bergmann wrote: > > >> --- a/include/linux/completion.h > >> +++ b/include/linux/completion.h > >> @@ -74,7 +74,7 @@ static inline void complete_release_commit(struct > >> completion *x) {} > >

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-19 Thread Boqun Feng
On Sat, Aug 19, 2017 at 02:51:17PM +0200, Arnd Bergmann wrote: [...] > > Those two "rep movsq"s are very suspicious, because > > COMPLETION_INITIALIZER_ONSTACK() should initialize the data in-place, > > rather than move it to some temporary variable and copy it back. > > Right. I've seen this beha

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-19 Thread Arnd Bergmann
On Sat, Aug 19, 2017 at 2:51 PM, Arnd Bergmann wrote: >> --- a/include/linux/completion.h >> +++ b/include/linux/completion.h >> @@ -74,7 +74,7 @@ static inline void complete_release_commit(struct >> completion *x) {} >> #endif >> >> #define COMPLETION_INITIALIZER_ONSTACK(work) \ >> - ({

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-19 Thread Arnd Bergmann
On Sat, Aug 19, 2017 at 1:43 AM, Boqun Feng wrote: > Hi Arnd, > > On Mon, Aug 14, 2017 at 10:50:24AM +0200, Arnd Bergmann wrote: >> On Mon, Aug 7, 2017 at 9:12 AM, Byungchul Park >> wrote: >> > Although wait_for_completion() and its family can cause deadlock, the >> > lock correctness validator

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-18 Thread Boqun Feng
Hi Arnd, On Mon, Aug 14, 2017 at 10:50:24AM +0200, Arnd Bergmann wrote: > On Mon, Aug 7, 2017 at 9:12 AM, Byungchul Park wrote: > > Although wait_for_completion() and its family can cause deadlock, the > > lock correctness validator could not be applied to them until now, > > because things like

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-14 Thread Arnd Bergmann
On Mon, Aug 7, 2017 at 9:12 AM, Byungchul Park wrote: > Although wait_for_completion() and its family can cause deadlock, the > lock correctness validator could not be applied to them until now, > because things like complete() are usually called in a different context > from the waiting context,

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-09 Thread Byungchul Park
On Wed, Aug 09, 2017 at 12:24:39PM +0200, Peter Zijlstra wrote: > On Wed, Aug 09, 2017 at 11:51:07AM +0200, Peter Zijlstra wrote: > > On Mon, Aug 07, 2017 at 04:12:56PM +0900, Byungchul Park wrote: > > > +static inline void wait_for_completion(struct completion *x) > > > +{ > > > + complete_acquire

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-09 Thread Peter Zijlstra
On Wed, Aug 09, 2017 at 11:51:07AM +0200, Peter Zijlstra wrote: > On Mon, Aug 07, 2017 at 04:12:56PM +0900, Byungchul Park wrote: > > +static inline void wait_for_completion(struct completion *x) > > +{ > > + complete_acquire(x); > > + __wait_for_completion(x); > > + complete_release(x); > >

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-09 Thread Peter Zijlstra
On Mon, Aug 07, 2017 at 04:12:56PM +0900, Byungchul Park wrote: > +static inline void wait_for_completion(struct completion *x) > +{ > + complete_acquire(x); > + __wait_for_completion(x); > + complete_release(x); > +} > + > +static inline void wait_for_completion_io(struct completion *x

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-07 Thread kbuild test robot
Hi Byungchul, [auto build test ERROR on linus/master] [also build test ERROR on v4.13-rc4 next-20170804] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Byungchul-Park/lockdep-Implement-crossrele

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-07 Thread kbuild test robot
Hi Byungchul, [auto build test ERROR on linus/master] [also build test ERROR on v4.13-rc4 next-20170804] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Byungchul-Park/lockdep-Implement-crossrele

[PATCH v8 09/14] lockdep: Apply crossrelease to completions

2017-08-07 Thread Byungchul Park
Although wait_for_completion() and its family can cause deadlock, the lock correctness validator could not be applied to them until now, because things like complete() are usually called in a different context from the waiting context, which violates lockdep's assumption. Thanks to CONFIG_LOCKDEP_