From nobody Sat Apr 18 09:33:08 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 4FC4F47D924; Sat, 28 Feb 2026 15:36:21 +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=1772292982; cv=none; b=Hh4BPBbMe/0zdN3aj5tHkyAlaDMmBbviOumdkRccgTpXaynVZCic5aVBpGk3VauJiXOCSHOWTnApG9ycy8VBsAD5IKhh58wcE+m8EVPbJlvPGmHL6gyYE5TYcVCArzo3KV2WRvg+VFOIimf8GUjK6BCPsYRh4cXETqJzz2Fut7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772292982; c=relaxed/simple; bh=wI6uis0nxSG3KYaMIPJG3eu2T2OBMajO3EBM4BwPCvg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Mu3+jmgwT9hBFBkqPWMRqtUQpKGh/WbiPIPHO+uJEl+dxPMiH46f5wMYEOIxeBL+fa2Fws2EPj1iUjNA66RlS8KXmkWjZNehWJwI0WvFExMfpKguGSrYNoptMF93QFnpqedHmMm5MuwbwFMoJDfduN8hxrlaK3l4QaZ47D8fCu4= 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=cNfZwJRm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=S2T2zq1u; 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="cNfZwJRm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="S2T2zq1u" Date: Sat, 28 Feb 2026 15:36:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772292979; 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=s2QIzvgNmWekuQXwpXbtmOBthiVvkq3EUYOwRT0dcX0=; b=cNfZwJRmYqK5ugBfdUrsyHvwq5ZW19YglPnL3Z8oREs14eTkQIlOd2gRSkKjvzvuRjGNW2 sj9kWZWQG+j3s55HPxGz+REHtBd/2Mv6u940KeVaDzfdCFuF8Gr5+GQiQM2rzuNqoN6V3A /sJBNhdZpMuHiCKODD2QbTdDrL3PSoVUj6ARb2zzUS8jR4pzq6QWG4xTFp+EVtPP6/rmOR hav8+VBCkMi9kxNGv4HsugFemlVUFWe9lSHGqaCv+0HW/3+PqEvkKKgKaOfSUDEO0hM9lj l8zsk2sia0g2GF9cv41LfI1RrrDemUdSbIQOAkGQYuckEL8dYNUshpjeM1czRg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772292979; 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=s2QIzvgNmWekuQXwpXbtmOBthiVvkq3EUYOwRT0dcX0=; b=S2T2zq1u7nrrOR2YbXe3QckWQXYZbNe/1ZJwVEpFMoXMtxUF3jDKSpLBrcVQt7j8JNLQDp gN+oE3nY+JSMfcDA== 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: sched/hrtick] hrtimer: Simplify run_hrtimer_queues() Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260224163431.532927977@kernel.org> References: <20260224163431.532927977@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177229297854.1647592.9990802234060463418.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 sched/hrtick branch of tip: Commit-ID: a64ad57e41c7e3daadbc2c1bc252d9a90c87222f Gitweb: https://git.kernel.org/tip/a64ad57e41c7e3daadbc2c1bc252d9a90= c87222f Author: Thomas Gleixner AuthorDate: Tue, 24 Feb 2026 17:38:37 +01:00 Committer: Peter Zijlstra CommitterDate: Fri, 27 Feb 2026 16:40:15 +01:00 hrtimer: Simplify run_hrtimer_queues() Replace the open coded container_of() orgy with a trivial clock_base_next_timer() helper. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260224163431.532927977@kernel.org --- kernel/time/hrtimer.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index aa1cb4f..b0e7e29 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1933,6 +1933,13 @@ static void __run_hrtimer(struct hrtimer_cpu_base *c= pu_base, struct hrtimer_cloc base->running =3D NULL; } =20 +static __always_inline struct hrtimer *clock_base_next_timer_safe(struct h= rtimer_clock_base *base) +{ + struct timerqueue_node *next =3D timerqueue_getnext(&base->active); + + return next ? container_of(next, struct hrtimer, node) : NULL; +} + static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_= t now, unsigned long flags, unsigned int active_mask) { @@ -1940,16 +1947,10 @@ static void __hrtimer_run_queues(struct hrtimer_cpu= _base *cpu_base, ktime_t now, struct hrtimer_clock_base *base; =20 for_each_active_base(base, cpu_base, active) { - struct timerqueue_node *node; - ktime_t basenow; - - basenow =3D ktime_add(now, base->offset); - - while ((node =3D timerqueue_getnext(&base->active))) { - struct hrtimer *timer; - - timer =3D container_of(node, struct hrtimer, node); + ktime_t basenow =3D ktime_add(now, base->offset); + struct hrtimer *timer; =20 + while ((timer =3D clock_base_next_timer(base))) { /* * The immediate goal for using the softexpires is * minimizing wakeups, not running timers at the