[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240418152308.GA20625@redhat.com>
Date: Thu, 18 Apr 2024 17:23:08 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>,
John Stultz <jstultz@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Stephen Boyd <sboyd@...nel.org>,
Eric Biederman <ebiederm@...ssion.com>
Subject: Re: [patch V2 25/50] signal: Confine POSIX_TIMERS properly
On 04/11, Thomas Gleixner wrote:
>
> Move the itimer rearming out of the signal code and consolidate all posix
> timer related functions in the signal code under one ifdef.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> include/linux/posix-timers.h | 5 +
> kernel/signal.c | 125 +++++++++++++++----------------------------
> kernel/time/itimer.c | 22 +++++++
> kernel/time/posix-timers.c | 15 ++++-
> 4 files changed, 82 insertions(+), 85 deletions(-)
Reviewed-by: Oleg Nesterov <oleg@...hat.com>
A minor nit below...
> --- a/include/linux/posix-timers.h
> +++ b/include/linux/posix-timers.h
..
> +static inline void posixtimer_rearm_itimer(struct task_struct *p) { }
> +static inline void posixtimer_rearm(struct kernel_siginfo *info) { }
Do we really need these 2 nops ? please see below.
..
> + if (unlikely(signr == SIGALRM))
> + posixtimer_rearm_itimer(tsk);
..
> + if (IS_ENABLED(CONFIG_POSIX_TIMERS)) {
> + if (unlikely(resched_timer))
> + posixtimer_rearm(info);
> }
This looks a bit inconsistent to me.
Can't we change the callsite of posixtimer_rearm_itimer() to check
IS_ENABLED(CONFIG_POSIX_TIMERS) too,
if (IS_ENABLED(CONFIG_POSIX_TIMERS)) {
if (unlikely(signr == SIGALRM))
posixtimer_rearm_itimer(tsk);
}
?
This will make the code more symmetrical, and we can avoid the dumb
definitions of posixtimer_rearm_itimer/posixtimer_rearm.
Oleg.
Powered by blists - more mailing lists