Re: [PATCH v2 4.14] sched/fair: Optimize select_idle_cpu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 07, 2021 at 09:58:03PM +0800, Yang Wei wrote:
> From: Cheng Jian <cj.chengjian@xxxxxxxxxx>
> 
> commit 60588bfa223ff675b95f866249f90616613fbe31 upstream.
> 
> select_idle_cpu() will scan the LLC domain for idle CPUs,
> it's always expensive. so the next commit :
> 
>     1ad3aaf3fcd2 ("sched/core: Implement new approach to scale select_idle_cpu()")
> 
> introduces a way to limit how many CPUs we scan.
> 
> But it consume some CPUs out of 'nr' that are not allowed
> for the task and thus waste our attempts. The function
> always return nr_cpumask_bits, and we can't find a CPU
> which our task is allowed to run.
> 
> Cpumask may be too big, similar to select_idle_core(), use
> per_cpu_ptr 'select_idle_mask' to prevent stack overflow.
> 
> Fixes: 1ad3aaf3fcd2 ("sched/core: Implement new approach to scale select_idle_cpu()")
> Signed-off-by: Cheng Jian <cj.chengjian@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Reviewed-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
> Reviewed-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
> Reviewed-by: Valentin Schneider <valentin.schneider@xxxxxxx>
> Link: https://lkml.kernel.org/r/20191213024530.28052-1-cj.chengjian@xxxxxxxxxx
> Signed-off-by: Yang Wei <yang.wei@xxxxxxxxxxxxxxxxx>
> Tested-by: Yang Wei <yang.wei@xxxxxxxxxxxxxxxxx>
> ---
>  kernel/sched/fair.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 

Both now queued up, thanks.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux