From nobody Sun Jun 14 07:39:55 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 24298425CD6; Fri, 1 May 2026 19:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777664432; cv=none; b=DuNFas4+1ERFkyFIYupYheZrQSxddGLUYcZWNWfkInl/Rs2ipti0eDQCK4E2iDtNRVRe+8sks2tYG3zMvMso+e5U9d2wGovADBK3nE0WZOuU86Zbazl8RPDqiJ10cqt4mryva2hE3nM2RQ/taXTvfBn5sV4rZUDXdmteV2yKVjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777664432; c=relaxed/simple; bh=gVvrMcWOiJ6oh+ME71Cas8S472b1WO36wSjXryyn9fg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=IqeOzS4gsz9d609L5k19DRNohuIb0a3jAUcNe3KFnS6cyevJzDQCICIKISvRWdtSA5rRorrbRQjZNeKt04j1S1PBgJN+cVurllHZV4YUyuRnsluYHKsBGB6K4MlEx9dniM7aeaXO8ZryqurtPUDjEimZR66S1b3Q3J0oguV1PE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dFgn2bI8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HIOtgckz; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dFgn2bI8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HIOtgckz" Date: Fri, 01 May 2026 19:40:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777664428; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4jRGnp+RKjAgR8T42f51s+Fmo8AdOZBACZtV5de2i6E=; b=dFgn2bI84QIYZYRZfCEerQN+IMudYZhdDimJV6sKowaH5fUGRRdF+lgeiUyqXInhGUk5ic V7IKGQWnjY/ZkpnF85XSDrCop3DRrEUzWa2CDvHumGox9B3EQpvunNoLjQeKK+dFeeBagI Z2qiNsl9xrJPenlDdxBXH43T9NIZj+ZGsJr9MsxbbqQmJNRcBBDnuxSSLTjhcy1o2ng+B4 bjlpzTQfcjBJGJN6KEu0sKM3HNSkJQuOWdazmoAv63S/KeYWa1/O4bLicTizVJtsdF6k8D O3kNgTx0v39pHiciTFAG4KmpV1BEnSO5izYmo3XLV6gpwcSWy/BvWju3jZVf9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777664428; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4jRGnp+RKjAgR8T42f51s+Fmo8AdOZBACZtV5de2i6E=; b=HIOtgckzG4lxxnwuO+8/KWkjBSjyq00dlefYjRyfSNw/ZJl94Gol68+3VGGXeW78acNgwC DGbsoYz/XvdTf5CA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] alarmtimer: Convert posix timer functions to alarm_start_timer() Cc: Thomas Gleixner , Frederic Weisbecker , John Stultz , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260408114952.400451460@kernel.org> References: <20260408114952.400451460@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177766442753.3521451.4337860327650659295.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/core branch of tip: Commit-ID: f4b58f61da79032b03d25f8f1a5a697db84a46f3 Gitweb: https://git.kernel.org/tip/f4b58f61da79032b03d25f8f1a5a697db= 84a46f3 Author: Thomas Gleixner AuthorDate: Wed, 08 Apr 2026 13:54:16 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 01 May 2026 21:36:13 +02:00 alarmtimer: Convert posix timer functions to alarm_start_timer() Use the new alarm_start_timer() for arming and rearming posix interval timers and for clock_nanosleep() so that already expired timers do not go through the full timer interrupt cycle. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Acked-by: John Stultz Link: https://patch.msgid.link/20260408114952.400451460@kernel.org --- kernel/time/alarmtimer.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 2348b08..9baa69c 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -560,8 +560,7 @@ static bool alarm_timer_rearm(struct k_itimer *timr) struct alarm *alarm =3D &timr->it.alarm.alarmtimer; =20 timr->it_overrun +=3D alarm_forward_now(alarm, timr->it_interval); - alarm_start(alarm, alarm->node.expires); - return true; + return alarm_start_timer(alarm, alarm->node.expires, false); } =20 /** @@ -625,11 +624,16 @@ static bool alarm_timer_arm(struct k_itimer *timr, kt= ime_t expires, =20 if (!absolute) expires =3D ktime_add_safe(expires, base->get_ktime()); - if (sigev_none) + + /* + * sigev_none needs to update the expires value and pretend + * that the timer is queued + */ + if (sigev_none) { alarm->node.expires =3D expires; - else - alarm_start(&timr->it.alarm.alarmtimer, expires); - return true; + return true; + } + return alarm_start_timer(&timr->it.alarm.alarmtimer, expires, false); } =20 /** @@ -736,7 +740,9 @@ static int alarmtimer_do_nsleep(struct alarm *alarm, kt= ime_t absexp, alarm->data =3D (void *)current; do { set_current_state(TASK_INTERRUPTIBLE); - alarm_start(alarm, absexp); + if (!alarm_start_timer(alarm, absexp, false)) + alarm->data =3D NULL; + if (likely(alarm->data)) schedule(); =20