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: <87wmtsdfcx.fsf@somnus>
Date:   Tue, 05 Dec 2023 13:05:18 +0100
From:   Anna-Maria Behnsen <anna-maria@...utronix.de>
To:     Sebastian Siewior <bigeasy@...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 <frederic@...nel.org>,
        Rik van Riel <riel@...riel.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Giovanni Gherdovich <ggherdovich@...e.cz>,
        Lukasz Luba <lukasz.luba@....com>,
        "Gautham R . Shenoy" <gautham.shenoy@....com>,
        Srinivas Pandruvada <srinivas.pandruvada@...el.com>,
        K Prateek Nayak <kprateek.nayak@....com>
Subject: Re: [PATCH v9 16/32] timers: Optimization for
 timer_base_try_to_set_idle()

Sebastian Siewior <bigeasy@...utronix.de> writes:

> On 2023-12-01 10:26:38 [+0100], Anna-Maria Behnsen wrote:
>> When tick is stopped also the timer base is_idle flag is set. When
>> reentering the timer_base_try_to_set_idle() with the tick stopped, there is
>> no need to check whether the timer base needs to be set idle again. When a
>> timer was enqueued in the meantime, this is already handled by the
>> nohz_get_next_event() call which was executed before tick_nohz_stop_tick().
>
> as of #15 tick_stopped is set later in tick_nohz_stop_tick() and both
> (tick_sched::tick_stopped and timer_base::is_idle) are cleared in
> tick_nohz_restart_sched_tick().
>
> Then we have tick_nohz_idle_retain_tick() with only one caller and is
> only clearing timer_base::is_idle. Now, wouldn't it make sense to
> preload timer_idle based on timer_base::is_idle?

When revisting the code, this timer_clear_idle() is no longer required
in tick_nohz_idle_retain_tick(). This is only called when the tick is
not stopped - so timer base is not idle as well and this call is
superfluous.

As we keep both states in sync (tick_sched::tick_stopped and
timer_base::is_idle) it doesn't matter which one is used. In
tick_nohz_stop_tick() I don't have access to timer base. I could add it
to timer_base_try_to_set_idle() but it will not make a difference.

> I don't know if it there is a different outcome if timer_base::is_idle
> gets cleared in the idle path vs tick_sched::tick_stopped.
> I can't find nohz_get_next_event().

s/nohz_get_next_event/tick_nohz_next_event/ ...

>> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
>
> Sebastian

Thanks,

	Anna-Maria

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ