Re: [PATCH v2 2/2] tick/nohz: Remove duplicate between tick_nohz_lowres_handler() and tick_nohz_highres_handler()
From: Frederic Weisbecker
Date: Tue Nov 28 2023 - 16:39:46 EST
Le Tue, Nov 28, 2023 at 05:24:13PM +0800, Peng Liu a écrit :
> From: Peng Liu <liupeng17@xxxxxxxxxx>
>
> tick_nohz_lowres_handler() does the same work as tick_nohz_highres_handler()
> plus the clockevent device reprogramming, so should reuse the latter.
>
> Signed-off-by: Peng Liu <liupeng17@xxxxxxxxxx>
> ---
> Changes in v2:
> - Fix build warning: Function parameter or member 'mode' not described in 'tick_setup_sched_timer'
> - Fix build error: use of undeclared identifier 'tick_nohz_highres_handler'
> - Fix build error: use of undeclared identifier 'sched_skew_tick'
> ---
> kernel/time/tick-sched.c | 28 ++++++----------------------
> 1 file changed, 6 insertions(+), 22 deletions(-)
>
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 96fcf5cb1b49..c2142b38c31d 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -1383,36 +1383,25 @@ void tick_nohz_idle_exit(void)
> local_irq_enable();
> }
>
> +static enum hrtimer_restart tick_nohz_highres_handler(struct hrtimer *timer);
Then please move the entire function in this case. You'll need to move it to
a place where it is available both for CONFIG_NO_HZ_COMMON and
CONFIG_HIGH_RES_TIMERS. Below tick_sched_handle() for example.
Thanks!