Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-19 Thread peterz
On Wed, Aug 19, 2020 at 05:32:50PM +0200, pet...@infradead.org wrote: > On Wed, Aug 19, 2020 at 08:39:13PM +1000, Alexey Kardashevskiy wrote: > > > > or current upstream? > > > > The upstream 18445bf405cb (13 hours old) also shows the problem. Yours > > 1/2 still fixes it. > > Afaict that just

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-19 Thread peterz
On Wed, Aug 19, 2020 at 08:39:13PM +1000, Alexey Kardashevskiy wrote: > > or current upstream? > > The upstream 18445bf405cb (13 hours old) also shows the problem. Yours > 1/2 still fixes it. Afaict that just reduces the window. Isn't the problem that: arch/powerpc/kernel/exceptions-64e.S

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-19 Thread Alexey Kardashevskiy
On 19/08/2020 09:54, Nicholas Piggin wrote: > Excerpts from pet...@infradead.org's message of August 19, 2020 1:41 am: >> On Tue, Aug 18, 2020 at 05:22:33PM +1000, Nicholas Piggin wrote: >>> Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: On Wed, Aug 12, 2020 at

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-18 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of August 19, 2020 1:41 am: > On Tue, Aug 18, 2020 at 05:22:33PM +1000, Nicholas Piggin wrote: >> Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: >> > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: >> >>

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-18 Thread peterz
On Tue, Aug 18, 2020 at 05:22:33PM +1000, Nicholas Piggin wrote: > Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: > > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: > >> Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: > >> > > >>

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-18 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: >> Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: >> > >> > What's wrong with something like this? >> > >> > AFAICT there's no

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-12 Thread peterz
On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: > Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: > > > > What's wrong with something like this? > > > > AFAICT there's no reason to actually try and add IRQ tracing here, it's > > just a hand full of

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-12 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: > > What's wrong with something like this? > > AFAICT there's no reason to actually try and add IRQ tracing here, it's > just a hand full of instructions at the most. Because we may want to use that in other places as well,

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-08-07 Thread peterz
What's wrong with something like this? AFAICT there's no reason to actually try and add IRQ tracing here, it's just a hand full of instructions at the most. --- diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index 3a0db7b0b46e..6be22c1838e2 100644 ---

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-28 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of July 26, 2020 10:11 pm: > On Sun, Jul 26, 2020 at 02:14:34PM +1000, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > >> > Which is 'funny' when it interleaves like: >> > >> >local_irq_disable(); >> >

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-26 Thread peterz
On Sun, Jul 26, 2020 at 02:14:34PM +1000, Nicholas Piggin wrote: > Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > > Which is 'funny' when it interleaves like: > > > > local_irq_disable(); > > ... > > local_irq_enable() > > trace_hardirqs_on(); > > > >

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-26 Thread peterz
On Sun, Jul 26, 2020 at 02:14:34PM +1000, Nicholas Piggin wrote: > > Now, x86, and at least arm64 call nmi_enter() before > > trace_hardirqs_off(), but AFAICT Power never did that, and that's part > > of the problem. nmi_enter() does lockdep_off() and that _used_ to also > > kill IRQ tracking. >

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-26 Thread Alexey Kardashevskiy
On 24/07/2020 15:59, Nicholas Piggin wrote: > Excerpts from Alexey Kardashevskiy's message of July 24, 2020 2:16 pm: >> >> >> On 23/07/2020 23:11, Nicholas Piggin wrote: >>> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-25 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/powerpc/include/asm/hw_irq.h >> b/arch/powerpc/include/asm/hw_irq.h >> index 3a0db7b0b46e..35060be09073 100644 >> ---

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-25 Thread Peter Zijlstra
On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > diff --git a/arch/powerpc/include/asm/hw_irq.h > b/arch/powerpc/include/asm/hw_irq.h > index 3a0db7b0b46e..35060be09073 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -200,17

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-24 Thread Athira Rajeev
> On 24-Jul-2020, at 9:46 AM, Alexey Kardashevskiy wrote: > > > > On 23/07/2020 23:11, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >>> On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >>> diff --git

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-24 Thread Nicholas Piggin
Excerpts from Alexey Kardashevskiy's message of July 24, 2020 2:16 pm: > > > On 23/07/2020 23:11, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >>> On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >>> diff --git

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Alexey Kardashevskiy
On 23/07/2020 23:11, Nicholas Piggin wrote: > Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >> On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> >>> diff --git a/arch/powerpc/include/asm/hw_irq.h >>> b/arch/powerpc/include/asm/hw_irq.h >>> index

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread kernel test robot
Hi Nicholas, I love your patch! Perhaps something to improve: [auto build test WARNING on linux/master] [also build test WARNING on powerpc/next linus/master v5.8-rc6 next-20200723] [cannot apply to tip/locking/core] [If your patch is applied to the wrong git tree, kindly drop us a note. And

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread kernel test robot
Hi Nicholas, I love your patch! Yet something to improve: [auto build test ERROR on linux/master] [also build test ERROR on powerpc/next linus/master v5.8-rc6 next-20200723] [cannot apply to tip/locking/core] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 24, 2020 12:59 am: > On Thu, Jul 23, 2020 at 11:11:03PM +1000, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >> > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> > >> >> diff --git

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Peter Zijlstra
On Thu, Jul 23, 2020 at 11:11:03PM +1000, Nicholas Piggin wrote: > Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: > > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > > > >> diff --git a/arch/powerpc/include/asm/hw_irq.h > >>

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > >> diff --git a/arch/powerpc/include/asm/hw_irq.h >> b/arch/powerpc/include/asm/hw_irq.h >> index 3a0db7b0b46e..35060be09073 100644 >> ---

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Peter Zijlstra
On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > diff --git a/arch/powerpc/include/asm/hw_irq.h > b/arch/powerpc/include/asm/hw_irq.h > index 3a0db7b0b46e..35060be09073 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -200,17

[PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
If an interrupt is not masked by local_irq_disable (e.g., a powerpc perf interrupt), then it can hit in local_irq_enable() after trace_hardirqs_on() and before raw_local_irq_enable(). If that interrupt handler calls local_irq_save(), it will call trace_hardirqs_off() but the local_irq_restore()