[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbJMkautxpj1sQEJ@lothringen>
Date: Thu, 25 Jan 2024 12:57:05 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, Peng Liu <liupeng17@...ovo.com>,
Ingo Molnar <mingo@...nel.org>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [PATCH 01/15] tick/nohz: Remove duplicate between
tick_nohz_switch_to_nohz() and tick_setup_sched_timer()
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
Powered by blists - more mailing lists