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: <ZAoJlEwW/2hX6zlQ@localhost.localdomain>
Date:   Thu, 9 Mar 2023 17:30:12 +0100
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Anna-Maria Behnsen <anna-maria@...utronix.de>
Cc:     linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.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 11/18] timer: Split out "get next timer interrupt"
 functionality

Le Wed, Mar 01, 2023 at 03:17:37PM +0100, Anna-Maria Behnsen a écrit :
> The functionallity for getting the next timer interrupt in
> get_next_timer_interrupt() is splitted into a separate function
> fetch_next_timer_interrupt() to be usable by other callsides.
> 
> This is preparatory work for the conversion of the NOHZ timer
> placement to a pull at expiry time model. No functional change.
> 
> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
[...]
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index ff41d978cb22..dfc744545159 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -2040,31 +2071,9 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
>  		if (time_before(nextevt, basej))
>  			nextevt = basej;
>  		tevt.local = basem + (u64)(nextevt - basej) * TICK_NSEC;
> -		goto unlock;
> +		tevt.global = KTIME_MAX;
>  	}
>  
> -	/*
> -	 * If the bases are marked idle, i.e. the next event on both the
> -	 * local and the global queue are farther away than a tick,
> -	 * evaluate both bases. No need to check whether one of the bases
> -	 * has an already expired timer as this is caught by the !is_idle
> -	 * condition above.
> -	 */
> -	if (base_local->timers_pending)
> -		tevt.local = basem + (u64)(nextevt_local - basej) * TICK_NSEC;
> -
> -	/*
> -	 * If the local queue expires first, then the global event can be
> -	 * ignored. The CPU wakes up before that. If the global queue is
> -	 * empty, nothing to do either.
> -	 */
> -	if (!local_first && base_global->timers_pending)
> -		tevt.global = basem + (u64)(nextevt_global - basej) * TICK_NSEC;
> -
> -unlock:
> -	raw_spin_unlock(&base_global->lock);
> -	raw_spin_unlock(&base_local->lock);
> -
>  	tevt.local = min_t(u64, tevt.local, tevt.global);

So if you leave that last line, it means that the CPU will eventually
and unconditionally wake up for the next global timer if it's before the
next local timer. Am I understanding this right and, if so, is that intended?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ