lkml.org 
[lkml]   [2020]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/10] sched/fair: Clear the target CPU from the cpumask of CPUs searched
    Date
    The target CPU is definitely not idle in both select_idle_core and
    select_idle_cpu. For select_idle_core(), the SMT is potentially
    checked unnecessarily as the core is definitely not idle if the
    target is busy. For select_idle_cpu(), the first CPU checked is
    simply a waste.

    Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
    ---
    kernel/sched/fair.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
    index 68dd9cd62fbd..1d8f5c4b4936 100644
    --- a/kernel/sched/fair.c
    +++ b/kernel/sched/fair.c
    @@ -6077,6 +6077,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int
    return -1;

    cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
    + __cpumask_clear_cpu(target, cpus);

    for_each_cpu_wrap(core, cpus, target) {
    bool idle = true;
    @@ -6181,6 +6182,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
    time = cpu_clock(this);

    cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
    + __cpumask_clear_cpu(target, cpus);

    for_each_cpu_wrap(cpu, cpus, target) {
    schedstat_inc(this_rq()->sis_scanned);
    --
    2.26.2
    \
     
     \ /
      Last update: 2020-12-03 15:15    [W:5.159 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site