[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h6j1kc97.ffs@tglx>
Date: Thu, 25 Jan 2024 10:12:20 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Frederic Weisbecker <frederic@...nel.org>, LKML
<linux-kernel@...r.kernel.org>
Cc: Peng Liu <liupeng17@...ovo.com>, Ingo Molnar <mingo@...nel.org>,
Anna-Maria Behnsen <anna-maria@...utronix.de>, Joel Fernandes
<joel@...lfernandes.org>, Frederic Weisbecker <frederic@...nel.org>
Subject: Re: [PATCH 01/15] tick/nohz: Remove duplicate between
tick_nohz_switch_to_nohz() and tick_setup_sched_timer()
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;
> + hrtimer_forward_now(&ts->sched_timer, TICK_NSEC);
> + if (mode == NOHZ_MODE_HIGHRES)
Wants a (IS_ENABLED(HIGRES) && mode == ...) no?
Thanks,
tglx
Powered by blists - more mailing lists