Re: [PATCH v2] tick/broadcast: Do not set oneshot_mask except was_periodic was true

From: Frederic Weisbecker
Date: Wed May 03 2023 - 18:27:09 EST


On Tue, May 02, 2023 at 02:38:57PM +0200, Thomas Gleixner wrote:
> Updated patch below.
>
> Thanks,

Looks good from my layperson's eyes, just a doubt about a comment below:

> +
> + /*
> + * When switching from periodic to oneshot mode arm the broadcast
> + * device for the next tick.
> + *
> + * If the broadcast device has been replaced in oneshot mode and
> + * the oneshot broadcast mask is not empty, then arm it to expire
> + * immediately in order to reevaluate the next expiring timer.
> + * nexttick is 0 and therefore in the past which will cause the

Is nexttick really in the past? It's set to tick_next_period...

Thanks.

> + * clockevent code to force an event.
> + *
> + * For both cases the programming can be avoided when the oneshot
> + * broadcast mask is empty.
> + *
> + * tick_broadcast_set_event() implicitly switches the broadcast
> + * device to oneshot state.
> + */
> + if (!cpumask_empty(tick_broadcast_oneshot_mask))
> + tick_broadcast_set_event(bc, cpu, nexttick);
> }