lkml.org 
[lkml]   [2017]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] sched: Actual changes after adding SCHED_SOFT_AFFINITY to make it work with the scheduler
On Tue, Sep 19, 2017 at 03:37:12PM -0700, Rohit Jain wrote:
> @@ -6019,7 +6040,8 @@ void __update_idle_core(struct rq *rq)
> static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int target)
> {
> struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
> + struct cpumask *pcpus = this_cpu_cpumask_var_ptr(select_idle_mask);

This is broken... they're the exact _same_ variable.

> + int core;
>
> if (!static_branch_likely(&sched_smt_present))
> return -1;
> @@ -6028,20 +6050,21 @@ 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_allowed);
> + cpumask_and(pcpus, cpus, &p->cpus_preferred);
> + core = scan_cpu_mask_for_idle_cores(pcpus, target);
>
> + if (core >= 0)
> + return core;
>
> + if (cpumask_equal(cpus, pcpus))
> + goto out;

Therefore this _must_ be true.


Also, you're touching one of the hottest paths in the whole scheduler
for this half arsed feature, not going to happen.

You further failed to teach the actual load-balancer of this new mask,
so it will still happily move tasks around.

\
 
 \ /
  Last update: 2017-09-21 19:31    [W:0.378 / U:3.384 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site