From nobody Fri Aug 14 15:48:46 2026 Received: from CWXP265CU010.outbound.protection.outlook.com (mail-ukwestazon11022105.outbound.protection.outlook.com [52.101.101.105]) (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 1A87A2F7F1C for ; Fri, 14 Aug 2026 13:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.101.105 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786715851; cv=fail; b=sFBNW9FyhiIX1y9huvfx+M2DaL/cFZlV6Ffqk5O0xzhrv3HK8DFb6RvwgyD1E5Pmbq9O9ViNUrFPD4OanZ2KEfRil84+/1qD+1LwEdByWaVD1ncSRtCH80yepZdFZe7oksiFheXexhwtshfzryJhaQc/dYl8/2UxhQaZ8udK0Hk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786715851; c=relaxed/simple; bh=KLtYSc6s5S4Vy9JwD4Sw02L6bjKCSV6RY6+dFTaMjvY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Mse2YcEI0ZBT0sZv3ROvcReBgbeC/Anm+WuJiyvNLDW7hVm14cO/gINRegNZxJO4D8rM/Kr4sQ/m2z+FW5vPcsMyTJ23Ig2+SUhxIXjdVI4GW9a5JuyDrYsGI/CNSb/OYXUR5aT0YHYYRL/ZBLWdNmJyx+xBmSAa7zatyXPcJiw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; arc=fail smtp.client-ip=52.101.101.105 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wku9lDLVMadU9QDirjnvZTJxeRLjd9kAnJycxJAE2UTyfoZjavbbWjJ3wNcnDz5STOshwG37SDYQq622i/SlCXECv5NXw/WVjo0azFGxh8Um8R+sxs0pKDoch5T9/CRcwCdKAJF/UoSPY2ksUmC6igDMQd52cFEyWu9kcPuGEu+L845uTzXcJHA+83KlwW0iXEI+kJRExXcAv5BNuQLePvdweYHKLvQj/hakabNtLWSBmaIRVFfim+yaPlYpYt3h+TFhbf3BijXm962X9UL4274Nf1q7KOF3YUFz59Sq5KiBifph/HZxafCyGijtd8fpry1sRa2stLIXeWbdHhy+qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:MIME-Version; bh=OjSOttUReu+90TUASZNpmS9uo3CZ+0JJO0mK0v2WzOk=; b=Xabd0v7mOLyPOHfpS9GHy6AjxKWKqreaek0BwNmRTTLnhRElB9UTZhyE/KqN0ct8l+teeZ9hhfoZvxYM8t/G3nOvh8RqF05FTGMrX40Z7jx89BMwcCbzMU3xGtJDrtB9pa86RXaDpmbujvpxLCO59vkdF8VLKf+kbAPfduzGmwywWW70KqxU+Vi48pdyAet2/IVUZwUl9ng11fpGRaX7MyHkCfFEvixbZQxNofdZjlltQN6Utb9jlTv2LsAkxxgFo5/btccDUoA6bnkDB+cENIFB1b5mvJEcFnRVUi9sdi/OUZDemLqxZsX4IJ6uwLwHfKMUGN/9LzXuBW6MvQOU7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atomlin.com; dmarc=pass action=none header.from=atomlin.com; dkim=pass header.d=atomlin.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=atomlin.com; Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) by LO8P123MB7759.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:3d5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.16; Fri, 14 Aug 2026 13:57:25 +0000 Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230]) by CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230%4]) with mapi id 15.21.0315.014; Fri, 14 Aug 2026 13:57:25 +0000 From: Aaron Tomlin To: akpm@linux-foundation.org, lance.yang@linux.dev, mhiramat@kernel.org, pmladek@suse.com Cc: linux-kernel@vger.kernel.org, david.laight.linux@gmail.com, atomlin@atomlin.com, neelx@suse.com, sean@ashe.io, chjohnst@gmail.com, steve@abita.co, mproche@gmail.com, nick.lange@gmail.com Subject: [PATCH v9 1/2] hung_task: Reset warning budget when problem gets resolved Date: Fri, 14 Aug 2026 09:57:17 -0400 Message-ID: <20260814135718.494513-2-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260814135718.494513-1-atomlin@atomlin.com> References: <20260814135718.494513-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BLAP220CA0005.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::10) To CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP123MB6607:EE_|LO8P123MB7759:EE_ X-MS-Office365-Filtering-Correlation-Id: 42d5b9dc-2c2c-4d94-a84b-08defa0bf87a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|7416014|366016|1800799024|22082099003|18002099003|56012099006|10067099003; X-Microsoft-Antispam-Message-Info: o/yrOzYNFNA7THrtXMfJr21Be2p8w4d708w44jH0E2EphqvaNmaLCKrwHhskrervaN0dRfQvbgQhC7TIU0zZcdnbdRhTMLYONw8qO0XSodX16Xha/FiHqMEqQ4io7e428ptE5sIaZ7ohdMzNyaNkANZCv90/BKYiYhpNeDkE27zUtC2W7gHENo3LdsYLdShL/NAwGYGxel/aEAYM3leA8JE8wta1z3QSkZ7qIHn4OtCFgfCS1hCy/q7FrF0vVh2f974DoQ9uBkhJw6Z+p86Xpp5q5F3VIttJYIHw73JtX8hNTr0IXOfm1QzIarq6SRkoev1i/Tqew5BmsTvxNUHkLkYCDeJbRAegEvLMMTkvrPbNC/bVzl2yrDzS4s4bJk94qYLzvx20Xude6AByh69ZqzWPdOCuv33YHCn3Dj3+Z0JHYjKBwTq2pjxx+aN/ErVvusid4nweTgoJmkLki093mXxDXgRxANdUZYARVuHfwE6vP3A4ER8hAF72dHtZJV65Fa9x7bcg7vyApOD6G2jRc3wVrU0QdBibKwBsalp5c+XlUxvBRGxImV+unfMiiFsNKPJxHDlyPyGxMq/yQVRC1cx7mk8mfAtkCOe/+mfbZ4ydFBrQXuvd3CRO5mNnOlw80iTQ51JIFW2R6HwNV3bDg9z7v8wsnaipt3h9VFdLmoc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(7416014)(366016)(1800799024)(22082099003)(18002099003)(56012099006)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jkxtcr7zivMO1oIKKFXQDo3p2VFj/kD6JjDRqRtYIC0/e/kMFk51/zPRZg2X?= =?us-ascii?Q?2CRpi9PIWyPcFsJbSLcj05/U3qfBtAA3fbpG6/d6/9Mjfog5ZE7NsxjpxU9U?= =?us-ascii?Q?kXdn3dFObB/pY3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ascii?Q?jIBV6ZelT0XNs3HlKyC2EMhO5CxQPKbW9+2Yo8RKjsBD9j0rY280gRQ+zHF/?= =?us-ascii?Q?IhRo8/7of43WZneLd280tg5lLnFoub0gYcgdJDyeZDwE0YLGKSTS8J1bd3Xd?= =?us-ascii?Q?ezphrZ5Ye+96d5Az6VotZ6cc2VKMWSB2HZUJxyE7eP/w7ERHLlj64drKakQ/?= =?us-ascii?Q?C6JAFHXqe26RiJkSjUCjKoRBzZAdUltddPtCcUo7lIZ+vdCDQ1pbGTWsGQGl?= =?us-ascii?Q?lNksFjUtaWI/fJJKPDLxpU5saJiq/zOMHCst7QHGiCmOaQByhNBxnhQ9EgH5?= =?us-ascii?Q?JE1pDnQn4lCmhIFpMAoR/ThBdhMh83NulgeMqY+CDhtG7rvTYSl85mC4t1M2?= =?us-ascii?Q?x+finL8BrtBw0wZJr9p0xavJOkfDMgXkLMKgWJnYtkTbVqrddFi88M3WP/W0?= =?us-ascii?Q?WxOLlWmbTtAsDh+l/G7jAa22gtEAhNnBCoqUgE4cMe2CHIrtKPNUmykqsd+q?= =?us-ascii?Q?ttbQ9LKOC9E/Hyvwgl1EgfPQTvFJ7mK4yscTgbrZbSOCZgydL07GBp8LiKWs?= =?us-ascii?Q?T21rCAMsO6DAfMSUaSmMtzgA7gkF+bQraU6jTtVYpYzppHD8rv66SYN59yvg?= =?us-ascii?Q?4GIhp69MigLGUvpq+YWk+adxDUUxPkwWJkzGOi7m4spE7JkXOGRluVDyqTMM?= =?us-ascii?Q?maLeVbC5zJpktm5alEpuAm4fQjGAL35XMSBvbdg2GHDSYzsfqLjcO7jK0BNW?= =?us-ascii?Q?p6nYF9lGhw=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42d5b9dc-2c2c-4d94-a84b-08defa0bf87a X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2026 13:57:25.5094 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e6a32402-7d7b-4830-9a2b-76945bbbcb57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +lvCr3V8ciiCRCLMMYqhaefIxLz6QbieXn9QYWuEjaKj1+y0oC3VoahHLGtlgX7/HumsPMVrX1SQmDd7qanzrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO8P123MB7759 Content-Type: text/plain; charset="utf-8" The sysctl hung_task_warnings currently holds both the configured warning limit and the remaining budget. Each detailed report decrements the sysctl, so once it reaches zero, the configured limit is lost and cannot be restored automatically. Keep sysctl hung_task_warnings unchanged and track the remaining budget in hung_task_warnings_printed. Reset the runtime budget via an atomic flag when a watchdog check sees no hung tasks or when userspace writes a new sysctl value. Suggested-by: Petr Mladek Suggested-by: Lance Yang Tested-by: Lance Yang Signed-off-by: Aaron Tomlin --- Documentation/admin-guide/sysctl/kernel.rst | 5 +-- kernel/hung_task.c | 40 ++++++++++++++++----- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/ad= min-guide/sysctl/kernel.rst index c6994e55d141..b0f8e55efc1a 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -459,8 +459,9 @@ hung_task_warnings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 The maximum number of warnings to report. During a check interval -if a hung task is detected, this value is decreased by 1. -When this value reaches 0, no more warnings will be reported. +if a hung task is detected, the internal warning budget is decreased by 1. +When this budget reaches 0, no more detailed warnings will be reported. The +warning budget is reset to the configured limit when no hung task is found. This file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled. =20 -1: report an infinite number of warnings. diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 6fcc94ce4ca9..53499fbead83 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -59,6 +59,9 @@ static unsigned long __read_mostly sysctl_hung_task_check= _interval_secs; =20 static int __read_mostly sysctl_hung_task_warnings =3D 10; =20 +static int hung_task_warnings_printed =3D 10; +static atomic_t reset_hung_task_warnings =3D ATOMIC_INIT(0); + static int __read_mostly did_panic; static bool hung_task_call_panic; =20 @@ -245,11 +248,11 @@ static void hung_task_info(struct task_struct *t, uns= igned long timeout, /* * The given task did not get scheduled for more than * CONFIG_DEFAULT_HUNG_TASK_TIMEOUT. Therefore, complain - * accordingly + * accordingly with full details if the budget is not exhausted. */ - if (sysctl_hung_task_warnings || hung_task_call_panic) { - if (sysctl_hung_task_warnings > 0) - sysctl_hung_task_warnings--; + if (hung_task_warnings_printed || hung_task_call_panic) { + if (hung_task_warnings_printed > 0) + hung_task_warnings_printed--; pr_err("INFO: task %s:%d blocked%s for more than %ld seconds.\n", t->comm, t->pid, t->in_iowait ? " in I/O wait" : "", (jiffies - t->last_switch_time) / HZ); @@ -264,7 +267,7 @@ static void hung_task_info(struct task_struct *t, unsig= ned long timeout, sched_show_task(t); debug_show_blocker(t, timeout); =20 - if (!sysctl_hung_task_warnings) + if (!hung_task_warnings_printed) pr_info("Future hung task reports are suppressed, see sysctl kernel.hun= g_task_warnings\n"); } =20 @@ -304,7 +307,7 @@ static void check_hung_uninterruptible_tasks(unsigned l= ong timeout) unsigned long last_break =3D jiffies; struct task_struct *g, *t; unsigned long this_round_count; - int need_warning =3D sysctl_hung_task_warnings; + int need_warning; unsigned long si_mask =3D hung_task_si_mask; =20 /* @@ -314,6 +317,11 @@ static void check_hung_uninterruptible_tasks(unsigned = long timeout) if (test_taint(TAINT_DIE) || did_panic) return; =20 + if (atomic_xchg(&reset_hung_task_warnings, 0)) + hung_task_warnings_printed =3D + READ_ONCE(sysctl_hung_task_warnings); + need_warning =3D hung_task_warnings_printed; + this_round_count =3D 0; rcu_read_lock(); for_each_process_thread(g, t) { @@ -340,8 +348,11 @@ static void check_hung_uninterruptible_tasks(unsigned = long timeout) unlock: rcu_read_unlock(); =20 - if (!this_round_count) + if (!this_round_count) { + hung_task_warnings_printed =3D + READ_ONCE(sysctl_hung_task_warnings); return; + } =20 if (need_warning || hung_task_call_panic) { si_mask |=3D SYS_INFO_LOCKS; @@ -425,6 +436,19 @@ static int proc_dohung_task_timeout_secs(const struct = ctl_table *table, int writ return ret; } =20 +static int proc_dohung_task_warnings(const struct ctl_table *table, int wr= ite, + void *buffer, + size_t *lenp, loff_t *ppos) +{ + int ret; + + ret =3D proc_dointvec_minmax(table, write, buffer, lenp, ppos); + if (!ret && write) + atomic_set_release(&reset_hung_task_warnings, 1); + + return ret; +} + /* * This is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_s= ecs * and hung_task_check_interval_secs @@ -480,7 +504,7 @@ static const struct ctl_table hung_task_sysctls[] =3D { .data =3D &sysctl_hung_task_warnings, .maxlen =3D sizeof(int), .mode =3D 0644, - .proc_handler =3D proc_dointvec_minmax, + .proc_handler =3D proc_dohung_task_warnings, .extra1 =3D SYSCTL_NEG_ONE, }, { --=20 2.55.0 From nobody Fri Aug 14 15:48:46 2026 Received: from CWXP265CU010.outbound.protection.outlook.com (mail-ukwestazon11022105.outbound.protection.outlook.com [52.101.101.105]) (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 0C4FA34A79D for ; Fri, 14 Aug 2026 13:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.101.105 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786715854; cv=fail; b=js2pjkdmNTKrRoEkdJfCWIpO42tsyyWsM6s5e/Q0iCzjqjOYeWsCPvhfGlBo5ZtbpS390o/FFyUd3/9n9cEjFZoPgacN4Moi+3HxQBm4f+PRux2UR/SneHJkkuhjfptedZ/joFwzQ1OguPUnK/L94yJM/xuIWllKofFs2+n/hn4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786715854; c=relaxed/simple; bh=B2Z96QzK7qtz/pTf2R5gEzLbFOyC1NWbuEDtON6rEVQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=JJb5U4fIv2JHrVJLt92aLiOqHcHQeP6UbVWBYo0wLB3hDoZ1x7YlWYhYK0Dj9tRPznBMapBluUNvJfI2Rg7jnA4mrQl0H3tmfwfnPca2nyHj1l6qdxmFwfcMIYzeW6m7bk9Ejc82CH4tjfk/OoWVrSf6+Aku9MUX3djaIgYzv7c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; arc=fail smtp.client-ip=52.101.101.105 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PXHuW6kmzdHATB9GtMv+XSTMvOPMZsE7uW6uZUAcwFEofcsseqAcPf4lzg6CwZisl+HTzK5qB7WnjaZ/2OIPtQOyo8TzUb/hYyOIgQD7m0VS1rOAyrv58lmqRfwtYqEf8KdVlYMzVMV2abUXShMMhhu3r1aOXI+vv9+FwXBxzbLe182VOEvG4Zp2facs0aMPgHmPrB2u3SVoqw/Pq32lZhtFEkwF7echkfNe1pw5eaOwAX2jj9COs0avOCcmv/WwWGYt+2TfQfBUUBMeNTKX7IrFtGkJfUbHtx2N0vcl3Eq4Qby2daKxKRlUpiYwx291NMtOpow5ucWiOgdNEuWXVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:MIME-Version; bh=T1jzZlv3UBMkBMDCg465+pgDpy0bp1tFPID5+9tW0Dc=; b=NL09Rb9U39nVr9fR1CvtAOXcNSwupKtVYHgvsPI0GgiU65wIrrbl+cz3mwGiyDIiy6gFEMaNHIZWFHPwMn1ZFp7sAB0dMOxpF3ySLJymrhhaZABU3ybdPjnzg34Ud9Mr3GWhrCbcEX+GLPQ2rgodWD/7FtdQ1bz/THB7Z2ba3NNtHEzp0Y9SMjdh3WQua6VGwp1vhKnDF2JBL4Q6AlfMiEjZ8PJU5Za48V7MxwZSWBJJROKWnmopIUbRvMFtIDwzRKE9WBktF3LPHLojbbLZG/8XcNomTupmA47jGhJnZd8kxfsONHf64zWcx8cFSWvA5Z1TNcLVX8a/CYrNELgb8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atomlin.com; dmarc=pass action=none header.from=atomlin.com; dkim=pass header.d=atomlin.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=atomlin.com; Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) by LO8P123MB7759.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:3d5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.315.16; Fri, 14 Aug 2026 13:57:29 +0000 Received: from CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230]) by CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM ([fe80::cec4:77ab:262e:d230%4]) with mapi id 15.21.0315.014; Fri, 14 Aug 2026 13:57:29 +0000 From: Aaron Tomlin To: akpm@linux-foundation.org, lance.yang@linux.dev, mhiramat@kernel.org, pmladek@suse.com Cc: linux-kernel@vger.kernel.org, david.laight.linux@gmail.com, atomlin@atomlin.com, neelx@suse.com, sean@ashe.io, chjohnst@gmail.com, steve@abita.co, mproche@gmail.com, nick.lange@gmail.com Subject: [PATCH v9 2/2] hung_task: Log summary line when warning budget is exhausted Date: Fri, 14 Aug 2026 09:57:18 -0400 Message-ID: <20260814135718.494513-3-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260814135718.494513-1-atomlin@atomlin.com> References: <20260814135718.494513-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BLAPR03CA0061.namprd03.prod.outlook.com (2603:10b6:208:329::6) To CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:183::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP123MB6607:EE_|LO8P123MB7759:EE_ X-MS-Office365-Filtering-Correlation-Id: b46a9a8e-cdbb-4ed1-bb34-08defa0bfaaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|7416014|366016|1800799024|6133799003|22082099003|18002099003|56012099006|3023799007|10067099003; X-Microsoft-Antispam-Message-Info: cIW9a2r3sMlUWibNbrjP9a4ejMgFb0CVsAoQH/YffT84d7RGG33L8Et/Y+ihxnfI2PDTr4p5egE2VYgqGVPRO7Y08Oqq1kWdsxuzVXwNEQjGEO9fJqRjsg+Ep/4TUtjm93nZp63RH+xN+VxHYrtom6BPrk8VbvRBtsvDxqKQigY1D7rc98e+qO8dd0Untyupww2EvY6mPfzIoipnhXDDYAkK+FRn+dasuOa3qV2ujeWRiZ24ibpAVxW7tLMt1AtWOMzjUOkbLiZDBFoG3+Dvgg2CFE7yaLf00dw1Qncoh/SzBdVAXY/Jpf/z1lsaOLslzEEQ3nenJFPQj5xKgSbg1SZDFSOYWQXxKX7seP6a7lWURpbTDHrGX+2qcKVzwrRfXR7A+CU1cDNmfFjmb0zdWszsfepf/hKG4Ahcpj+6S5vxZgoA//QMXtK00QSotym7gkwIRqaDD15C+RoImv3HMtfQKdz0DKaCI4bSitBw1yqQg5+2lUEaP8t6e5/rWmsIEVTh2sDvy+jTBdNfbTCO+WeB0fwPfGCtN4qeP/6LMLfrw0iJ+NjuTstNJ1rsmzz0fa1e0QNNsoh1IkowUsgehyt0NIoNIETEg80bi59ddg/qtiUXTUFeqiuTikD5ZluOpRpi4NeRaLlSaMxgW5EwWn1Os7mQoaKRZTNW3Q/tYOE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(7416014)(366016)(1800799024)(6133799003)(22082099003)(18002099003)(56012099006)(3023799007)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HbL+8gevq74vkVkxTQbYgadX2sNKuZvl25e1yztSAr98ZMzKVRuF65KY+dVr?= =?us-ascii?Q?c+aqlbXelNCcJeI87elbN0FS/13I3ydsrkFiRbLkkmcxm9GjzEZEfSqWJ6YM?= =?us-ascii?Q?S4oDcrbiF47vnO2NcbNe7PaWFe1s6GEcihQyAywfGwc5iQVb65CuTIjRY6ob?= =?us-ascii?Q?X9Zhkrfk2USgIdbPKI2LEIuuSi6e5lNsZVpphmlIBHCvkefJDK9eJIuGN7Rq?= =?us-ascii?Q?PwW+JagWScsA1Mr1qEm1ORU1MfpJegKe9m8doymdKgR+e4uhHD+7T0g3EQ/H?= =?us-ascii?Q?09MSLSHH9YVTPWaW6V0kU8I5jVBS7dB+zzY24hvmth07jF/t3jAEnmDUc/Lu?= =?us-ascii?Q?MMhXDr/sb1IOlSnDzp2wTBTP3xo9OVbQ2cspRjU+1W5ZKW9CRE+R5dWEIRUJ?= =?us-ascii?Q?PYLIoZ8IjVphI2YwMcCPSgCIl40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?Q?kTva2cQ6/X8qD/tjwGQNe+HU8FCs7HCNyVT1TwIr8koL4owM7aKkZofoTzXD?= =?us-ascii?Q?QBZSpPO/m+H3xHAN4di46ejBW8sgWgi6BIcxImJx7DuTV1eWRPdhRy8s2Ogu?= =?us-ascii?Q?WcwB1tRc6QuR/Q4wGE/8xgGiffGglXAMkI5bRDqRgqvBrkg7zi5tWWfPCCE/?= =?us-ascii?Q?N/trzRx46Xq6cOCQ9yPaflZYz/ywWklYWzkB2RqL4VG23ZAN8Hai0vMA+6rk?= =?us-ascii?Q?s4mXO+zqOfoLfEE8iuGgu4vpPiJDyi4GJx+8hvPm4vFVcCnYq637WP7KVon3?= =?us-ascii?Q?tmAI4P3PdFbR7y9Pa1TZiWDz2N0e7XDoG6m/jK0ozDe3F1iLVau4oGirFNha?= =?us-ascii?Q?/8ig0zjw9UnU6P9ush/ZetXIlELcoAQtMwtLlszB/PNucvjJ0lphWzkPZqNf?= =?us-ascii?Q?FH+xi8AT0w=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: b46a9a8e-cdbb-4ed1-bb34-08defa0bfaaf X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2026 13:57:29.1910 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e6a32402-7d7b-4830-9a2b-76945bbbcb57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KEqPxtcumz9qzFQA5+PadPfMzXvbC/WkgkGvexsp55qF3JepvYL2xGdzSf4pR+iULF+bhet+YTNN/oegh8Jycg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO8P123MB7759 Content-Type: text/plain; charset="utf-8" Once the warning budget is exhausted, hung_task_info() stops printing per-task details. To provide visibility without causing additional log spam, emit a single aggregate summary line at the end of each watchdog scan when hung tasks are detected and the warning budget is exhausted. Keep per-task reports budgeted to avoid flooding dmesg or causing ring buffer overflows during system-wide hangs. Suggested-by: Petr Mladek Suggested-by: Lance Yang Signed-off-by: Aaron Tomlin --- kernel/hung_task.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 53499fbead83..f5eb75325f3a 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -268,7 +268,7 @@ static void hung_task_info(struct task_struct *t, unsig= ned long timeout, debug_show_blocker(t, timeout); =20 if (!hung_task_warnings_printed) - pr_info("Future hung task reports are suppressed, see sysctl kernel.hun= g_task_warnings\n"); + pr_info("Future hung task reports won't print details about each proces= s, see sysctl kernel.hung_task_warnings\n"); } =20 touch_nmi_watchdog(); @@ -354,6 +354,10 @@ static void check_hung_uninterruptible_tasks(unsigned = long timeout) return; } =20 + if (!hung_task_warnings_printed && !hung_task_call_panic) + pr_info("hung_task: %lu hung tasks detected, warning budget exhausted\n", + this_round_count); + if (need_warning || hung_task_call_panic) { si_mask |=3D SYS_INFO_LOCKS; =20 --=20 2.55.0