mbox series

[v3,0/4] powerpc: watchdog fixes

Message ID 20211110025056.2084347-1-npiggin@gmail.com (mailing list archive)
Headers show
Series powerpc: watchdog fixes | expand

Message

Nicholas Piggin Nov. 10, 2021, 2:50 a.m. UTC
These are some watchdog fixes and improvements, in particular a
deadlock between the wd_smp_lock and console lock when the watchdog
fires, found by Laurent.

Thanks,
Nick

Since v2:
- Fix a false positive warning in patch 1 found by Laurent.
- Move a comment change hunk to the correct patch.
- Drop the patch that removed the unstuck backtrace which is considered
  useful.

Since v1:
- Fixes noticed by Laurent in v1.
- Correct the description of the ABBA deadlock I wrote incorrectly in
  v1.
- Made several other improvements (patches 2,4,5).

Nicholas Piggin (4):
  powerpc/watchdog: Fix missed watchdog reset due to memory ordering
    race
  powerpc/watchdog: tighten non-atomic read-modify-write access
  powerpc/watchdog: Avoid holding wd_smp_lock over printk and
    smp_send_nmi_ipi
  powerpc/watchdog: read TB close to where it is used

 arch/powerpc/kernel/watchdog.c | 182 ++++++++++++++++++++++++++-------
 1 file changed, 147 insertions(+), 35 deletions(-)

Comments

Michael Ellerman Nov. 25, 2021, 9:36 a.m. UTC | #1
On Wed, 10 Nov 2021 12:50:52 +1000, Nicholas Piggin wrote:
> These are some watchdog fixes and improvements, in particular a
> deadlock between the wd_smp_lock and console lock when the watchdog
> fires, found by Laurent.
> 
> Thanks,
> Nick
> 
> [...]

Applied to powerpc/next.

[1/4] powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
      https://git.kernel.org/powerpc/c/5dad4ba68a2483fc80d70b9dc90bbe16e1f27263
[2/4] powerpc/watchdog: tighten non-atomic read-modify-write access
      https://git.kernel.org/powerpc/c/858c93c31504ac1507084493d7eafbe7e2302dc2
[3/4] powerpc/watchdog: Avoid holding wd_smp_lock over printk and smp_send_nmi_ipi
      https://git.kernel.org/powerpc/c/76521c4b0291ad25723638ade5a0ff4d5f659771
[4/4] powerpc/watchdog: read TB close to where it is used
      https://git.kernel.org/powerpc/c/1f01bf90765fa5f88fbae452c131c1edf5cda7ba

cheers
Laurent Dufour Nov. 25, 2021, 3:11 p.m. UTC | #2
On 25/11/2021, 10:36:43, Michael Ellerman wrote:
> On Wed, 10 Nov 2021 12:50:52 +1000, Nicholas Piggin wrote:
>> These are some watchdog fixes and improvements, in particular a
>> deadlock between the wd_smp_lock and console lock when the watchdog
>> fires, found by Laurent.
>>
>> Thanks,
>> Nick
>>
>> [...]
> 
> Applied to powerpc/next.
> 
> [1/4] powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
>       https://git.kernel.org/powerpc/c/5dad4ba68a2483fc80d70b9dc90bbe16e1f27263
> [2/4] powerpc/watchdog: tighten non-atomic read-modify-write access
>       https://git.kernel.org/powerpc/c/858c93c31504ac1507084493d7eafbe7e2302dc2
> [3/4] powerpc/watchdog: Avoid holding wd_smp_lock over printk and smp_send_nmi_ipi
>       https://git.kernel.org/powerpc/c/76521c4b0291ad25723638ade5a0ff4d5f659771
> [4/4] powerpc/watchdog: read TB close to where it is used
>       https://git.kernel.org/powerpc/c/1f01bf90765fa5f88fbae452c131c1edf5cda7ba
> 
> cheers
> 

Hi Michael,

This series has been superseded by this series (v4)
http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=272865

Do you plan to apply that v4?

Thanks,
Laurent.
Michal Suchanek Nov. 25, 2021, 3:26 p.m. UTC | #3
Hello,

On Thu, Nov 25, 2021 at 04:11:03PM +0100, Laurent Dufour wrote:
> On 25/11/2021, 10:36:43, Michael Ellerman wrote:
> > On Wed, 10 Nov 2021 12:50:52 +1000, Nicholas Piggin wrote:
> >> These are some watchdog fixes and improvements, in particular a
> >> deadlock between the wd_smp_lock and console lock when the watchdog
> >> fires, found by Laurent.
> >>
> >> Thanks,
> >> Nick
> >>
> >> [...]
> > 
> > Applied to powerpc/next.
> > 
> > [1/4] powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
> >       https://git.kernel.org/powerpc/c/5dad4ba68a2483fc80d70b9dc90bbe16e1f27263
> > [2/4] powerpc/watchdog: tighten non-atomic read-modify-write access
> >       https://git.kernel.org/powerpc/c/858c93c31504ac1507084493d7eafbe7e2302dc2
> > [3/4] powerpc/watchdog: Avoid holding wd_smp_lock over printk and smp_send_nmi_ipi
> >       https://git.kernel.org/powerpc/c/76521c4b0291ad25723638ade5a0ff4d5f659771
> > [4/4] powerpc/watchdog: read TB close to where it is used
> >       https://git.kernel.org/powerpc/c/1f01bf90765fa5f88fbae452c131c1edf5cda7ba
> > 
> > cheers
> > 
> 
> Hi Michael,
> 
> This series has been superseded by this series (v4)
> http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=272865
> 
> Do you plan to apply that v4?

It has been fixed up in

https://lore.kernel.org/linuxppc-dev/20211125103346.1188958-1-npiggin@gmail.com/

Thanks

Michal
Laurent Dufour Nov. 25, 2021, 5:20 p.m. UTC | #4
On 25/11/2021, 16:26:33, Michal Suchánek wrote:
> Hello,
> 
> On Thu, Nov 25, 2021 at 04:11:03PM +0100, Laurent Dufour wrote:
>> On 25/11/2021, 10:36:43, Michael Ellerman wrote:
>>> On Wed, 10 Nov 2021 12:50:52 +1000, Nicholas Piggin wrote:
>>>> These are some watchdog fixes and improvements, in particular a
>>>> deadlock between the wd_smp_lock and console lock when the watchdog
>>>> fires, found by Laurent.
>>>>
>>>> Thanks,
>>>> Nick
>>>>
>>>> [...]
>>>
>>> Applied to powerpc/next.
>>>
>>> [1/4] powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
>>>       https://git.kernel.org/powerpc/c/5dad4ba68a2483fc80d70b9dc90bbe16e1f27263
>>> [2/4] powerpc/watchdog: tighten non-atomic read-modify-write access
>>>       https://git.kernel.org/powerpc/c/858c93c31504ac1507084493d7eafbe7e2302dc2
>>> [3/4] powerpc/watchdog: Avoid holding wd_smp_lock over printk and smp_send_nmi_ipi
>>>       https://git.kernel.org/powerpc/c/76521c4b0291ad25723638ade5a0ff4d5f659771
>>> [4/4] powerpc/watchdog: read TB close to where it is used
>>>       https://git.kernel.org/powerpc/c/1f01bf90765fa5f88fbae452c131c1edf5cda7ba
>>>
>>> cheers
>>>
>>
>> Hi Michael,
>>
>> This series has been superseded by this series (v4)
>> http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=272865
>>
>> Do you plan to apply that v4?
> 
> It has been fixed up in
> 
> https://lore.kernel.org/linuxppc-dev/20211125103346.1188958-1-npiggin@gmail.com/

Thanks Michal, I forgot that one.