From: Frederic Weisbecker <frederic@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peng Liu <liupeng17@lenovo.com>, Ingo Molnar <mingo@kernel.org>,
Anna-Maria Behnsen <anna-maria@linutronix.de>,
Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH 01/15] tick/nohz: Remove duplicate between tick_nohz_switch_to_nohz() and tick_setup_sched_timer()
Date: Thu, 25 Jan 2024 12:57:05 +0100 [thread overview]
Message-ID: <ZbJMkautxpj1sQEJ@lothringen> (raw)
In-Reply-To: <87h6j1kc97.ffs@tglx>
On Thu, Jan 25, 2024 at 10:12:20AM +0100, Thomas Gleixner wrote:
> On Wed, Jan 24 2024 at 18:04, Frederic Weisbecker wrote:
> >
> > /**
> > * tick_setup_sched_timer - setup the tick emulation timer
> > + * @mode: tick_nohz_mode to setup for
> > */
> > -void tick_setup_sched_timer(void)
> > +void tick_setup_sched_timer(int mode)
> > {
> > struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched);
> > - ktime_t now = ktime_get();
> >
> > /* Emulate tick processing via per-CPU hrtimers: */
> > hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD);
> > - ts->sched_timer.function = tick_nohz_highres_handler;
> > +#ifdef CONFIG_HIGH_RES_TIMERS
> > + if (mode == NOHZ_MODE_HIGHRES)
> > + ts->sched_timer.function = tick_nohz_highres_handler;
> > +#endif
>
> Adding
>
> #define tick_nohz_highres_handler NULL
>
> for CONFIG_HIGH_RES_TIMERS=n somewhere allows you to write that as:
>
> if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && mode == NOHZ_MODE_HIGHRES)
> ts->sched_timer.function = tick_nohz_highres_handler;
So the next patch does:
if (mode == NOHZ_MODE_HIGHRES)
ts->sched_timer.function = tick_nohz_highres_handler;
Because that condition only happens in CONFIG_HIGH_RES_TIMERS anyway
and the function field exists in any case.
I can move that to the current patch though.
>
> > + hrtimer_forward_now(&ts->sched_timer, TICK_NSEC);
> > + if (mode == NOHZ_MODE_HIGHRES)
>
> Wants a (IS_ENABLED(HIGRES) && mode == ...) no?
Hmm, indeed hrtimer_start_range_ns() called by hrtimer_start_expires()
is only defined if CONFIG_HIGH_RES_TIMERS=y. I'll resend.
Thanks.
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2024-01-25 11:57 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 17:04 [PATCH 00/15] timers/nohz cleanups and hotplug reorganization Frederic Weisbecker
2024-01-24 17:04 ` [PATCH 01/15] tick/nohz: Remove duplicate between tick_nohz_switch_to_nohz() and tick_setup_sched_timer() Frederic Weisbecker
2024-01-25 9:12 ` Thomas Gleixner
2024-01-25 11:57 ` Frederic Weisbecker [this message]
2024-01-25 13:34 ` Thomas Gleixner
2024-01-25 14:35 ` Frederic Weisbecker
2024-01-24 17:04 ` [PATCH 02/15] tick/nohz: Remove duplicate between lowres and highres handlers Frederic Weisbecker
2024-01-25 9:32 ` Thomas Gleixner
2024-01-25 11:58 ` Frederic Weisbecker
2024-01-25 13:30 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 03/15] tick: Remove useless oneshot ifdeffery Frederic Weisbecker
2024-01-25 9:32 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 04/15] tick: Use IS_ENABLED() whenever possible Frederic Weisbecker
2024-01-25 9:33 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 05/15] tick: s/tick_nohz_stop_sched_tick/tick_nohz_full_stop_tick Frederic Weisbecker
2024-01-25 9:33 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 06/15] tick: No need to clear ts->next_tick again Frederic Weisbecker
2024-01-25 9:33 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 07/15] tick: Start centralizing tick related CPU hotplug operations Frederic Weisbecker
2024-01-25 9:36 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 08/15] tick: Move tick cancellation up to CPUHP_AP_TICK_DYING Frederic Weisbecker
2024-01-25 9:37 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 09/15] tick: Move broadcast " Frederic Weisbecker
2024-01-25 9:38 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 10/15] tick: Assume the tick can't be stopped in NOHZ_MODE_INACTIVE mode Frederic Weisbecker
2024-01-25 9:39 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 11/15] tick: Move got_idle_tick away from common flags Frederic Weisbecker
2024-01-25 9:40 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 12/15] tick: Move individual bit features to debuggable mask accesses Frederic Weisbecker
2024-01-25 9:41 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 13/15] tick: Split nohz and highres features from nohz_mode Frederic Weisbecker
2024-01-25 9:42 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 14/15] tick: Shut down low-res tick from dying CPU Frederic Weisbecker
2024-01-25 9:43 ` Thomas Gleixner
2024-01-24 17:04 ` [PATCH 15/15] tick: Assume timekeeping is correctly handed over upon last offline idle call Frederic Weisbecker
2024-01-25 9:43 ` Thomas Gleixner
-- strict thread matches above, loose matches on Subject: below --
2024-01-31 23:11 [PATCH 00/15 v2] timers/nohz cleanups and hotplug reorganization Frederic Weisbecker
2024-01-31 23:11 ` [PATCH 01/15] tick/nohz: Remove duplicate between tick_nohz_switch_to_nohz() and tick_setup_sched_timer() Frederic Weisbecker
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=ZbJMkautxpj1sQEJ@lothringen \
--to=frederic@kernel.org \
--cc=anna-maria@linutronix.de \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liupeng17@lenovo.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/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