From: "Li, Aubrey" <aubrey.li@linux.intel.com>
To: Phil Auld <pauld@redhat.com>, Aubrey Li <aubrey.li@intel.com>
Cc: vincent.guittot@linaro.org, mingo@redhat.com,
peterz@infradead.org, juri.lelli@redhat.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de,
linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com,
vpillai@digitalocean.com, joel@joelfernandes.org
Subject: Re: [PATCH] sched/fair: Don't pull task if local group is more loaded than busiest group
Date: Thu, 26 Mar 2020 09:51:47 +0800 [thread overview]
Message-ID: <9272cabe-a777-4e1f-762e-8022f8439c33@linux.intel.com> (raw)
In-Reply-To: <20200325134300.GA30416@lorien.usersys.redhat.com>
On 2020/3/25 21:43, Phil Auld wrote:
> Hi Aubrey,
>
> On Wed, Mar 25, 2020 at 08:46:28PM +0800 Aubrey Li wrote:
>> A huge number of load imbalance was observed when the local group
>> type is group_fully_busy, and the average load of local group is
>> greater than the selected busiest group, so the imbalance calculation
>> returns a negative value actually. Fix this problem by comparing the
>> average load before local group type check.
>>
>> Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
>> ---
>> kernel/sched/fair.c | 14 +++++++-------
>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index c1217bf..c524369 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -8862,17 +8862,17 @@ static struct sched_group *find_busiest_group(struct lb_env *env)
>> goto out_balanced;
>>
>> /*
>> + * If the local group is more loaded than the selected
>> + * busiest group don't try to pull any tasks.
>> + */
>> + if (local->avg_load >= busiest->avg_load)
>> + goto out_balanced;
>> +
>> + /*
>> * When groups are overloaded, use the avg_load to ensure fairness
>> * between tasks.
>> */
>> if (local->group_type == group_overloaded) {
>> - /*
>> - * If the local group is more loaded than the selected
>> - * busiest group don't try to pull any tasks.
>> - */
>> - if (local->avg_load >= busiest->avg_load)
>> - goto out_balanced;
>> -
>> /* XXX broken for overlapping NUMA groups */
>> sds.avg_load = (sds.total_load * SCHED_CAPACITY_SCALE) /
>> sds.total_capacity;
>> --
>> 2.7.4
>>
>
> I'm not sure about this. I think this patch will undo a good bit of the
> benefit of the load balancer rework. Avg_load is really most useful
> when things are overloaded. If we go back to looking at it here we may
> fail to balance when needed.
>
> There are cases where, due to group scheduler load scaling, local average
> may be higher but have spare CPUs still whereas busiest may have extra
> processes which be balanced.
>
In my case, local group is fully busy, and the selected busiest group is overloaded,
should we compute avg_idle for group_fully_busy as well?
Thanks,
-Aubrey
next prev parent reply other threads:[~2020-03-26 1:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 12:46 [PATCH] sched/fair: Don't pull task if local group is more loaded than busiest group Aubrey Li
2020-03-25 13:43 ` Phil Auld
2020-03-26 1:51 ` Li, Aubrey [this message]
2020-03-25 13:58 ` Vincent Guittot
2020-03-26 1:57 ` Li, Aubrey
2020-03-28 13:23 ` [sched/fair] 59901cb452: netperf.Throughput_Mbps -27.3% regression kernel test robot
2020-03-29 4:26 ` Aubrey Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9272cabe-a777-4e1f-762e-8022f8439c33@linux.intel.com \
--to=aubrey.li@linux.intel.com \
--cc=aubrey.li@intel.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=joel@joelfernandes.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=vpillai@digitalocean.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox