From nobody Fri Oct 2 06:16:30 2026 Received: from CWXP265CU010.outbound.protection.outlook.com (mail-ukwestazon11022079.outbound.protection.outlook.com [52.101.101.79]) (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 97A2646F4AA for ; Tue, 4 Aug 2026 15:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.101.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785858859; cv=fail; b=VawPiL57rCFRriuUkiSR7qDoCyQjNWCmXtZNcuDhN77SEMI7RKp0aPZTbRb4k/VQ9fk9ZsG048Gbqs753dIYvi6tRzmCe1L15LwE3rJ4xKnb0UgfWkXSqyR+cTnyFp0p5x2BjZmvvN5CsAS0Y5+x5idijklpp1z7nXu7Zxy22eI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785858859; c=relaxed/simple; bh=+UyEUZ+HfgL7NeC9TKtGEWQd+xOQSkiM2So4PORYnAM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=IpOKoi4dN/HLmDdJvMddk1GCOsMwBbgjhjtuH4hviMnlGSldJmDnVgIvAa8et9KA+mZyT1+912g9clHfYQ5zNPX5vvwtBMToT8jCT+gpedvureC7e+nUT+7d+3uuAjCkvS9LT9KlOgGxsUs/YNskWWR0tpSXeqs3rKIyc4KYlmY= 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.79 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=WL7Qr76rA2fR5fqZpsUNxA5v1SUVmPkW5IN05hNQomNupOwfz70NejMgnWM+2fvbkKECfaA+qf0DUAtVwpGH18qfXz1zFumYkyq/NIlmTIw0oQJ/rkNOEA7T+cpAOMMCQsyTXI77rYIljSspmKH2wvBEaCoSYiGW7L6Ppydu76zuPpxg4eR0k8dJeEldHvNXZLK73cRQesW1950kKWSHhEX+SX3O7MKHxFfJECH8dLr8ZPGdFlxf/m4/jaomuF5lqogy22tDq/0LY+gkhefQ7LmIVsFv6gRSuYHlC3JjfoJQ+XgfoQIsy9eAGbXZ5YSRAv+TWTdztYxo/gb95YcYEg== 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=iVHdnt8bDHOobLJD3bdHPVcueB1HJIGTgT5UamZPyRo=; b=fXDcbpGgNQp48Eazvjj5BPnKo7xJKuXY35ii/eW10tBcwXF/AyZPur32pItZNeg7y0cYM4IkGJMgoaGMLnPPyHCt3qvuDh5t9QcyDwRhisw5VI6v6plN95bx6P/UVVkrNT64qEQEnHnW/F8+txRjYmzBj46JRIUzXOg51VfzJ0A08xMRQm0FoiFgbupDXCH58lzJ5G6UmTeJli4vd5qSPDg7bUHffAyChI0Sw9SkyuxiUaaY0XnMs9jU4iWICQWSAOwdvIg/3KflbwH9OireyTkF3bjsCEMnNoCfXx0q4oq+ZEgQOa7QVydJfeqp/uXeZ15ubIDaW6AhDPNq3jri8w== 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 LO3P123MB3532.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:10c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.19; Tue, 4 Aug 2026 15:54:13 +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.0292.013; Tue, 4 Aug 2026 15:54:13 +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 v7 1/2] hung_task: Reset warning budget when problem gets resolved Date: Tue, 4 Aug 2026 11:54:05 -0400 Message-ID: <20260804155406.254810-2-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260804155406.254810-1-atomlin@atomlin.com> References: <20260804155406.254810-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BL1PR13CA0193.namprd13.prod.outlook.com (2603:10b6:208:2be::18) 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_|LO3P123MB3532:EE_ X-MS-Office365-Filtering-Correlation-Id: 57f0bf0f-d256-4505-ba39-08def240a19f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|7416014|366016|1800799024|10067099003|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: EVb9Hacm2nla3u5Z7j6hO5Lg0kdTNFZDKf62aGBa9uaGWpaeXEBIhxXckPUzrNbmQ9kaRcrdEiZknhvwVGtraqBFMriEtywzxLOFApE/0bmgI4/wO6cGD5FNM477FgR3oIK+RAsGcDFzyCltgv2cZWpcc1EjD5vbBxna0upSyAdBWgOWbefa9f2WSo+K/F4cIAnS+4dViMvjFiD6QieBOAgIIH2EOs83tgne6accXCbp3jwh1JDSDO5L4wtUoz4K1WMjZwZSC8WUfBp1PI/SgiB6hOIKOZehHRU8Wkt2MoAWExrQ9bX+qMIqbbKY8XtrcFdSxsPZuB6MXbi2ht8sJ35AaO12U30t7Rt7BPHMp7FDtF6ZNMQ2RWP5ENkCKfM93oKUUBc8qAwpnvtOe1odU4TbgbjsqtDeqTkFL8lPjllp+n56FW/ovwDz7eT933JPeP84sbbN2xOfWa9J7Dl2rBO0l1GQZqftHjeSGuKotoIAxP7iN0ccoSknDScY2IEMPv2Hh+hd1bgSuSDbDb0zq06H5W+JHCCOHgCjQTlB9z4NQZ009RipWRWSeK7pvdWfRiHoJgk3A1LZhwsByYrKTN4I2WeUlby3+0SjyIYCN3C5FlKik6zpHUqt+ui4qo436q39ZCfA+weHE1Nk1d5NtXUTtYA8nRWXl7QRybt9p+8= 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)(376014)(23010399003)(7416014)(366016)(1800799024)(10067099003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3+ixhEKeZWS7HNwVwK2FnFB76laCTWmbtNxa1EYPw0nvaaAGvzImkyGaURmd?= =?us-ascii?Q?801fT099/LnKfQLyxeopowmC1TZ9I695D3vtK62F1brRbbYHbOZj8JJzHvc/?= =?us-ascii?Q?Xd5ldONQDuUoPaCRPrIt5R6eU+5D5eF/vJIIYtwphHphMwXg1ojrR1Ua3Pvv?= =?us-ascii?Q?UwppqliPYm4ZBhmmqOO8mVCEqZ47wMCjSbixi2X42qRIpCKkvZOjgUilVHxf?= =?us-ascii?Q?QIiUF2ihYWzv4WiXTluUTHkwvTlzX7vkDT7zcxDJMoME6bfmsqvKVcgNJCgg?= =?us-ascii?Q?PkdwNpZcMNF136mglLY0ZsUqnGWGSIPF3HTtojMvQUVFzu9VtYZzlL4Vvie1?= =?us-ascii?Q?2znKnhjuxchgFewPDGeVCCpiyyP+uHImdsIEHe3fnO6Uox+HLKBzjY0SDbKw?= =?us-ascii?Q?u1IFyDfKLNC3HnKMPvWyJ7TD4CYNA1T0Nq0atvWyf9WeS0ZU41RwzmQMauhu?= =?us-ascii?Q?5M0SZ99IVhjAX2eSJwiykY74L5xEoEgUfigEDF+qPNOdsZ9c5PVRlDh7myis?= =?us-ascii?Q?md3gYCNcV8q8tDIfhf3Sxp3OwjqR8CYUFoDQSffp1U0ymiwcs2p4X4yN0rBV?= =?us-ascii?Q?gcpXbeCIfqhcXjwJrmPan3GfnZBGxIG6Nt1e8bX4JI+xIRU1SMsZ92jWpPRK?= =?us-ascii?Q?ZZRnIpsD4YVqSkVI/qzlo77M3aR3sZRHaKlaybgpmcag0g7rwA4AeNxyavkj?= =?us-ascii?Q?7fu7grZiaff96Io9t2Iz9pUUdesOoagemkhFfyGo9mVy7ZWAsNxxuuob7x9x?= =?us-ascii?Q?jQtYBHVAw2rzKgQRQLTyNul7kgx5PW7XHHQfDSXn1aPAPIbPlghz6hE8TP4L?= =?us-ascii?Q?wn2+wEJ12H4kXUL9Y01CxaXF7ItXyEV0lG1C9pYJNQpIclv26b3vBu7naAt7?= =?us-ascii?Q?KauQZzUVQkSFXKX30Eb3+G9vA6nouU9dGmtIhw9uhEA/YRCpSgrrE76RB6LS?= =?us-ascii?Q?3+vZmZdsUM0lG+jln/gySDal+X8jD7mXUVgHWFSDgJ1hk3sKIRMRNmdznlr1?= =?us-ascii?Q?fBaIpJTcS1JV3vMMVAdZ/4UhDPw94tekTqsMuRYuMvTtBRoDakcprMhGPcXn?= =?us-ascii?Q?UZENlUtMnqTf/rgmPHaw61rF62jASyRclL9w89as1bb5qdhXXvTQgT5AV3x6?= =?us-ascii?Q?VitWqHzENiq5Q+YlPkAFM71VOz3XXlOiqKC/Gq4JjKyvlBy9uDT4RXMtYZUD?= =?us-ascii?Q?AIxoxEhGSzUbDMzv7g9P+/XcuV2K2kRd8mP+D+cdX17gU5b7PJ1MVD9FEEN0?= =?us-ascii?Q?PzFumvtNXD5C3gCzJNd8jLviFP/AlVY84yQnRhKlIkB5AxpdetaZh7zpKZCE?= =?us-ascii?Q?PXBptrqfjHJRAmsUe+zU+riyVUpDxwe08LvN402zrvYJ9ut7yZ+thysX0yg3?= =?us-ascii?Q?4QWoKI7LXdfMmhyp8XvHQqvi+ZqDuol+6/sGJ84RVEnaV64b28JiR7oJwkHt?= =?us-ascii?Q?3DjjC60ORs0zz5P4CSPkTrODqWS47km1JnySOcburZIYSzybt20D15YxifsF?= =?us-ascii?Q?1f+jLU7/eDg7jL/xNHN0XKTxmIJnxu4S07ME+BDEycMIoluCFAkjWbaUSwk4?= =?us-ascii?Q?F2CNc9fmQgfJf+rl1b3CW08X2jlEZ3DoYKCi+/HqWvQBbxW8VwRTNKsepFDP?= =?us-ascii?Q?1+QszNpexbYrRymhRmFKoIcSmj9te8pKn/8356ExrebCPCcQzm0j3uqxCR9J?= =?us-ascii?Q?bo0MnABpvItj80sF5kVN6gnzrYJBVk24urjsMBf4+FMSX74uYWVaCbmEGANL?= =?us-ascii?Q?/gifHwZsxQ=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57f0bf0f-d256-4505-ba39-08def240a19f X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2026 15:54:13.8226 (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: pVdH8E1N3ZHUzgWIF6WOpkpGHqd6ndKpjzMVl4PjFb/cIMSyd5gqI2RPu3Dy9yair/VuFehn6ULS741RuwwUXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO3P123MB3532 Content-Type: text/plain; charset="utf-8" From: Petr Mladek sysctl_hung_task_warnings counts how many hung tasks are reported. The watchdog does not report anything once the limit is reached. Currently, this budget is decremented permanently, meaning the kernel is left blind to subsequent hung tasks even after the original issue resolves. Keep the global sysctl_hung_task_warnings intact, and instead decrement a copy (hung_task_warnings_printed) when warnings are printed. Reset the copy back to the configured sysctl_hung_task_warnings limit once the problem on the system gets resolved and check_hung_uninterruptible_tasks() detects no hung tasks in a check interval. Also keep the copy updated when the global sysctl_hung_task_warnings value is updated via sysctl, and update documentation to reflect the new behavior. Assisted-by: gemini-3.5-flash Suggested-by: Petr Mladek Reviewed-by: Lance Yang Tested-by: Lance Yang Signed-off-by: Aaron Tomlin --- Documentation/admin-guide/sysctl/kernel.rst | 5 +-- kernel/hung_task.c | 34 ++++++++++++++++----- 2 files changed, 30 insertions(+), 9 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..4e1fb0db79d1 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -59,6 +59,8 @@ 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 int __read_mostly did_panic; static bool hung_task_call_panic; =20 @@ -247,9 +249,9 @@ static void hung_task_info(struct task_struct *t, unsig= ned long timeout, * CONFIG_DEFAULT_HUNG_TASK_TIMEOUT. Therefore, complain * accordingly */ - 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 +266,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 +306,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 =3D hung_task_warnings_printed; unsigned long si_mask =3D hung_task_si_mask; =20 /* @@ -340,8 +342,10 @@ 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 sysctl_hung_task_warnings; return; + } =20 if (need_warning || hung_task_call_panic) { si_mask |=3D SYS_INFO_LOCKS; @@ -425,6 +429,22 @@ 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) + return ret; + + hung_task_warnings_printed =3D sysctl_hung_task_warnings; + + return 0; +} + /* * This is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_s= ecs * and hung_task_check_interval_secs @@ -480,7 +500,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 Oct 2 06:16:30 2026 Received: from CWXP265CU010.outbound.protection.outlook.com (mail-ukwestazon11022079.outbound.protection.outlook.com [52.101.101.79]) (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 A8164470103 for ; Tue, 4 Aug 2026 15:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.101.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785858861; cv=fail; b=bGlJAUbyAkzJad6GURZN7mJKuo/+42uZeWxj+BlcNrC44ICgv+sQYnWLLeII7WUEQu/Iyus/SQr1LWp3fYyuJUSgF49Tp04rE8Quxy8mg40IfFn3dVHALB6zztLNDXaMmnuX76y/34/Ml7Tn1pgHlxp0vDwjvqvpCpKhgaUB4eU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785858861; c=relaxed/simple; bh=yTxvoWG4O0V7XCgYvf94JEXMjGjnHxUlu7EKyULsf8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=gvPj9Yb/ZpGMKxhrlAh0x/Rl5W0n+XN7sFga1GDkilZz09mEG6kNrYxUObqZbIVJaY9QJoF2gA7vMrkEEOtmbfv9+SCdENK0/8+iKUNimNN0/vt9iiOps0BthfR+Q2s4xzBOyUUvpQSd++rRCjvKT8/w8b0tfQhwztbZP0swiPM= 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.79 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=pzHP1BzvTTNhT5sTW/7id+5uE4boKnmqynt+I/OrNhGQTrGiNLIzMPSXZEXju5S1I8xKso0IHi3Bb1CTm7oE2y/k1PQ4rjTqS+Nav5v3LPCtU0XY2gOnOKiDOwCq+jb4/CXnSlBc8cfm/bO5BmvygSOUHhKhVqstTZ5ORpwwEC/mHlr/gYXEvxozl/jl5bL1FlZazUpJ0gLCj9FEu1u8WeerZWLbmJJtji6LpcPRHtZyBaLUmySbTXXipofl0lr6Ccxlrchj02ZqhLV/ipxT3YAsvxPDnpmbwelH+A8Kpd7RUNZib5i5QQ37F0/EGcKWYIBWocExMXjtTNwQJbePgQ== 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=EAwvWsLgmNfwutXFb2z9H8l1XkHU5iomCj+8aYL9FCk=; b=jYwMZvoLvW0coSF9/lgGrXik96zTrPCFvsw56rszETw2lARdqWbuPqOgjfjqzpWlWh2FsuMqMr9VUnZofJ4hO+J66GbAcpDrJx+dNBpqBcWq/K5QNqLxZgOxAWNEKVrnhGRV9aVReLrZd06Rfw2d6jTT+1pQdYi7yjdCeP7DBJ1LmMN6pAOthvYy4MdeU79YjpnvZM8V+mAOWcIjXSKvu/r/oEsnydni5GLueDn9BM+UAuD3qGWNFOx1GYsyTO3BRMw6pY+00QrP4YxrBz8jV0FxQRkN1l19StW+DITsbR21kH2KPXHu6Ut/UCaSicwUQ7lKPJLAgxXcwo4YKvPsnQ== 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 LO3P123MB3532.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:10c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.19; Tue, 4 Aug 2026 15:54:17 +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.0292.013; Tue, 4 Aug 2026 15:54:17 +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 v7 2/2] hung_task: Always print basic hung task info header Date: Tue, 4 Aug 2026 11:54:06 -0400 Message-ID: <20260804155406.254810-3-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260804155406.254810-1-atomlin@atomlin.com> References: <20260804155406.254810-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BN0PR04CA0042.namprd04.prod.outlook.com (2603:10b6:408:e8::17) 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_|LO3P123MB3532:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c16e0e9-9c7c-40ae-297a-08def240a40a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|7416014|366016|1800799024|6133799003|10067099003|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 9cxkB2A9s4IKbptqol/6yfTIwv+J4ASbvRCOOxdTTe8cZFpJn0vC/LTZq1jxggQ3uOFMl1i7WQ8lEwwi78WpXwqN+pUkFSOaMWhwf2XiAdm30NMSJcIO4c8tYvwbLAildSwh9apS+EQg5lCy1Zczj8BAH5nfOfKGbTTKgeOiPB6fnrMLICmuxtYmMNxl/5BzTYemE3/AfQptQg+XjkZzRjYsPYHJJBwlxpazFEkRvHEoE73hzou+f1OFbHftzJmkJaTXGOGbcvmOedA44+48N+onOj2c2jufGCF4zbVtkHi/c0MYcxpt7xP64JCis+JDDVKQAaIe0hdDPpeEJzVoZPPS7aXGm6jFFANVMG2xD4VMOQe/oC4O/6VtHmWgsrBFP/0wkUDzQKtLX11V2CsoGgBCsbmOfWF8kmKGRMeVFCiJxJTQGdMfH+qhs5lW7wB/59s7j8cYdyp5APj+U6UZ2ntyq0SEo2XeReph+Y3YSRakoMvQdhtWorDOb1Zm+wT6MtRGiUfl0FiF0ms3By6TlWJNzz0wZPW0plEi0f6oymcQZUsTz05je96ybWhPY/X2meDPn9eAAmnf+ilcr1t1yv3z6vkEQFXb9FkaClwWOVIH9B5wqsIo5E5pcUjR0oUYUlzl3ve5PDjGBIWiim34bQU/iFNxL04k9amutsRsPCs= 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)(376014)(23010399003)(7416014)(366016)(1800799024)(6133799003)(10067099003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ccC5bvtSco3X1Vi+8lHAuhfLRXw0tf8zpwOh5O/SrrzHCg4UT1Fm9W3yDzh8?= =?us-ascii?Q?A9gFT/uEEcJG81ZP5IYXhtCiuEOBuXmZYra4UDjYVoy5QGNE8sS+DwQURXF0?= =?us-ascii?Q?251HCA/9+ZCDbJdrAOT1RPxrI3ytCuARZECwcBFtV8MEMCtgKQZnTjegi15H?= =?us-ascii?Q?qFLIiM/PhMY6viz2DzhG4ygqaPmbE4uKCU6weNgynY0hUItkVBcSPs4cxFnu?= =?us-ascii?Q?xbAYUBml+AUvS76Qb2SJRbiuwqcLM8RHblZ57qWW3Wjj5M2Ibnq5hvQ4X/DY?= =?us-ascii?Q?P0t5o9F9jeY4plo3sa7XnuLMIejHK8ATsSc+b0w8U2VBwwYfRaabQSFy+4wJ?= =?us-ascii?Q?cAOvhn5JxegsfgfFiTOTDNyq+/lzMQllMFRlAgPCH8FTGNVEGY43/XaKB+iv?= =?us-ascii?Q?LJxu49/AN68y2HpFz3qseLmROB+j0BaN9fSr5I4yN8G6xZ5JETu+ErKBBPgV?= =?us-ascii?Q?5Ab8zdLlW302cefuU19tsKrC5lVldcCUBxtlF5rSn7752SKxxs+UtZd4hAhe?= =?us-ascii?Q?f9Auzng7OYw1eZIoDATFODm6Bl+Vz8KTd15LhG2S/hdGnFTsjs9Icepozokl?= =?us-ascii?Q?Yf8Hg1PMNHZwGLAGzKbT/4ePI/7NJhJ7giucfK3dvoeneISrBK7WbVrDvYtf?= =?us-ascii?Q?rdu6Q0y0i895eBMblcQtDkvEk86docKlkhybvUGV2kG39WmAhOBWYlY89RAB?= =?us-ascii?Q?i9d03cG9v7KB0g4NMjeEzONIhEcSaZk+cCqtTJ28T3qxvva8leC4bX+eN1xA?= =?us-ascii?Q?/zY8CRs8a801ht+kyn0NgbZN3HyCsH1EBBYVbctAKHjb+Cinj/sJ6qJP4KMX?= =?us-ascii?Q?aalC64BRHWaooqRg/2itHYS1+NfP7DDaA1m+NaoxGSnCZH5zuOHKOIbNaDhY?= =?us-ascii?Q?Wy3a8VlT/UkmkJBM/zImWYKvf45YHg/1b5LdbSpldn+pGYYa5Aql/QVv5Jzs?= =?us-ascii?Q?NZNmdNxN7CoVw4NWOtbfILzGAWoMX7XdUopCq5mhtso7FnikzggsdDM6jaD2?= =?us-ascii?Q?T+qPZ9eY8W5+APaqNjPTughU1J75ReEc7A9tgFtmZTSITI0SATTThmZ/XfUz?= =?us-ascii?Q?Wq31P9d35bBR2E84LDvUYo5V7DdKC2I77fjZWH6qS6VFaIxUrfdptDBWqYt8?= =?us-ascii?Q?UfathMohDUtLsOZact8dOdpSwdUqxkR3iJHnh0LbOoPB4gT3+FcXrElxiLR8?= =?us-ascii?Q?mPLFgQFujNAi03o7s5MYLP+vt7xBscOrNBIaJlf33EY24m1oj6FrvhxzcD7K?= =?us-ascii?Q?B5GjW5PQammlkCjpHqPy1FKgYlVqh80lm8RdlczLCTn5WcEazmMblqdzBfG+?= =?us-ascii?Q?d78QLpUVrgZMk+nkdbncwlgcHLeBSKlJV3UWRjTZJrgK895DRCTY2+TJIG+W?= =?us-ascii?Q?xy1CLWIuYYurMU6wmXQHouY4fNX6LaFbaFrS8jZjYMOLn3tvz22aJf+I0BbL?= =?us-ascii?Q?YBeIVWqfgG6UvPXQlm3KryiDPAH55YKChO0CGi07/WWqpoPBKYt9Rr3xqVf0?= =?us-ascii?Q?uDwq5lKq04vKhVDXLT58dWx+tA0yfGPO+/qld0sN2N598KIPwCCJMPyfjTgr?= =?us-ascii?Q?iTf0szsMOPauMdR9U8CRRaz1D/XfoQuLg5wPgSD0K9ZNhyDM8B7p0Y6MuoiD?= =?us-ascii?Q?b1TSgLn/M85fK67PqoRaiVVDbHT7fjIDsZ3GxNFYvOr2GoYV7J1DhHHsuDqF?= =?us-ascii?Q?FFbuJEeVo1sk3/jl/Llpxg309V5Zo5xEFVmUdeXd+BJRl3wY+yxqbziSRzwQ?= =?us-ascii?Q?kECQhmP01Q=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c16e0e9-9c7c-40ae-297a-08def240a40a X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2026 15:54:17.8466 (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: JqDCjupWJemjoaLGevo3OAB7Ua54bMUlKlAJ4HkL/OKq+dJgbRWncrjUJZt5nwwGDehr59xmY350lCOnY7rXBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO3P123MB3532 Content-Type: text/plain; charset="utf-8" From: Petr Mladek Currently, hung_task_info() completely suppresses any warning messages once the warning budget is reached. This leaves the system completely blind to any future hung tasks, even though we only wanted to suppress heavy process stack dumps. Modify hung_task_info() to always print the basic single-line error message about a hung task, regardless of whether the warning budget has been exhausted. Restrict only the verbose details (such as stack dumps, taint/release status, and blockers) to when the warning budget is intact or panic is triggered. Additionally, update the notice printed upon warning exhaustion to clarify that future reports will only omit process details rather than being comple= tely suppressed. Assisted-by: gemini-3.5-flash Suggested-by: Petr Mladek Reviewed-by: Lance Yang Signed-off-by: Aaron Tomlin --- kernel/hung_task.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 4e1fb0db79d1..6ebb3a87ac65 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -244,17 +244,19 @@ static void hung_task_info(struct task_struct *t, uns= igned long timeout, hung_task_call_panic =3D true; } =20 + /* Always print the blocked message */ + 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); + /* * 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 (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); pr_err(" %s %s %.*s\n", print_tainted(), init_utsname()->release, (int)strcspn(init_utsname()->version, " "), @@ -267,7 +269,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(); --=20 2.55.0