Re: smpnice loadbalancing with high priority tasks

From: Peter Williams
Date: Tue Apr 04 2006 - 00:35:00 EST


Peter Williams wrote:
Siddha, Suresh B wrote:
c) DP system: if the cpu-0 has two high priority and cpu-1 has one normal
priority task, how can the current code detect this imbalance..
How would it not?

imbalance will be always < busiest_load_per_task and
max_load - this_load will be < 2 * busiest_load_per_task...
and pwr_move will be <= pwr_now...

I had thought about substituting (busiest_load_per_task + this_load_per_task) for (busiest_load_per_task * 2) but couldn't convince myself that it was the right thing to do. (The final update to this_load_per_task would need to be moved.) The reason I couldn't convince myself is that I thought it might be too aggressive and cause excessive balancing. Maybe something more sophisticated is needed to prevent that possibility. It should be noted that the relative sizes of busiest_load_per_task and this_load_per_task my be useful in deciding what to do in these cases. I'll put some thought into that.

How does this bit of code look?

if (busiest_load_per_task > this_load_per_task) {
if (max_load - this_load > busiest_load_per_task) {
*imbalance = busiest_load_per_task;
return busiest;
}
} else if (max_load - this_load >= busiest_load_per_task*2) {
*imbalance = busiest_load_per_task;
return busiest;
}

My maths indicate this will work even in cases when the difference between the two load per task values is small. By "work" I mean that it will one of the high priority tasks and it won't bounce back. Do you agree?

The actual patch would be a little neater than this, of course.

Peter
--
Peter Williams pwil3058@xxxxxxxxxxxxxx

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/