Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbdFUOCh convert rfc822-to-8bit (ORCPT ); Wed, 21 Jun 2017 10:02:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:62997 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752388AbdFUOCe (ORCPT ); Wed, 21 Jun 2017 10:02:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,369,1493708400"; d="scan'208";a="1163046477" From: "Liang, Kan" To: Don Zickus CC: "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "akpm@linux-foundation.org" , "babu.moger@oracle.com" , "atomlin@redhat.com" , "prarit@redhat.com" , "torvalds@linux-foundation.org" , "peterz@infradead.org" , "tglx@linutronix.de" , "eranian@google.com" , "acme@redhat.com" , "ak@linux.intel.com" , "stable@vger.kernel.org" Subject: RE: [PATCH] kernel/watchdog: fix spurious hard lockups Thread-Topic: [PATCH] kernel/watchdog: fix spurious hard lockups Thread-Index: AQHS6gz8LSkdJFMSZk6lPSiU4VpMCqIuzcyAgACHLuA= Date: Wed, 21 Jun 2017 14:02:31 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537100DF@SHSMSX103.ccr.corp.intel.com> References: <20170620213309.30051-1-kan.liang@intel.com> <20170621134055.4skam7ysw5ffvjr6@redhat.com> In-Reply-To: <20170621134055.4skam7ysw5ffvjr6@redhat.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2UzOTJhYzMtZmZhYy00NmIxLWE1ZTktMmIyNDdiYzgzZTQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlMyVFY3dEVCN0xheTl6Qkd4V1h3M1hTYmFJb2k3QkJoekRFTzRuaGw0TTQ9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3042 Lines: 82 > > On Tue, Jun 20, 2017 at 02:33:09PM -0700, kan.liang@intel.com wrote: > > From: Kan Liang > > > > Some users reported spurious NMI watchdog timeouts. > > > > We now have more and more systems where the Turbo range is wide > enough > > that the NMI watchdog expires faster than the soft watchdog timer that > > updates the interrupt tick the NMI watchdog relies on. > > > > This problem was originally added by commit 58687acba592 > > ("lockup_detector: Combine nmi_watchdog and softlockup detector"). > > Previously the NMI watchdog would always check jiffies, which were > > ticking fast enough. But now the backing is quite slow so the expire > > time becomes more sensitive. > > > > For mainline the right fix is to switch the NMI watchdog to reference > > cycles, which tick always at the same rate independent of turbo mode. > > But this is requires some complicated changes in perf, which are too > > difficult to backport. Since we need a stable fix too just increase > > the NMI watchdog rate here to avoid the spurious timeouts. This is not > > an ideal fix because a 3x as large Turbo range could still fail, but > > for now that's not likely. > > As this is an Intel problem, we should at least restrict it to > arch/x86/kernel/apic/hw_nmi.c. I don't want to penalize other arches yet. > Sure, I will modify the patch. > > > > Signed-off-by: Kan Liang > > Cc: stable@vger.kernel.org > > Fixes: 58687acba592 ("lockup_detector: Combine nmi_watchdog and > > softlockup detector") > > --- > > > > The right fix for mainline can be found here. > > perf/x86/intel: enable CPU ref_cycles for GP counter perf/x86/intel, > > watchdog: Switch NMI watchdog to ref cycles on x86 > > https://patchwork.kernel.org/patch/9779087/ > > https://patchwork.kernel.org/patch/9779089/ > > Does that mean this fix is restricted to just -stable then? Otherwise I am > confused why we should take this patch, if you have a better fix above. > The "real fix" is still under discussion. It includes some complicated changes, and also breaks perf RDPMC users. It may take some times to be merged. This issue is critical, because we already had some reports from users. It's better that we can have this patch for both -stable and mainline. Thanks, Kan > Cheers, > Don > > > > > kernel/watchdog_hld.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index > > 54a427d1f344..0f7c6e758b82 100644 > > --- a/kernel/watchdog_hld.c > > +++ b/kernel/watchdog_hld.c > > @@ -164,7 +164,7 @@ int watchdog_nmi_enable(unsigned int cpu) > > firstcpu = 1; > > > > wd_attr = &wd_hw_attr; > > - wd_attr->sample_period = > hw_nmi_get_sample_period(watchdog_thresh); > > + wd_attr->sample_period = 3 * > > +hw_nmi_get_sample_period(watchdog_thresh); > > > > /* Try to register using hardware perf events */ > > event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, > > watchdog_overflow_callback, NULL); > > -- > > 2.11.0 > >