{"id":2220427,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2220427/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260407083248.236423400@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":"<20260407083248.236423400@kernel.org>","date":"2026-04-07T08:55:08","name":"[11/12] netfilter: xt_IDLETIMER: Switch to alarmtimer_start()","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"54a683218f1cc6c34c1b9aef4830a4977ab4efda","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/20260407083248.236423400@kernel.org/mbox/","series":[{"id":498944,"url":"http://patchwork.ozlabs.org/api/1.1/series/498944/?format=json","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/patches/2220427/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2220427/checks/","tags":{},"headers":{"Return-Path":"\n <netfilter-devel+bounces-11653-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=MnRZgvEh;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11653-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=\"MnRZgvEh\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 4fqg8Y4tgRz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 18:58:21 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 6DADE306EFC0\n\tfor <incoming@patchwork.ozlabs.org>; Tue,  7 Apr 2026 08:55:25 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 35E323A450A;\n\tTue,  7 Apr 2026 08:55:12 +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 A4F553A1D1C;\n\tTue,  7 Apr 2026 08:55:11 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 9CD27C116C6;\n\tTue,  7 Apr 2026 08:55:10 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775552111; cv=none;\n b=Gdadrk4JjBmLDAefq0kdHIjxddzn2glBjnL5jPmp1PTQLAKs0DCFpF0KIanMWVM8hVkZ+gsUKWaq0NpGDKKKhk/uL4jc7IeceEjAjf5B4fdFT2yY4OcvOtMrQpXOOWOMSHJKSjrsFCU2qY7sbpf3smqIh+zc901+EJFHWU1NpAE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775552111; c=relaxed/simple;\n\tbh=UWMCyKMLfyWDIafgwUqZJttuFVA66S79Y0i2Q6zCV8M=;\n\th=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version:\n\t Content-Type;\n b=touDF2OcvCJmhg6zbEjVuDBHiv6TC22vNQ/YUZ6kCTdEWWGErS+JDNkQHANfEdxSMiRnZdhwfRmckwoA40RcTk5jHhgg/zq6SpfLN0BekH+L6BQdE8w73xcB9exE2S+ajTdYM8NwMdoF0+xFUkKARHJFLwSplNYFardKqc+GetU=","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=MnRZgvEh; 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=1775552111;\n\tbh=UWMCyKMLfyWDIafgwUqZJttuFVA66S79Y0i2Q6zCV8M=;\n\th=Date:From:To:Cc:Subject:References:From;\n\tb=MnRZgvEh1K64MnDUiej8C6cmHlWfJkZ1Eu1rQlC7tXO1zvRibsLF+aem+XObc8Xmd\n\t Tl5p7LFvyPPgk6KKR0zXEGtHrS7lutk0yPYwc89EHFt34lW4piFp/RpDRANLJC7q4d\n\t N0d9V7eR0ao4ZvNmSWplIzPU9xlojU+cB1o0io4uSKL69mnndeOllpApjvNfuzmNhc\n\t uXa93Fc1kXL4Myf0iTPzoCcuRJi2L0wu/laCvqcgVPoideK9mmH+ogTanmz+ovP1mA\n\t /JZqsFNoKIarAT939bBbE9Z5CpDtAVfej49qGk3KjjO8DQh8poDxKkChXe6KjeFTuT\n\t 84RuxSWAE2LIA==","Date":"Tue, 07 Apr 2026 10:55:08 +0200","Message-ID":"<20260407083248.236423400@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 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","Subject":"[patch 11/12] netfilter: xt_IDLETIMER: Switch to alarmtimer_start()","References":"<20260407083219.478203185@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\nalarmtimer_start() 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 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 (!alarmtimer_start(&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@@ -384,7 +396,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":["11/12"]}