lkml.org 
[lkml]   [2021]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] sched/fair: bring back select_idle_smt, but differently
On Wed, Apr 07, 2021 at 11:42:17AM +0200, Vincent Guittot wrote:
> I would really prefer to keep that out of select_idle_cpu which aims to merge in one
> single loop the walk through sd_llc. In the case of select_idle_smt, this is done outside
> the loop:

Fair enough.

> @@ -6317,11 +6339,21 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
> }
> }
>
> + if (static_branch_likely(&sched_smt_present)) {
> + smt = test_idle_cores(target, false);
> + if (!smt && cpus_share_cache(prev, target)) {
> + /* No idle core. Check if prev has an idle sibling. */
> + i = select_idle_smt(p, sd, prev);
> + if ((unsigned int)i < nr_cpumask_bits)
> + return i;
> + }
> + }
> +
> sd = rcu_dereference(per_cpu(sd_llc, target));
> if (!sd)
> return target;

It needs to be here, otherwise you're using @sd uninitialized.

> - i = select_idle_cpu(p, sd, target);
> + i = select_idle_cpu(p, sd, smt, target);
> if ((unsigned)i < nr_cpumask_bits)
> return i;

Let me have another poke at it.

\
 
 \ /
  Last update: 2021-04-07 11:57    [W:1.459 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site