lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230321144350.GP2234901@hirez.programming.kicks-ass.net>
Date:   Tue, 21 Mar 2023 15:43:50 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Anna-Maria Behnsen <anna-maria@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, John Stultz <jstultz@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Eric Dumazet <edumazet@...gle.com>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Arjan van de Ven <arjan@...radead.org>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Frederic Weisbecker <fweisbec@...il.com>,
        Rik van Riel <riel@...riel.com>
Subject: Re: [PATCH v5 14/18] timer: Check if timers base is handled already

On Wed, Mar 01, 2023 at 03:17:40PM +0100, Anna-Maria Behnsen wrote:
> Due to the conversion of the NOHZ timer placement to a pull at expiry
> time model, the per CPU timer bases with non pinned timers are no
> longer handled only by the local CPU. In case a remote CPU already
> expires the non pinned timers base of the local cpu, nothing more
> needs to be done by the local CPU. A check at the begin of the expire
> timers routine is required, because timer base lock is dropped before
> executing the timer callback function.
> 
> This is a preparatory work, but has no functional impact right now.
> 
> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
> ---
>  kernel/time/timer.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index be085e94afcc..9553da99e262 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -2144,6 +2144,9 @@ static inline void __run_timers(struct timer_base *base)
>  
>  	lockdep_assert_held(&base->lock);
>  
> +	if (!!base->running_timer)
> +		return;

You can leave out the double-negation, 'if (base->running_timer)' is
equivalent and reads much easier.

>  	while (time_after_eq(jiffies, base->clk) &&
>  	       time_after_eq(jiffies, base->next_expiry)) {
>  		levels = collect_expired_timers(base, heads);
> -- 
> 2.30.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ