From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCE92C7EE2C for ; Fri, 2 Jun 2023 22:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236648AbjFBWr6 (ORCPT ); Fri, 2 Jun 2023 18:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234860AbjFBWr4 (ORCPT ); Fri, 2 Jun 2023 18:47:56 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DBA1AD for ; Fri, 2 Jun 2023 15:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=D7Rtyb72cdysLbSdHEt6SRIzf41F62vRjWfqA6Qc0qY=; b=Y0+uR4eqNAVDRYyv0I1BrO6KSj BeMQBuXeME3yqAuYR59VialxhjXSE8quz8a+8dLeCWlpr9ykproHq2oWjdGuXo4NWypZuveZp1OL8 DNVjnavmAUwuvtYcaV1oFiMP9mIIEfZgHcyeDZddRWkHgj+4Wv4f/Emug97WyiaqzMIQVJ7nwEPXC 4ZbWeSa5i/0zZgY/uKu98Mx8JvuIDB4bRb8tlVdtGC8ytuvrH3zZRle3BHjX+iyYctnmkeWgKoWUJ Cej+bRrkB80gkQ6TjNwe0BQhIjowCymyHABAnEDhMAYXW/8V+AxQeQPEmKKkb02yJmZASq2pg+uRd 6fxrB1sQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q5DYg-001Tb8-1n; Fri, 02 Jun 2023 22:47:46 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2FA453002F0; Sat, 3 Jun 2023 00:47:45 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0CE112058125D; Sat, 3 Jun 2023 00:47:45 +0200 (CEST) Date: Sat, 3 Jun 2023 00:47:44 +0200 From: Peter Zijlstra To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, Andrew Morton Subject: Re: [PATCH v4] watchdog: Allow nmi watchdog to use "ref-cycles" event Message-ID: <20230602224744.GC695361@hirez.programming.kicks-ass.net> References: <20230518002555.1114189-1-song@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230518002555.1114189-1-song@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2023 at 05:25:55PM -0700, Song Liu wrote: > NMI watchdog permanently consumes one hardware counters per CPU on the > system. For systems that use many hardware counters, this causes more > aggressive time multiplexing of perf events. > > OTOH, some CPUs (mostly Intel) support "ref-cycles" event, which is rarely > used. Add kernel cmdline arg nmi_watchdog=ref-cycles to configure the > watchdog to use "ref-cycles" event instead of "cycles". > > Cc: Andrew Morton > Cc: Peter Zijlstra > Signed-off-by: Song Liu > > --- > Changes in v4: > Fix compile error for !CONFIG_HARDLOCKUP_DETECTOR_PERF. (kernel test bot) > > Changes in v3: > > Pivot the design to use kernel arg nmi_watchdog=ref-cycles (Peter) > --- > Documentation/admin-guide/kernel-parameters.txt | 5 +++-- > include/linux/nmi.h | 2 ++ > kernel/watchdog.c | 2 ++ > kernel/watchdog_hld.c | 9 +++++++++ > 4 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 9e5bab29685f..d378e23dad7c 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -3593,10 +3593,12 @@ > Format: [state][,regs][,debounce][,die] > > nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels > - Format: [panic,][nopanic,][num] > + Format: [panic,][nopanic,][ref-cycles][num] > Valid num: 0 or 1 > 0 - turn hardlockup detector in nmi_watchdog off > 1 - turn hardlockup detector in nmi_watchdog on > + ref-cycles - configure the watchdog with perf event > + "ref-cycles" instead of "cycles" > When panic is specified, panic when an NMI watchdog > timeout occurs (or 'nopanic' to not panic on an NMI > watchdog, if CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is set) I still hate the whole ref-cycles thing, at the very least powerpc also has HAVE_HARDLOCKUP_DETECTOR_PERF and they don't have ref-cycles, but perhaps them wants to use a different event when the moon is just so... What again was wrong with the option of specifying a raw event value and falling back to cpu-cycles if that fails?