From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbdLMNp6 (ORCPT ); Wed, 13 Dec 2017 08:45:58 -0500 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:18215 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbdLMNpy (ORCPT ); Wed, 13 Dec 2017 08:45:54 -0500 From: alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com To: Michael Ellerman CC: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Nicholas Piggin Subject: Re: [PATCH AUTOSEL for 3.18 36/40] powerpc/xmon: Avoid tripping SMP hardlockup watchdog Thread-Topic: [PATCH AUTOSEL for 3.18 36/40] powerpc/xmon: Avoid tripping SMP hardlockup watchdog Thread-Index: AQHTdBiPlc3BgiegRUO8Z1Dho0jYWQ== Date: Wed, 13 Dec 2017 13:44:55 +0000 Message-ID: <20171213134453.4sbmin2tjprrjnty@sasha-lappy> References: <20171213015905.7059-1-alexander.levin@verizon.com> <20171213015905.7059-36-alexander.levin@verizon.com> <87lgi6ai40.fsf@concordia.ellerman.id.au> In-Reply-To: <87lgi6ai40.fsf@concordia.ellerman.id.au> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: NeoMutt/20170113 (1.7.2) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="us-ascii" Content-ID: <52800DA7AAD0A44AA243D7A479982874@vzwcorp.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vBDDk3Ce025470 On Thu, Dec 14, 2017 at 12:10:39AM +1100, Michael Ellerman wrote: >alexander.levin@verizon.com writes: > >> From: Nicholas Piggin >> >> [ Upstream commit 064996d62a33ffe10264b5af5dca92d54f60f806 ] >> >> The SMP hardlockup watchdog cross-checks other CPUs for lockups, which >> causes xmon headaches because it's assuming interrupts hard disabled >> means no watchdog troubles. Try to improve that by calling >> touch_nmi_watchdog() in obvious places where secondaries are spinning. >> >> Also annotate these spin loops with spin_begin/end calls. > >These macros didn't exist until 4.13, and haven't been backported AFAIK. But the touch_nmi_watchdog() bits are something we want in stable, right? >> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c >> index e23f559faa47..6cec1081cb67 100644 >> --- a/arch/powerpc/xmon/xmon.c >> +++ b/arch/powerpc/xmon/xmon.c >> @@ -436,14 +436,19 @@ static int xmon_core(struct pt_regs *regs, int fromipi) >> >> waiting: >> secondary = 1; >> + spin_begin(); >> while (secondary && !xmon_gate) { >> if (in_xmon == 0) { >> - if (fromipi) >> + if (fromipi) { >> + spin_end(); >> goto leave; >> + } >> secondary = test_and_set_bit(0, &in_xmon); >> } >> - barrier(); >> + spin_cpu_relax(); >> + touch_nmi_watchdog(); >> } >> + spin_end(); >> >> if (!secondary && !xmon_gate) { >> /* we are the first cpu to come in */ >> @@ -470,21 +475,25 @@ static int xmon_core(struct pt_regs *regs, int fromipi) >> mb(); >> xmon_gate = 1; >> barrier(); >> + touch_nmi_watchdog(); >> } >> >> cmdloop: >> while (in_xmon) { >> if (secondary) { >> + spin_begin(); >> if (cpu == xmon_owner) { >> if (!test_and_set_bit(0, &xmon_taken)) { >> secondary = 0; >> + spin_end(); >> continue; >> } >> /* missed it */ >> while (cpu == xmon_owner) >> - barrier(); >> + spin_cpu_relax(); >> } >> - barrier(); >> + spin_cpu_relax(); >> + touch_nmi_watchdog(); >> } else { >> cmd = cmds(regs); >> if (cmd != 0) { >> -- >> 2.11.0 -- Thanks, Sasha