On Mon, Dec 12, 2016 at 10:35:24PM +0800, Leo Yan wrote:
Hi Morten,
On Mon, Dec 12, 2016 at 02:02:46PM +0000, Morten Rasmussen wrote:
Hi Leo,
On Mon, Dec 12, 2016 at 03:22:05PM +0800, Leo Yan wrote:
For LITTLE cluster "overutilized" flag, it only works after whole system is "overutilized". This is for 6 big tasks case, but for 4 middle tasks case, LITTLE cluster "overutilized" flag doesn't set; so if there have several tasks on LITTLE cluster, we cannot rely on LITTLE cluster "overutilized" flag to spread tasks within LITTLE cluster [6].
I personally think this may not an issue, due we can reply on EAS core algorithm to select best CPU within cluster. So we doesn't rely on "overutilized" flag to spread tasks in LITTLE cluster. And after whole system is "overutilized", then we disable "EAS" path and use SMP traditional load balance. Agree?
For 4 middle-sized tasks the EAS-code should hopefully spread the tasks at wake-up.
If we want to support spreading 4 middle-size tasks, the question is what's the criteria to set "overutilized" flag for LITTLE cluster's sched domain?
The EAS-code at wake-up should be fine as long tasks do regularly wake up, i.e. no task has a utilization approaching or exceeding the computer capacity available. Otherwise, we may need help from the big cluster.
Ideally, the criteria for calling for help (setting the overutilized flag at the root_domain for this RFC patch) should be:
It is not possible to balance the tasks within the cluster such that every cpu has a minimum of spare cycles.
Figuring out the whether it is possible to balance the tasks such that none of them are constrained in term of available cpu cycles isn't easy. Until now we have taken a much more conservative approach by making the criteria: If any cpu is over-utilized. As this is very easy to determine and should cover all the cases covered by the ideal criteria above, although we will call for help in many cases where it isn't necessary.
A half-baked thought:
If we assume that the wake-up EAS-code does a good job, could we set the flag if the wake target cpu ends up being over-utilized? If EAS failed to find enough capacity for the task it must be due to one the following reasons: 1. Because the task is too big to fit the raw capacity offered by the little cpus. 2. The utilization of other tasks leaves too little spare capacity left for the task, and it is not possible to reorganize the task distribution to get sufficient non-fragmented spare capacity. 3. Spare capacity is fragmented, but it would be possible to reorganize the tasks to provide the necessary spare capacity.
1. and 2. should be fine as those are cases where we do need help from the big cluster. 3. is more difficult as while it is theoretically possible to sort things out, it might take a long time to do so, in the meantime one or more tasks will suffer.
It might look like we bring things almost back to where they are, but not quite, as we would still only flag that the little cluster needs help rather than putting the entire system into over-utilization mode.
The RFC-patch already raises the flag for the little cluster if just one cpu is over-utilized, but it doesn't set it on the root_domain, so balancing will only be enabled within the little cluster. If we raise at the root_domain as well, it should work. No?
As I said, it is just a thought.
I'm more concerned about big tasks on the little cluster as those would only be migrated by the 'misfit'-code. IIUC, in case we have n_big_tasks < n_little_cpus currently scheduled on the little cluster, 'overutilized' won't be set at the root_domain and hence the big cluster won't try to pull any of the big tasks.
Correct, please see the ramp up task case in my another email: after the task become a 'misfit' task, the root domain's flag doesn't set. So should refine for this part.
Agreed.
Thanks, Morten IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.