From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from confino.investici.org (confino.investici.org [93.190.126.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB4792E718F for ; Sat, 20 Jun 2026 22:02:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.190.126.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781992931; cv=none; b=rD1kgx2Y3adMBOVGdSRYwrvDSTbfXPPe4qeiYf12+U2nbGe1Xv+ACU4awE5YlgLCBxbeIvxcJMq4xAuXZaa6Lwej9hoMkgnhGjzVofQOim2gD8IEDbYl7oYIvN+ZykttcN0UgO2z4BqKvefLNE6D3Y1C7tYRNgKyQraQKxWzLuo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781992931; c=relaxed/simple; bh=dMRXfkAJT7aGg2lyx/6InV6xNMvNZYwlO+EZu/y9DeM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=S4vB+EOOns1/tIYhvZN57XteqIcH6xdRdDHt+ERyLHzcIJ5q+F9So4ViT6yPxdJxRx2MngESnm0FLhxk9H4ylpxGRrfhmo88xVKF4KXgrJOCNwg6M/GOs4N+affGKdHKF6VBCgAnkCyLB5V9n/sbxxiIQSClwA99wXozZZhJ3cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=grrlz.net; spf=pass smtp.mailfrom=grrlz.net; dkim=pass (1024-bit key) header.d=grrlz.net header.i=@grrlz.net header.b=cEIhlfUp; arc=none smtp.client-ip=93.190.126.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=grrlz.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=grrlz.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=grrlz.net header.i=@grrlz.net header.b="cEIhlfUp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=grrlz.net; s=stigmate; t=1781992927; bh=3vIdAFJFm2VmX3nU7cHArA7YHYS0lSiPW10WwQVdXmk=; h=From:To:Cc:Subject:Date:From; b=cEIhlfUp2mUGtjDU8LSFIien9pW8rzycayd78HxsyDxD3cDBa5G1a1PY638SCAEkJ lsp389ddOHskiFlLCOJHpe6ufANRDR+6YAehGr/E3Rh34T4gY8E6z2KguI4buLAOFs ErYvB8Fn4YCVloPkoV8/0bdXp8QUgVWgms69XYv4= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4gjT2l6fTVz110b; Sat, 20 Jun 2026 22:02:07 +0000 (UTC) Received: by mx1.investici.org (Postfix) id 4gjT2l2BkSz110S; Sat, 20 Jun 2026 22:02:07 +0000 (UTC) From: Bradley Morgan To: Michael Ellerman , Madhavan Srinivasan , Nicholas Piggin , Christophe Leroy Cc: Feng Tang , Mukesh Kumar Chaurasiya , Andrew Morton , Petr Mladek , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] powerpc/watchdog: avoid extra sys_info dumps for all_bt Date: Sat, 20 Jun 2026 22:02:04 +0000 Message-ID: <20260620220204.15756-1-include@grrlz.net> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The powerpc watchdog handles SYS_INFO_ALL_BT itself. When that is the only hardlockup_sys_info bit, sys_info(0) falls back to kernel_sys_info. Skip sys_info() for that case. Fixes: e561383a39ed ("powerpc/watchdog: add support for hardlockup_sys_info sysctl") Signed-off-by: Bradley Morgan --- arch/powerpc/kernel/watchdog.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c index c40c69368476..6338e12651e3 100644 --- a/arch/powerpc/kernel/watchdog.c +++ b/arch/powerpc/kernel/watchdog.c @@ -92,6 +92,16 @@ static cpumask_t wd_smp_cpus_pending; static cpumask_t wd_smp_cpus_stuck; static u64 wd_smp_last_reset_tb; +static void watchdog_sys_info(unsigned long si_mask) +{ + unsigned long dump_mask = si_mask & ~SYS_INFO_ALL_BT; + + if (si_mask && !dump_mask) + return; + + sys_info(dump_mask); +} + #ifdef CONFIG_PPC_PSERIES static u64 wd_timeout_pct; #endif @@ -201,6 +211,7 @@ static bool set_cpu_stuck(int cpu) static void watchdog_smp_panic(int cpu) { static cpumask_t wd_smp_cpus_ipi; // protected by reporting + unsigned long si_mask; unsigned long flags; u64 tb, last_reset; int c; @@ -236,8 +247,9 @@ static void watchdog_smp_panic(int cpu) pr_emerg("CPU %d TB:%lld, last SMP heartbeat TB:%lld (%lldms ago)\n", cpu, tb, last_reset, tb_to_ns(tb - last_reset) / 1000000); + si_mask = READ_ONCE(hardlockup_si_mask); if (sysctl_hardlockup_all_cpu_backtrace || - (hardlockup_si_mask & SYS_INFO_ALL_BT)) { + (si_mask & SYS_INFO_ALL_BT)) { trigger_allbutcpu_cpu_backtrace(cpu); cpumask_clear(&wd_smp_cpus_ipi); } else { @@ -251,7 +263,7 @@ static void watchdog_smp_panic(int cpu) } } - sys_info(hardlockup_si_mask & ~SYS_INFO_ALL_BT); + watchdog_sys_info(si_mask); if (hardlockup_panic) nmi_panic(NULL, "Hard LOCKUP"); @@ -371,6 +383,7 @@ static void watchdog_timer_interrupt(int cpu) DEFINE_INTERRUPT_HANDLER_NMI(soft_nmi_interrupt) { + unsigned long si_mask; unsigned long flags; int cpu = raw_smp_processor_id(); u64 tb; @@ -418,11 +431,12 @@ DEFINE_INTERRUPT_HANDLER_NMI(soft_nmi_interrupt) xchg(&__wd_nmi_output, 1); // see wd_lockup_ipi + si_mask = READ_ONCE(hardlockup_si_mask); if (sysctl_hardlockup_all_cpu_backtrace || - (hardlockup_si_mask & SYS_INFO_ALL_BT)) + (si_mask & SYS_INFO_ALL_BT)) trigger_allbutcpu_cpu_backtrace(cpu); - sys_info(hardlockup_si_mask & ~SYS_INFO_ALL_BT); + watchdog_sys_info(si_mask); if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); -- 2.53.0