From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 56C2B3A962D for ; Tue, 24 Feb 2026 16:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771951076; cv=none; b=bPEip9H7Rb25x3xXQz26j7M0raWQWPn9Z1Qnc38WAPa8Xf7qmCtXkWzHpMQrhU8LC4WXnTxzd5uuRa1YQYO7uWCQHGsIkQ1XzfYib3t/LUTcv2VrkAG6pO/BJLAu4fOtcGP91hJFzuG322XswfApeRsrAkfce87GZ3ALOKxCb+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771951076; c=relaxed/simple; bh=n6xbwpCRaKUAePhEQ8JgtNmndqtwFcxqxuPSccbQ8YE=; h=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=O1A2Ap/Fy1bePtm7yPXMTSSVp7sXwleq5oZfT0EptXgSvbO9aVf3dbHErKbErVh99ZCAbShP2K0aGeWHhQiqkB+xqtjmnGMQ1zUWhermUSDP8GOO5DnwIWWwQNQ9YsMMXAho/aw4wEEMGpmrCNx33Tz679Hi2wfxmtaB05EVaLM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aLtH1wuT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aLtH1wuT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2C61C116D0; Tue, 24 Feb 2026 16:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771951076; bh=n6xbwpCRaKUAePhEQ8JgtNmndqtwFcxqxuPSccbQ8YE=; h=Date:From:To:Cc:Subject:References:From; b=aLtH1wuT1PkcmnCjRmX7G8eQGhGNpD3zvw84PgtLmBT740cYI0liapr/aOaZ1w4HB oxy3t8/x1CLkzT+RFhbYboCOPPHeI9lYzwqDBFEa73qCwpGV55Tn5ZPx9D/PTpocbv 6l3257DDSaTizHBc6DQOx4V5g1cWbiJdsRgbHl7b8XQjKbxO67FaTO2jhRR+vAhl1d Np8EipZCHS0ecxnm+itfjwmQSyn4tf2aKhZyRxvnc2R1CohdtK+KQVIP79bJMHl8YB FUz30iU7R++BP7zm8kRq4OOQ+MSFhTqUpqk7LuLowIfMgDQi5OL63bsqV7TjgwYV0R zzzC4qk0c3Rjg== Date: Tue, 24 Feb 2026 17:37:53 +0100 Message-ID: <20260224163430.935623347@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , John Stultz , Stephen Boyd , Daniel Lezcano , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , x86@kernel.org, Peter Zijlstra , Frederic Weisbecker , Eric Dumazet Subject: [patch 33/48] hrtimer: Rename hrtimer_cpu_base::in_hrtirq to deferred_rearm References: <20260224163022.795809588@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 The upcoming deferred rearming scheme has the same effect as the deferred rearming when the hrtimer interrupt is executing. So it can reuse the in_hrtirq flag, but when it gets deferred beyond the hrtimer interrupt path, then the name does not make sense anymore. Rename it to deferred_rearm upfront to keep the actual functional change separate from the mechanical rename churn. Signed-off-by: Thomas Gleixner --- include/linux/hrtimer_defs.h | 4 ++-- kernel/time/hrtimer.c | 28 +++++++++------------------- 2 files changed, 11 insertions(+), 21 deletions(-) --- a/include/linux/hrtimer_defs.h +++ b/include/linux/hrtimer_defs.h @@ -53,7 +53,7 @@ enum hrtimer_base_type { * @active_bases: Bitfield to mark bases with active timers * @clock_was_set_seq: Sequence counter of clock was set events * @hres_active: State of high resolution mode - * @in_hrtirq: hrtimer_interrupt() is currently executing + * @deferred_rearm: A deferred rearm is pending * @hang_detected: The last hrtimer interrupt detected a hang * @softirq_activated: displays, if the softirq is raised - update of softirq * related settings is not required then. @@ -84,7 +84,7 @@ struct hrtimer_cpu_base { unsigned int active_bases; unsigned int clock_was_set_seq; bool hres_active; - bool in_hrtirq; + bool deferred_rearm; bool hang_detected; bool softirq_activated; bool online; --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -883,11 +883,8 @@ static void hrtimer_reprogram(struct hrt if (expires >= cpu_base->expires_next) return; - /* - * If the hrtimer interrupt is running, then it will reevaluate the - * clock bases and reprogram the clock event device. - */ - if (cpu_base->in_hrtirq) + /* If a deferred rearm is pending skip reprogramming the device */ + if (cpu_base->deferred_rearm) return; cpu_base->next_timer = timer; @@ -921,12 +918,8 @@ static bool update_needs_ipi(struct hrti if (seq == cpu_base->clock_was_set_seq) return false; - /* - * If the remote CPU is currently handling an hrtimer interrupt, it - * will reevaluate the first expiring timer of all clock bases - * before reprogramming. Nothing to do here. - */ - if (cpu_base->in_hrtirq) + /* If a deferred rearm is pending the remote CPU will take care of it */ + if (cpu_base->deferred_rearm) return false; /* @@ -1334,11 +1327,8 @@ static bool __hrtimer_start_range_ns(str first = enqueue_hrtimer(timer, base, mode, was_armed); } - /* - * If the hrtimer interrupt is running, then it will reevaluate the - * clock bases and reprogram the clock event device. - */ - if (cpu_base->in_hrtirq) + /* If a deferred rearm is pending skip reprogramming the device */ + if (cpu_base->deferred_rearm) return false; if (!was_first || cpu_base != this_cpu_base) { @@ -1946,14 +1936,14 @@ static __latent_entropy void hrtimer_run /* * Very similar to hrtimer_force_reprogram(), except it deals with - * in_hrtirq and hang_detected. + * deferred_rearm and hang_detected. */ static void hrtimer_rearm(struct hrtimer_cpu_base *cpu_base, ktime_t now) { ktime_t expires_next = hrtimer_update_next_event(cpu_base); cpu_base->expires_next = expires_next; - cpu_base->in_hrtirq = false; + cpu_base->deferred_rearm = false; if (unlikely(cpu_base->hang_detected)) { /* @@ -1984,7 +1974,7 @@ void hrtimer_interrupt(struct clock_even raw_spin_lock_irqsave(&cpu_base->lock, flags); entry_time = now = hrtimer_update_base(cpu_base); retry: - cpu_base->in_hrtirq = true; + cpu_base->deferred_rearm = true; /* * Set expires_next to KTIME_MAX, which prevents that remote CPUs queue * timers while __hrtimer_run_queues() is expiring the clock bases.