Re: [PATCH 7/7] posix-cpu-timers: Recalc next expiration when timer_settime() ends up not queueing

From: Peter Zijlstra
Date: Mon Jun 28 2021 - 11:58:44 EST


On Wed, Jun 23, 2021 at 01:41:55AM +0200, Frederic Weisbecker wrote:
> include/linux/posix-timers.h | 7 +++++-
> kernel/time/posix-cpu-timers.c | 41 +++++++++++++++++++++++++++++-----
> 2 files changed, 41 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
> index 4cf1fbe8d1bc..00fef0064355 100644
> --- a/include/linux/posix-timers.h
> +++ b/include/linux/posix-timers.h
> @@ -82,9 +82,14 @@ static inline bool cpu_timer_enqueue(struct timerqueue_head *head,
> return timerqueue_add(head, &ctmr->node);
> }
>
> +static inline bool cpu_timer_queued(struct cpu_timer *ctmr)
> +{
> + return !!ctmr->head;

Sad that we can't check sighand lock here... but I agree that adding
that will be messy :/

> +}