[PATCH v8 07/10] sched: replace capacity_factor by usage
vincent.guittot at linaro.org
Mon Nov 3 02:59:12 PST 2014
On 3 November 2014 08:01, Wanpeng Li <kernellwp at gmail.com> wrote:
> Hi Vincent,
> On 14/10/31 下午4:47, Vincent Guittot wrote:
>> The scheduler tries to compute how many tasks a group of CPUs can handle
>> assuming that a task's load is SCHED_LOAD_SCALE and a CPU's capacity is
>> SCHED_CAPACITY_SCALE. group_capacity_factor divides the capacity of the
>> by SCHED_LOAD_SCALE to estimate how many task can run in the group. Then,
>> compares this value with the sum of nr_running to decide if the group is
>> overloaded or not. But the group_capacity_factor is hardly working for SMT
>> system, it sometimes works for big cores but fails to do the right thing
>> little cores.
>> Below are two examples to illustrate the problem that this patch solves:
>> 1- If the original capacity of a CPU is less than SCHED_CAPACITY_SCALE
>> (640 as an example), a group of 3 CPUS will have a max capacity_factor of
>> (div_round_closest(3x640/1024) = 2) which means that it will be seen as
>> overloaded even if we have only one task per CPU.
>> 2 - If the original capacity of a CPU is greater than SCHED_CAPACITY_SCALE
>> (1512 as an example), a group of 4 CPUs will have a capacity_factor of 4
>> (at max and thanks to the fix  for SMT system that prevent the
> What's the story of 'fix  for SMT system' here?
The  url has disappeared. please find it below:
Let me know if your need more explanation than my answer of your
previous question for the cover letter
> Wanpeng Li
>> of ghost CPUs) but if one CPU is fully used by rt tasks (and its capacity
>> reduced to nearly nothing), the capacity factor of the group will still be
>> (div_round_closest(3*1512/1024) = 5 which is cap to 4 with ).
More information about the linux-arm-kernel