From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: arnd@arndb.de, anna-maria@linutronix.de, frederic@kernel.org,
peterz@infradead.org, luto@kernel.org, mingo@redhat.com,
juri.lelli@redhat.com, vincent.guittot@linaro.org,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-kernel@vger.kernel.org, oliver.sang@intel.com
Subject: Re: [PATCH v2 3/6] hrtimer,sched: Add fuzzy hrtimer mode for HRTICK
Date: Mon, 02 Feb 2026 15:02:26 +0100 [thread overview]
Message-ID: <87ecn3fdl9.ffs@tglx> (raw)
In-Reply-To: <20260121162507.757183816@infradead.org>
On Wed, Jan 21 2026 at 17:20, Peter Zijlstra wrote:
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -928,7 +928,8 @@ void hrtick_start(struct rq *rq, u64 del
> static void hrtick_rq_init(struct rq *rq)
> {
> INIT_CSD(&rq->hrtick_csd, __hrtick_start, rq);
> - hrtimer_setup(&rq->hrtick_timer, hrtick, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
> + hrtimer_setup(&rq->hrtick_timer, hrtick, CLOCK_MONOTONIC,
> + HRTIMER_MODE_REL_HARD | HRTIMER_MODE_FUZZY);
SHouldn't this be HRTIMER_MODE_REL_PINNED_HARD? I know it's set when
starting the timer, but I had to double check it.
> }
> #else /* !CONFIG_SCHED_HRTICK: */
> static inline void hrtick_clear(struct rq *rq)
> --- a/kernel/time/hrtimer.c
> +++ b/kernel/time/hrtimer.c
> @@ -1122,7 +1122,7 @@ static void __remove_hrtimer(struct hrti
> * an superfluous call to hrtimer_force_reprogram() on the
> * remote cpu later on if the same timer gets enqueued again.
> */
> - if (reprogram && timer == cpu_base->next_timer)
> + if (!timer->is_fuzzy && reprogram && timer == cpu_base->next_timer)
> hrtimer_force_reprogram(cpu_base, 1);
> }
>
> @@ -1269,6 +1269,19 @@ static int __hrtimer_start_range_ns(stru
> if (new_base->cpu_base->in_hrtirq)
> return 0;
>
> + if (timer->is_fuzzy) {
> + /*
> + * XXX fuzzy implies pinned! not sure how to deal with
> + * retrigger_next_event() for the !local case.
I'd rather say:
Fuzzy requires pinned as the lazy reprogramming only works
for CPU local timers.
> + */
> + WARN_ON_ONCE(!(mode & HRTIMER_MODE_PINNED));
Other than that:
Reviewed-by: Thomas Gleixner <tglx@kernel.org>
Thanks,
tglx
next prev parent reply other threads:[~2026-02-02 14:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 16:20 [PATCH v2 0/6] hrtimer/sched: Improve hrtick Peter Zijlstra
2026-01-21 16:20 ` [PATCH v2 1/6] sched/eevdf: Fix HRTICK duration Peter Zijlstra
2026-01-22 10:53 ` Juri Lelli
2026-02-05 8:38 ` Peter Zijlstra
2026-01-21 16:20 ` [PATCH v2 2/6] hrtimer: Optimize __hrtimer_start_range_ns() Peter Zijlstra
2026-01-22 11:00 ` Juri Lelli
2026-02-02 12:28 ` Thomas Gleixner
2026-01-21 16:20 ` [PATCH v2 3/6] hrtimer,sched: Add fuzzy hrtimer mode for HRTICK Peter Zijlstra
2026-01-22 13:12 ` Juri Lelli
2026-01-23 20:04 ` Steven Rostedt
2026-02-02 14:02 ` Thomas Gleixner [this message]
2026-01-21 16:20 ` [PATCH v2 4/6] hrtimer: Re-arrange hrtimer_interrupt() Peter Zijlstra
2026-02-02 14:05 ` Thomas Gleixner
2026-01-21 16:20 ` [PATCH v2 5/6] entry,hrtimer: Push reprogramming timers into the interrupt return path Peter Zijlstra
2026-01-23 20:08 ` Steven Rostedt
2026-01-23 21:04 ` Peter Zijlstra
2026-02-02 14:37 ` Thomas Gleixner
2026-02-02 16:33 ` Peter Zijlstra
2026-02-02 23:28 ` Thomas Gleixner
2026-02-03 8:14 ` Thomas Gleixner
2026-02-04 13:58 ` Peter Zijlstra
2026-01-21 16:20 ` [PATCH v2 6/6] sched: Default enable HRTICK Peter Zijlstra
2026-01-21 22:24 ` Phil Auld
2026-01-22 11:40 ` Peter Zijlstra
2026-01-22 12:31 ` Phil Auld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ecn3fdl9.ffs@tglx \
--to=tglx@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=arnd@arndb.de \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=frederic@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox