Cover Letter Detail
Show a cover letter.
GET /api/1.1/covers/2220418/?format=api
{ "id": 2220418, "url": "http://patchwork.ozlabs.org/api/1.1/covers/2220418/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/cover/20260407083219.478203185@kernel.org/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/1.1/projects/26/?format=api", "name": "Netfilter Development", "link_name": "netfilter-devel", "list_id": "netfilter-devel.vger.kernel.org", "list_email": "netfilter-devel@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260407083219.478203185@kernel.org>", "date": "2026-04-07T08:54:12", "name": "[00/12] hrtimers: Prevent hrtimer interrupt starvation", "submitter": { "id": 92397, "url": "http://patchwork.ozlabs.org/api/1.1/people/92397/?format=api", "name": "Thomas Gleixner", "email": "tglx@kernel.org" }, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/cover/20260407083219.478203185@kernel.org/mbox/", "series": [ { "id": 498944, "url": "http://patchwork.ozlabs.org/api/1.1/series/498944/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=498944", "date": "2026-04-07T08:54:12", "name": "hrtimers: Prevent hrtimer interrupt starvation", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498944/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2220418/comments/", "headers": { "Return-Path": "\n <netfilter-devel+bounces-11642-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "netfilter-devel@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=HugIpB0f;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11642-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"HugIpB0f\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqg4718jMz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 18:54:31 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 24E2230056EF\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 7 Apr 2026 08:54:18 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 844CB39B48E;\n\tTue, 7 Apr 2026 08:54:16 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BC5113959D;\n\tTue, 7 Apr 2026 08:54:15 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id C4457C116C6;\n\tTue, 7 Apr 2026 08:54:14 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775552056; cv=none;\n b=eTxdr9G6JgaLAiZQ9p6d8W/oi9dEk4FnIFFIu0nxJXekK31jUp+a6+tOv02fv/Eb98t3c5FJzhWIhoDtgL/dofWM73JyYzu61knTFnEK7nGmt9ohGbciUtX80A2UzkFKQaN9bk5/hbcKW8KsRvvEv9pEZMRiK5LfK6icIc79+88=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775552056; c=relaxed/simple;\n\tbh=/UVoU8W1t8K+EOuKoQSmXAaZim6qPp6ckYNHHxZ9hfM=;\n\th=Date:Message-ID:From:To:Subject:cc;\n b=WUpx0Bt6GCSXph0QMM1Z28b3R38hn2BGX9e3LYld5LC06Z9Lxsn2Rt8LuldhPZJupoOX7hQCGFyoEeIhgwi0my/LLbW+mOXhYSV7VNYFy1E2eJqGrWMigMUYlMWLlbdI2Iilcd6V+j2npEVIw9+qNQlbGYPpTxswZp39LhA+It8=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=HugIpB0f; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775552055;\n\tbh=/UVoU8W1t8K+EOuKoQSmXAaZim6qPp6ckYNHHxZ9hfM=;\n\th=Date:From:To:Subject:cc:From;\n\tb=HugIpB0fmydogp5EXRfDc4cCc5LM83rTvVXhu5K0HStS9X6dGvHkUivRxy1LpkvCI\n\t kCp5zccEBfFQkwsWbW9SOKKPD3VM+PwcPmUULsXhj2Gwo4EcF7OAOHtsa+1vOXD3dV\n\t MGvYCMPtUTACJI8xtB8ErH+jORoSYazaTyozMRLHbpUXr5HWa/VpOxCPiCBcM3FaQ9\n\t 2aueWXdJ5OXgIW982W5kscBjtD0CzVGXdO6tXe00RtRTqqJSls760tRXvh4l93mH1k\n\t hkIZvX53+xSxZtE/WmrN/Wbo/yAuWsch0IEWYF8/5GT7g/TubOn+C6Ko6M7wmbn2BY\n\t Chc6BEo/CkDRg==", "Date": "Tue, 07 Apr 2026 10:54:12 +0200", "Message-ID": "<20260407083219.478203185@kernel.org>", "User-Agent": "quilt/0.68", "From": "Thomas Gleixner <tglx@kernel.org>", "To": "LKML <linux-kernel@vger.kernel.org>", "Subject": "[patch 00/12] hrtimers: Prevent hrtimer interrupt starvation", "cc": "Calvin Owens <calvin@wbinvd.org>,\n Peter Zijlstra <peterz@infradead.org>,\n Anna-Maria Behnsen <anna-maria@linutronix.de>,\n Frederic Weisbecker <frederic@kernel.org>,\n Ingo Molnar <mingo@kernel.org>,\n John Stultz <jstultz@google.com>,\n Stephen Boyd <sboyd@kernel.org>,\n Alexander Viro <viro@zeniv.linux.org.uk>,\n Christian Brauner <brauner@kernel.org>,\n Jan Kara <jack@suse.cz>,\n linux-fsdevel@vger.kernel.org,\n Sebastian Reichel <sre@kernel.org>,\n linux-pm@vger.kernel.org,\n Pablo Neira Ayuso <pablo@netfilter.org>,\n Florian Westphal <fw@strlen.de>,\n Phil Sutter <phil@nwl.cc>,\n netfilter-devel@vger.kernel.org,\n coreteam@netfilter.org", "Precedence": "bulk", "X-Mailing-List": "netfilter-devel@vger.kernel.org", "List-Id": "<netfilter-devel.vger.kernel.org>", "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>" }, "content": "Calvin reported an odd NMI watchdog lockup which claims that the CPU locked\nup in user space:\n\n https://lore.kernel.org/lkml/acMe-QZUel-bBYUh@mozart.vkv.me/\n\nHe provided a reproducer, which sets up a timerfd based timer and then\nrearms it in a loop with an absolute expiry time of 1ns.\n\nAs the expiry time is in the past, the timer ends up as the first expiring\ntimer in the per CPU hrtimer base and the clockevent device is programmed\nwith the minimum delta value. If the machine is fast enough, this ends up\nin a endless loop of programming the delta value to the minimum value\ndefined by the clock event device, before the timer interrupt can fire,\nwhich starves the interrupt and consequently triggers the lockup detector\nbecause the hrtimer callback of the lockup mechanism is never invoked.\n\nThe first patch in the series changes the clockevent set next event\nmechanism to prevent reprogramming of the clockevent device when the\nminimum delta value was programmed unless the new delta is larger than\nthat. It's a less convoluted variant of the patch which was posted in the\nabove linked thread and was confirmed to prevent the starvation problem.\n\nBut that's only to be considered the last resort because it results in an\ninsane amount of avoidable hrtimer interrupts.\n\nThe problem of user controlled timers is that the input value is only\nsanity checked vs. validity of the provided timespec and clamped to be in\nthe maximum allowable range. But for performance reasons for in kernel\nusage there is no check whether a to be armed timer might have been expired\nalready at enqueue time.\n\nThe rest of the series addresses this by providing a separate interface to\narm user controlled timers. This works the same way as the existing\nhrtimer_start_range_ns(), but in case that the timer ends up as the first\ntimer in the clock base after enqueue it provides additional checks:\n\n - Whether the timer becomes the first expiring timer in the CPU base.\n\n \tIf not the timer is considered to expire in the future as there is\n\talready an earlier event programmed.\n\n - Whether the timer has expired already by comparing the expiry value\n against current time.\n\n\tIf it is expired, the timer is removed from the clock base and the\n\tfunction returns false, so that the caller can handle it. That's\n\trequired because the function cannot invoke the callback as that\n\tmight need to acquire a lock which is held by the caller.\n\nThis function is then used for the user controlled timer arming interfaces\nmainly by converting hrtimer sleeper over to it. That affects a few in\nkernel users too, but the overhead is minimal in that case and it spares a\ntedious whack the mole game all over the tree.\n\nThe other usage sites in posixtimers, alarmtimers and timerfd are converted\nas well, which should cover the vast majority of user space controllable\ntimers as far as my investigation goes.\n\nThe series applies against Linux tree and is also available from git:\n\n git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git hrtimer-exp-v1\n\nThere needs to be some discussion about the scope of backporting. The first\npatch preventing the stall is obviously a backport candidate. The remaining\nseries can be obviously argued about, but in my opinion it should be\nbackported as well as it prevents stupid or malicious user space from\ngenerating tons of pointless timer interrupts.\n\nThanks,\n\n\ttglx\n---\n drivers/power/supply/charger-manager.c | 12 +-\n fs/timerfd.c | 115 +++++++++++++++-----------\n include/linux/alarmtimer.h | 9 +-\n include/linux/clockchips.h | 2 \n include/linux/hrtimer.h | 20 +++-\n include/trace/events/timer.h | 13 +++\n kernel/time/alarmtimer.c | 70 +++++++---------\n kernel/time/clockevents.c | 23 +++--\n kernel/time/hrtimer.c | 142 +++++++++++++++++++++++++++++----\n kernel/time/posix-cpu-timers.c | 18 ++--\n kernel/time/posix-timers.c | 35 +++++---\n kernel/time/posix-timers.h | 4 \n kernel/time/tick-common.c | 1 \n kernel/time/tick-sched.c | 1 \n net/netfilter/xt_IDLETIMER.c | 24 ++++-\n 15 files changed, 341 insertions(+), 148 deletions(-)" }