Re: [PATCH] sched/clock: Init generic clock with CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
From: Zhang Qiao
Date: Wed Jul 30 2025 - 09:21:47 EST
ping...
在 2025/7/23 10:03, Zhang Qiao 写道:
> The sched_clock_timer is used to prevent the sched clock wrapped, this
> timer is initialized in generic_sched_clock_init();
>
> When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y, generic_sched_clock_init() is
> not called and sched_clock_timer is not initialized, causing the
> sched clock to wrap.
>
> To fix this issue, call generic_sched_clock_init() in sched_clock_init()
> to initialize the sched_clock_timer.
>
> Fixes: 5d2a4e91a541 ("sched/clock: Move sched clock initialization and merge with generic clock")
> Reported-by: yuanlulu <yuanlulu4@xxxxxxxxxx>
> Signed-off-by: Zhang Qiao <zhangqiao22@xxxxxxxxxx>
> ---
> kernel/sched/clock.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
> index a09655b481402..13e76cfb59f23 100644
> --- a/kernel/sched/clock.c
> +++ b/kernel/sched/clock.c
> @@ -213,6 +213,7 @@ void __init sched_clock_init(void)
> */
> local_irq_disable();
> __sched_clock_gtod_offset();
> + generic_sched_clock_init();
> local_irq_enable();
>
> static_branch_inc(&sched_clock_running);
>