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: <ZTIxbrgYHdTMfhVs@gmail.com>
Date:   Fri, 20 Oct 2023 09:51:10 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     "Joel Fernandes (Google)" <joel@...lfernandes.org>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        Suleiman Souhlal <suleiman@...gle.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        "Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH 2/3] sched/nohz: Update comments about NEWILB_KICK


* Joel Fernandes (Google) <joel@...lfernandes.org> wrote:

> How ILB is triggered without IPIs is cryptic. Out of mercy for future
> code readers, document it in code comments.
> 
> The comments are derived from a discussion with Vincent in a past
> review.
> 
> Cc: Suleiman Souhlal <suleiman@...gle.com>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Frederic Weisbecker <frederic@...nel.org>
> Cc: Paul E. McKenney <paulmck@...nel.org>
> Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
> ---
>  kernel/sched/fair.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 965c30fbbe5c..8e276d12c3cb 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -11959,8 +11959,19 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle)
>  }
>  
>  /*
> - * Check if we need to run the ILB for updating blocked load before entering
> - * idle state.
> + * Check if we need to directly run the ILB for updating blocked load before
> + * entering idle state. Here we run ILB directly without issuing IPIs.
> + *
> + * Note that when this function is called, the tick may not yet be stopped on
> + * this CPU yet. nohz.idle_cpus_mask is updated only when tick is stopped and
> + * cleared on the next busy tick. In other words, nohz.idle_cpus_mask updates
> + * don't align with CPUs enter/exit idle to avoid bottlenecks due to high idle
> + * entry/exit rate (usec). So it is possible that _nohz_idle_balance() is
> + * called from this function on (this) CPU that's not yet in the mask. That's
> + * OK because the goal of nohz_run_idle_balance() is to run ILB only for
> + * updating the blocked load of already idle CPUs without waking up one of
> + * those idle CPUs and outside the preempt disable / irq off phase of the local
> + * cpu about to enter idle, because it can take a long time.

Much appreciated! Feel free to update comments for the entire relevant code 
base, a lot of it has become cryptic and under-documented at best as 
complexity increased ...

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ