On 02/18/2014 07:50 PM, Morten Rasmussen wrote:
- this_load = target_load(this_cpu);
- this_load = target_load(this_cpu, bias);
It seems that you now apply the bias to both sides of the comparison. The above should be:
this_load = target_load(this_cpu, 100);
to make sense.
It do has some confusing meaning of wake_affine.
From reduce cpu cache miss point, I understand it prefer the prev cpu,
so it make this_cpu load a bit heavier than fact.
But in just the following eff_load computing, it set bit heavier of prev cpu: prev_eff_load = bias, while no bias on this_eff_load. That is a bit confusing. Anyone like to explain this?
this_eff_load *= this_load + effective_load(tg, this_cpu, weight, weight);
prev_eff_load = 100 + (sd->imbalance_pct - 100) / 2;
prev_eff_load *= power_of(this_cpu); prev_eff_load *= load + effective_load(tg, prev_cpu, 0, weight);prev_eff_load = bias;
@@ -4247,7 +4253,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) if (balanced || (this_load <= load &&
this_load + target_load(prev_cpu) <= tl_per_task)) {
this_load + target_load(prev_cpu, sd->imbalance_pct)
I think it should be target_load(prev_cpu, 100) here instead. IIUC, it is an unbiased comparison.
If we want to reduce cache miss, we needs to prefer prev cpu. From this point, guess it is right.