[PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-05-24 Thread Byungchul Park
The ring buffer can be overwritten by hardirq/softirq/work contexts. That cases must be considered on rollback or commit. For example, |<-- hist_lock ring buffer size ->| iii wrapped > iii

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-12 Thread Peter Zijlstra
On Wed, Jul 12, 2017 at 11:00:53AM +0900, Byungchul Park wrote: > On Tue, Jul 11, 2017 at 06:12:32PM +0200, Peter Zijlstra wrote: > > Right, like I wrote in the comment; I don't think you need quite this > > much. > > > > The problem only happens if you rewind more than MAX_XHLOCKS_NR; > > althou

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-12 Thread Byungchul Park
On Wed, Jul 12, 2017 at 09:56:17AM +0200, Peter Zijlstra wrote: > On Wed, Jul 12, 2017 at 11:00:53AM +0900, Byungchul Park wrote: > > On Tue, Jul 11, 2017 at 06:12:32PM +0200, Peter Zijlstra wrote: > > > > Right, like I wrote in the comment; I don't think you need quite this > > > much. > > > > >

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Peter Zijlstra
On Thu, Jul 13, 2017 at 11:07:45AM +0900, Byungchul Park wrote: > Does my approach have problems, rewinding to 'original idx' on exit and > deciding whether overwrite or not? I think, this way, no need to do the > drastic work. Or.. does my one get more overhead in usual case? So I think that inva

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Byungchul Park
On Thu, Jul 13, 2017 at 10:14:42AM +0200, Peter Zijlstra wrote: > On Thu, Jul 13, 2017 at 11:07:45AM +0900, Byungchul Park wrote: > > Does my approach have problems, rewinding to 'original idx' on exit and > > deciding whether overwrite or not? I think, this way, no need to do the > > drastic work.

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Peter Zijlstra
On Thu, Jul 13, 2017 at 05:57:46PM +0900, Byungchul Park wrote: > On Thu, Jul 13, 2017 at 10:14:42AM +0200, Peter Zijlstra wrote: > > On Thu, Jul 13, 2017 at 11:07:45AM +0900, Byungchul Park wrote: > > > Does my approach have problems, rewinding to 'original idx' on exit and > > > deciding whether

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Byungchul Park
On Thu, Jul 13, 2017 at 11:50:52AM +0200, Peter Zijlstra wrote: > wait_for_completion(&C); > atomic_inc_return(); > > mutex_lock(A1); > mutex_unlock(A1); > > > >

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Peter Zijlstra
On Thu, Jul 13, 2017 at 07:09:53PM +0900, Byungchul Park wrote: > On Thu, Jul 13, 2017 at 11:50:52AM +0200, Peter Zijlstra wrote: > > wait_for_completion(&C); > > atomic_inc_return(); > > > > mutex_lock(A1); > > mute

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Peter Zijlstra
On Thu, Jul 13, 2017 at 12:29:05PM +0200, Peter Zijlstra wrote: > On Thu, Jul 13, 2017 at 07:09:53PM +0900, Byungchul Park wrote: > > On Thu, Jul 13, 2017 at 11:50:52AM +0200, Peter Zijlstra wrote: > > > wait_for_completion(&C); > > > atomic_inc_return(); > > > > > >

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Byungchul Park
On Thu, Jul 13, 2017 at 7:29 PM, Peter Zijlstra wrote: > On Thu, Jul 13, 2017 at 07:09:53PM +0900, Byungchul Park wrote: >> On Thu, Jul 13, 2017 at 11:50:52AM +0200, Peter Zijlstra wrote: >> > wait_for_completion(&C); >> > atomic_inc_return(); >> > >> >

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Byungchul Park
On Thu, Jul 13, 2017 at 8:12 PM, Peter Zijlstra wrote: > On Thu, Jul 13, 2017 at 12:29:05PM +0200, Peter Zijlstra wrote: >> On Thu, Jul 13, 2017 at 07:09:53PM +0900, Byungchul Park wrote: >> > On Thu, Jul 13, 2017 at 11:50:52AM +0200, Peter Zijlstra wrote: >> > > wait_for_completion(&C); >> > >

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Byungchul Park
On Thu, Jul 13, 2017 at 08:23:33PM +0900, Byungchul Park wrote: > On Thu, Jul 13, 2017 at 8:12 PM, Peter Zijlstra wrote: > > On Thu, Jul 13, 2017 at 12:29:05PM +0200, Peter Zijlstra wrote: > >> On Thu, Jul 13, 2017 at 07:09:53PM +0900, Byungchul Park wrote: > >> > On Thu, Jul 13, 2017 at 11:50:52A

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-13 Thread Byungchul Park
On Thu, Jul 13, 2017 at 08:23:33PM +0900, Byungchul Park wrote: > On Thu, Jul 13, 2017 at 8:12 PM, Peter Zijlstra wrote: > > On Thu, Jul 13, 2017 at 12:29:05PM +0200, Peter Zijlstra wrote: > >> On Thu, Jul 13, 2017 at 07:09:53PM +0900, Byungchul Park wrote: > >> > On Thu, Jul 13, 2017 at 11:50:52A

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-21 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 03:42:10PM +0900, Byungchul Park wrote: > On Thu, Jul 13, 2017 at 08:23:33PM +0900, Byungchul Park wrote: > > On Thu, Jul 13, 2017 at 8:12 PM, Peter Zijlstra > > wrote: > > > On Thu, Jul 13, 2017 at 12:29:05PM +0200, Peter Zijlstra wrote: > > >> On Thu, Jul 13, 2017 at 07:

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-17 Thread Byungchul Park
On Thu, Jul 13, 2017 at 10:14:42AM +0200, Peter Zijlstra wrote: > +static void __crossrelease_end(unsigned int *stamp) > +{ [snip] > + > + /* > + * If we rewind past the tail; all of history is lost. > + */ > + if ((current->xhlock_idx_max - *stamp) < MAX_XHLOCKS_NR) > +

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-11 Thread Peter Zijlstra
ARGH!!! please, if there are known holes in patches, put a comment in. I now had to independently discover this problem during review of the last patch. On Wed, May 24, 2017 at 05:59:39PM +0900, Byungchul Park wrote: > The ring buffer can be overwritten by hardirq/softirq/work contexts. > That c

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-11 Thread Byungchul Park
On Tue, Jul 11, 2017 at 06:12:32PM +0200, Peter Zijlstra wrote: > > ARGH!!! please, if there are known holes in patches, put a comment in. The fourth of the last change log is the comment, but it was not enough. I will try to add more comment in that case. > I now had to independently discover t

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-24 Thread Byungchul Park
On Fri, Jul 21, 2017 at 03:54:20PM +0200, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 03:42:10PM +0900, Byungchul Park wrote: > > On Thu, Jul 13, 2017 at 08:23:33PM +0900, Byungchul Park wrote: > > > On Thu, Jul 13, 2017 at 8:12 PM, Peter Zijlstra > > > wrote: > > > > On Thu, Jul 13, 2017 at

Re: [PATCH v7 06/16] lockdep: Detect and handle hist_lock ring buffer overwrite

2017-07-25 Thread Peter Zijlstra
On Tue, Jul 25, 2017 at 03:29:45PM +0900, Byungchul Park wrote: > _No_, as I already said. > > > (/me copy paste from older email) > > > > That gives: > > > > xhist[ 0] = A1 > > xhist[ 1] = B1 > > ... > > xhist[63] = B63 > > > > then we wrap and have: > > > >