From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CWXP265CU010.outbound.protection.outlook.com (mail-ukwestazon11022104.outbound.protection.outlook.com [52.101.101.104]) (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 54B7E184524 for ; Tue, 4 Aug 2026 00:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.101.104 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785802582; cv=fail; b=gSYiUDW4XIN6ZXsgbU6KrUi8qBzaOfKcyXFPc3wnLntJrhK4p4HYjvT3pLiQBV18efomsM0bBSEKHxSBY+mUXOpoeplY+sdUQKqZG++u1sw6M5y6jVIT5lUcJ+7pcNnDH0vRFlXmwsbybpK8jZDGUDmT0Kuf88t94mhlbznoFPc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785802582; c=relaxed/simple; bh=PUF2C4KC6YbbMp3kbqTqVsTubQA7Yu4IQPv7nSTeoIc=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=Cm3kEX6Gbrr3rsjHswDeItoijPNpAenHz1rSdHQBWdzXn8sRpUwH4f0xuBGgsJQKGYAT8uY0e5dE+1ARaMhXknDWfkQRtE3OgUALKdh58jzTgm4b04zRQWi+idu4vmwVDkng2jnY7bAeNjxHyaWsEC1rSD0t8AfEqGTCjguw/9s= 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.104 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=Q1zeRBRnZZTqB5gMT1QChlQxN1kQX1lyl8adIM/kc8COCTpbOnRmy5BizBEt8B4078Bkd/2zwbKM2elor3tGEB97FTSnhXPtQH8nVXabo9m1CTGWjBF805pSHAmDU2AVgmgWh+z3jW7UpJAvOfufQXEX7YZD6gXzD6K9yBbOfYnm2EaTN1f5AAT8NlPQxV5a7vZ0zXh5grMamZZzaXMKuYvjNEHC0Ef52wPinIAf7soh1YfKwl2AfjOU0XUAuKh6uXVuF0qDgGoHY7ib3aWBMl8vkdBQE4aLhIOiUN6Hrmd/Sc9ehBR/YWBGulnCM+yGXvhDi/JN7wYL+k6MOR11fw== 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=63TPgJUdAEyEvlMcr7SxXJQe6keZVJQFmSNQp01VNbo=; b=ficxEGsuGiBwu6QSn16+nBz4BrX+GW0K3votVVvWUYEibiGFYKDc4/wto2ujW2qegUOTxBi2tB/Nz2iqNqZ52fPvzgR9akSA3sbiRBE1nuK9WIcZsqlG7ZlQWuAbqCxbktYWQHH3HpG2Ho7xuGWOHZ/fE6EzP2+mPpsy9Pa8UBfrC8Nj/CM10RL5vSBEg8P3Phehe+maEVSbMbH770/yWyGD3wj4BfcSJ9ucTFFz7gzycNYexdGrEDng+vzF9C/v+dx0B0JoPdPaaGhbIthtd1vndWvwP9jOL0aIy2JOZmOZb+COkFpde1plxYr1V5w6EhbYCAUQZTzbaTlYCjvGSw== 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 LO6P123MB6616.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2b2::11) by LO2P123MB3741.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:12e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.18; Tue, 4 Aug 2026 00:16:17 +0000 Received: from LO6P123MB6616.GBRP123.PROD.OUTLOOK.COM ([fe80::3975:c5e7:bc1a:f383]) by LO6P123MB6616.GBRP123.PROD.OUTLOOK.COM ([fe80::3975:c5e7:bc1a:f383%4]) with mapi id 15.21.0270.017; Tue, 4 Aug 2026 00:16:16 +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 0/2] hung_task: Improve warning budget handling and task reporting Date: Mon, 3 Aug 2026 20:15:40 -0400 Message-ID: <20260804001542.249639-1-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BN9PR03CA0953.namprd03.prod.outlook.com (2603:10b6:408:108::28) 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: LO6P123MB6616:EE_|LO2P123MB3741:EE_ X-MS-Office365-Filtering-Correlation-Id: ec4410cc-b9a9-400c-f9e9-08def1bd8b09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|366016|7416014|376014|1800799024|6133799003|3023799007|56012099006|10067099003|18002099003; X-Microsoft-Antispam-Message-Info: aoTfigNPPRhtwDA0FOuqLSFb5Kc4NdGgZWpklAr3B1H0kowjOfkhKRySURPMhEZ+YzMTnAcZAKyvhqUkBZJzt5hOpNrps+uOH9QDqcMHZ6ZVWXhbrdxE6ohSt4FbAOO8ZSKkD7oXAg/OOKr8SAdt0pq3uhQ6xnD0dIFDrVVNZr1KjQDTfPisJYWqw8tUmpozAlv7oHamELLKbMmHaUJNSLZIIGxmUhKhf/wrEgfxFNRfUW43W3chMzdk6CfkuIGdEp+kg+CZF+pa71xigZATKxXdVvpIA9k94y1HpdutHAnTBLm1QgIrHYmUV2dh0flBgaEND2lyh3w+8WXg4y3iEWRa++zEzYGdS+WfIQlrJk0H73SzAD6kRzCp2i2uuPQrk6Lv/YF18O3oWxr+D8vkyS29hFUJ64Dy2UVMztAzEddTn2HKbqth6A4VAwYho5FKX+2u16XEo/jEYOR7KrMPG0rcSR4fNPhwvOAXDXyDzmmHYPuQVUWknexwviCI1H/dU/1hNi4Yit8VgydX0rqmUaNkqYv74URsqU85cf3YqU1RoBwEv3F4E/k/+V/M0xnVrQt0jfF8S2j5LfAJCoDlKuqzxp/oxpQchRAAGKl5QxBmyk0cCI9+sTpdQDvw+R2s55JApcQKkoYlY7boWtFi7WKRnJnEBJaFrWdfzMpDgSg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LO6P123MB6616.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(7416014)(376014)(1800799024)(6133799003)(3023799007)(56012099006)(10067099003)(18002099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HZdFgjtUdEdK9dc+LSDLHY5JYGi+RFx+vXgPNVJBUp70al/5GER5SZ1rrhCh?= =?us-ascii?Q?fnq9zpSci0WhuSQAyPZ45NMZomyR4fB6cVxIbwq5d2CU1tDhHM0CAO+XrNVc?= =?us-ascii?Q?k04DYxUxATJ8kGxjmcI1fBqoT4R1GAE+FzOyttl2zRSflkv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wyD4KWAllAYUS+yhRgq5cQr+mXCdlDj2ObiZ6eBYELw9wMWBRVQ?= =?us-ascii?Q?bI8IU/XegsrA2shba9TGNgvTuIKDbr6TQwRcN9dxW8VyNSZqz/7vH/aU95hG?= =?us-ascii?Q?Iw/lucLdBLDzwOPhaccaIu83b1GS8MRSCHwkAIehp0kIjangG3vJMQggI0FY?= =?us-ascii?Q?knIQPx9h3J1rlygrRp2QXDNeoRCyAvPur9enipDOefVgkO+DWj8chX6TiXxs?= =?us-ascii?Q?Ohl00UTxx/6J3smp4m/O5Xz7PA41TBehO7dLyP4kL3mbcvuGO4JYvf1ykAU/?= =?us-ascii?Q?3bkJeEDv3mrKODT3saogI7lJOpjdy/w3hVvpTdTDMoVSmkR46ZfCkftp5Qn0?= =?us-ascii?Q?WQr22gPlJL74qglcfdW6e8H+h+5a12e22YsL+gLwKsEL06efpLrkouUUVAAc?= =?us-ascii?Q?l1Pgh2nv/MulT8ejbL+UMnE/np7bmH+jiQqWAZNqLm278ANAtnSaEYwE6R4I?= =?us-ascii?Q?sKDv8dx75ELUvcsGvj6NtSXTEAu48J98qOaMS32UbfIwL+MnUj44nUSWB2e8?= =?us-ascii?Q?/bIOVIxzPOBMhKXT10bD7Rgzz1ZTu9ygEYwTP/fmQ2XqvXi6ocy85ovJEoSM?= =?us-ascii?Q?tKU4VG1kFg1wxK2PhO3D+yjbUmz4t/w5WDRKZcs5MuPZizK3pn2Ac5uUhtL+?= =?us-ascii?Q?KKSM24Gm0fFqC0HpjkEshqdSXjlr9kl+T4fMTXU834g6jJyYkytPBLt0YIS8?= =?us-ascii?Q?5TYgKUDwKA=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec4410cc-b9a9-400c-f9e9-08def1bd8b09 X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB6607.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2026 00:16:16.7785 (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: 2tew12G9Xl7fcck30IpO8JHQWaMVS3v8ZadI6Vc0RVY6R007GKfwlfm+WUzjGgccroevvVW2Zr+xJhts+q+mJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO2P123MB3741 The hung_task watchdog detects tasks stuck in uninterruptible (D) state for longer than CONFIG_DEFAULT_HUNG_TASK_TIMEOUT seconds. To prevent log spam during system spikes, sysctl_hung_task_warnings enforces a budget on the number of logged warnings. However, the current implementation has two major limitations: 1. Permanent exhaustion of warning budget sysctl_hung_task_warnings is decremented directly when printing warnings. Once this budget hits zero, no further warnings are reported until an administrator manually updates the sysctl value or reboots the system. Consequently, a single temporary hang episode permanently blinds the kernel watchdog to any subsequent hung tasks after system recovery. 2. Total log suppression when budget is exhausted Once the warning budget reaches zero, hung_task_info() completely suppresses all output, including the basic single-line alert. While suppressing verbose stack dumps and lock debugging is desirable to prevent dmesg flooding, hiding basic task alerts leaves administrators entirely unaware that tasks are hanging. This patch series resolves both limitations by decoupling the configured warning budget from the runtime warning counter, automatically resetting the budget when the system recovers, and keeping basic single-line hung task alerts visible. Patch 1 decouples the user-configured limit sysctl_hung_task_warnings from the runtime counter hung_task_warnings_printed, automatically resetting hung_task_warnings_printed back to the configured limit whenever a check interval passes with zero hung tasks detected. The runtime counter is also kept synchronized whenever the sysctl parameter is modified, and the corresponding sysctl documentation (Documentation/admin-guide/sysctl/kernel.rst) is updated to reflect this auto-reset behaviour. Patch 2 ensures that the basic single-line pr_err("INFO: task %s:%d blocked...") header is always logged regardless of warning budget exhaustion, while restricting warning budget enforcement solely to verbose diagnostics such as process stack dumps, taint and release information, and lock blocker details. Additionally, it updates the warning exhaustion log message to clarify to administrators that future reports will only omit detailed process dumps rather than being completely suppressed. Petr Mladek (2): hung_task: Reset warning budget when problem gets resolved hung_task: Always print basic hung task info header Documentation/admin-guide/sysctl/kernel.rst | 6 ++- kernel/hung_task.c | 46 +++++++++++++++------ 2 files changed, 38 insertions(+), 14 deletions(-) -- 2.55.0