Re: [PATCH V3 1/2] tick: Rename tick_do_update_jiffies64() and allow external usage

From: Thomas Gleixner
Date: Wed Aug 23 2023 - 17:32:33 EST


On Sun, Aug 13 2023 at 21:22, Huacai Chen wrote:
> On Sun, Aug 13, 2023 at 10:07 AM Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:
>> For the RCU part, looks fine to me.
>>
>> Another option for the jiffies update part is to just expose a wrapper
>> around the main update function and use that wrapper.
>> That way you do not need to move a lot of code and that keeps git
>> blame intact.
>
> Thank you for your review. But since tick_do_update_jiffies64() is
> static and tick-sched.c itself is conditionally compiled. It seems
> impossible to make a wrapper without touching the original function.

That's just wrong.

tick-sched.o depends on CONFIG_TICK_ONESHOT

do_update_jiffies_64() is only doing anything when

CONFIG_NO_HZ_COMMON=y or CONFIG_HIGH_RES_TIMERS=y

CONFIG_NO_HZ_COMMON selects CONFIG_TICK_ONESHOT
CONFIG_HIGH_RES_TIMERS selects CONFIG_TICK_ONESHOT

So what is that code move solving?

Absolutely nothing, because when CONFIG_TICK_ONESHOT is not set, then
neither CONFIG_NO_HZ_COMMON nor CONFIG_HIGH_RES_TIMERS is set and the
invocation of tick_do_update_jiffies64() is just a NOOP.

So the code stays where it is and all it takes is to remove the static
and to provide a stub inline function for the CONFIG_TICK_ONESHOT=n
case, no?

Thanks,

tglx