{"id":2220905,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2220905/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408114952.604232981@kernel.org/","project":{"id":26,"url":"http://patchwork.ozlabs.org/api/1.1/projects/26/?format=json","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":"<20260408114952.604232981@kernel.org>","date":"2026-04-08T11:54:29","name":"[V2,10/11] netfilter: xt_IDLETIMER: Switch to alarm_start_timer()","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":true,"hash":"7caf7a5c7154d04bea8d79bcaf143c2b91a70cc8","submitter":{"id":92397,"url":"http://patchwork.ozlabs.org/api/1.1/people/92397/?format=json","name":"Thomas Gleixner","email":"tglx@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408114952.604232981@kernel.org/mbox/","series":[{"id":499126,"url":"http://patchwork.ozlabs.org/api/1.1/series/499126/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=499126","date":"2026-04-08T11:53:41","name":"hrtimers: Prevent hrtimer interrupt starvation","version":2,"mbox":"http://patchwork.ozlabs.org/series/499126/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2220905/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2220905/checks/","tags":{},"headers":{"Return-Path":"\n <netfilter-devel+bounces-11723-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=hMsU+yTj;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11723-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=\"hMsU+yTj\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frM7R2yvhz1yD6\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 21:59:47 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 68439306960D\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Apr 2026 11:55:41 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 8EC223C2776;\n\tWed,  8 Apr 2026 11:54:32 +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 0C54F3C1992;\n\tWed,  8 Apr 2026 11:54:31 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 4C3ABC19424;\n\tWed,  8 Apr 2026 11:54:31 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775649272; cv=none;\n b=o3q/IR5DiHazdEF91VTZIL5lB3xhyQFCUR30NwNLIXT8mdi2f4B1/ZOcgTk2c1MHz0Ov3z2Yr9AYsg9BDJsOfeF1gxJJy8+OASP45a3eOkIdKvWjulJCdI7cVhT4i4UoM7Z7wxUj4FoLz7rnJXCItZ2n7Er2vaKI3uZFrnHbcSU=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775649272; c=relaxed/simple;\n\tbh=efxNzTSqI1QvLYqqvv6gR0CW8wLFKTsZf9UzQJz2oZs=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=L+xxnNS89dHQJPLML8j1M1C2FISpUtvJjTfLwabj2KJkvJLwi7sefI/zHkBHzb6Rwmh62vx9RC0lDYCngujYkeUDgT72MT1K9saMaiEIwfRtVbaJ7MqXSAtFXWMVY35wzQfscAagATO+ygeqTYQPuQndj3X2n1Sa2w2og2QRCSs=","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=hMsU+yTj; 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=1775649271;\n\tbh=efxNzTSqI1QvLYqqvv6gR0CW8wLFKTsZf9UzQJz2oZs=;\n\th=Date:From:To:Cc:Subject:References:From;\n\tb=hMsU+yTjwOBVM5ofTn3qtOcoy5Li/qNXKaQGrQ05mznlTpAKoq/hU9j5yAixOfCBY\n\t 5Ulimf9LwPbw+jI+EV47OLO7IxAAGkCpV51YQsBOVmVjBbrKj8Pq2tHIvlElPKaEzf\n\t teWw0wMFZ/oCVek/KaEWSNcafoBKG2FqzlZrr66pIQZESzbQNDEssrQuINOSaJCQep\n\t GVnoKUoiaJgY9afkGcsAh4sk0G/aPb8A6UmKW9+GZgEptsY2dI6R9DsvKc5swHZ8Or\n\t tjZC0mT9SkkYpRCqx4rv0A6peiJC3U3JBDeg5v/+2wasuuca42wMVg9Zj1AdyJc1NM\n\t chmV1gw8Du9VQ==","Date":"Wed, 08 Apr 2026 13:54:29 +0200","Message-ID":"<20260408114952.604232981@kernel.org>","User-Agent":"quilt/0.68","From":"Thomas Gleixner <tglx@kernel.org>","To":"LKML <linux-kernel@vger.kernel.org>","Cc":"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,\n Calvin Owens <calvin@wbinvd.org>,\n Anna-Maria Behnsen <anna-maria@linutronix.de>,\n Frederic Weisbecker <frederic@kernel.org>,\n \"Peter Zijlstra (Intel)\" <peterz@infradead.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","Subject":"[patch V2 10/11] netfilter: xt_IDLETIMER: Switch to\n alarm_start_timer()","References":"<20260408102356.783133335@kernel.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>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8"},"content":"The existing alarm_start() interface is replaced with the new\nalarm_start_timer() mechanism, which does not longer queue an already\nexpired timer and returns the state.\n\nAdjust the code to utilize this so it schedules the work in the case that\nthe timer was already expired. Unlikely to happen as the timeout is at\nleast a second, but not impossible especially with virtualization.\n\nNo functional change intended\n\nSigned-off-by: Thomas Gleixner <tglx@kernel.org>\nCc: Pablo Neira Ayuso <pablo@netfilter.org>\nCc: Florian Westphal <fw@strlen.de>\nCc: Phil Sutter <phil@nwl.cc>\nCc: netfilter-devel@vger.kernel.org\nCc: coreteam@netfilter.org\n\n---\n net/netfilter/xt_IDLETIMER.c |   24 ++++++++++++++++++------\n 1 file changed, 18 insertions(+), 6 deletions(-)","diff":"--- a/net/netfilter/xt_IDLETIMER.c\n+++ b/net/netfilter/xt_IDLETIMER.c\n@@ -115,6 +115,21 @@ static void idletimer_tg_alarmproc(struc\n \tschedule_work(&timer->work);\n }\n \n+static void idletimer_start_alarm_ktime(struct idletimer_tg *timer, ktime_t timeout)\n+{\n+\t/*\n+\t * The timer should always be queued as @tout it should be least one\n+\t * second, but handle it correctly in any case. Virt will manage!\n+\t */\n+\tif (!alarm_start_timer(&timer->alarm, timeout, true))\n+\t\tschedule_work(&timer->work);\n+}\n+\n+static void idletimer_start_alarm_sec(struct idletimer_tg *timer, unsigned int seconds)\n+{\n+\tidletimer_start_alarm_ktime(timer, ktime_set(seconds, 0));\n+}\n+\n static int idletimer_check_sysfs_name(const char *name, unsigned int size)\n {\n \tint ret;\n@@ -220,12 +235,10 @@ static int idletimer_tg_create_v1(struct\n \tINIT_WORK(&info->timer->work, idletimer_tg_work);\n \n \tif (info->timer->timer_type & XT_IDLETIMER_ALARM) {\n-\t\tktime_t tout;\n \t\talarm_init(&info->timer->alarm, ALARM_BOOTTIME,\n \t\t\t   idletimer_tg_alarmproc);\n \t\tinfo->timer->alarm.data = info->timer;\n-\t\ttout = ktime_set(info->timeout, 0);\n-\t\talarm_start_relative(&info->timer->alarm, tout);\n+\t\tidletimer_start_alarm_sec(info->timer, info->timeout);\n \t} else {\n \t\ttimer_setup(&info->timer->timer, idletimer_tg_expired, 0);\n \t\tmod_timer(&info->timer->timer,\n@@ -271,8 +284,7 @@ static unsigned int idletimer_tg_target_\n \t\t info->label, info->timeout);\n \n \tif (info->timer->timer_type & XT_IDLETIMER_ALARM) {\n-\t\tktime_t tout = ktime_set(info->timeout, 0);\n-\t\talarm_start_relative(&info->timer->alarm, tout);\n+\t\tidletimer_start_alarm_sec(info->timer, info->timeout);\n \t} else {\n \t\tmod_timer(&info->timer->timer,\n \t\t\t\tsecs_to_jiffies(info->timeout) + jiffies);\n@@ -378,7 +390,7 @@ static int idletimer_tg_checkentry_v1(co\n \t\t\tif (ktimespec.tv_sec > 0) {\n \t\t\t\tpr_debug(\"time_expiry_remaining %lld\\n\",\n \t\t\t\t\t ktimespec.tv_sec);\n-\t\t\t\talarm_start_relative(&info->timer->alarm, tout);\n+\t\t\t\tidletimer_start_alarm_ktime(info->timer, tout);\n \t\t\t}\n \t\t} else {\n \t\t\t\tmod_timer(&info->timer->timer,\n","prefixes":["V2","10/11"]}