public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: "Song Bao Hua \(Barry Song\)" <song.bao.hua@hisilicon.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: "vincent.guittot\@linaro.org" <vincent.guittot@linaro.org>,
	"mgorman\@suse.de" <mgorman@suse.de>,
	"mingo\@kernel.org" <mingo@kernel.org>,
	"dietmar.eggemann\@arm.com" <dietmar.eggemann@arm.com>,
	"morten.rasmussen\@arm.com" <morten.rasmussen@arm.com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linuxarm\@openeuler.org" <linuxarm@openeuler.org>,
	"xuwei \(O\)" <xuwei5@huawei.com>,
	"Liguozhu \(Kenneth\)" <liguozhu@hisilicon.com>,
	"tiantao \(H\)" <tiantao6@hisilicon.com>,
	wanghuiqiang <wanghuiqiang@huawei.com>,
	"Zengtao \(B\)" <prime.zeng@hisilicon.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	"guodong.xu\@linaro.org" <guodong.xu@linaro.org>,
	Meelis Roos <mroos@linux.ee>
Subject: RE: [Linuxarm]  Re: [PATCH v2] sched/topology: fix the issue groups don't span domain->span for NUMA diameter > 2
Date: Thu, 18 Feb 2021 12:40:53 +0000	[thread overview]
Message-ID: <jhj7dn5sg4q.mognet@arm.com> (raw)
In-Reply-To: <ae3bf4dc465040a4b31e4010fd800408@hisilicon.com>


Hi Barry,

On 18/02/21 09:17, Song Bao Hua (Barry Song) wrote:
> Hi Valentin,
>
> I understand Peter's concern is that the local group has different
> size with remote groups. Is this patch resolving Peter's concern?
> To me, it seems not :-)
>

If you remove the '&& i != cpu' in build_overlap_sched_groups() you get
that, but then you also get some extra warnings :-)

Now yes, should_we_balance() only matters for the local group. However I'm
somewhat wary of messing with the local groups; for one it means you would
have more than one tl now accessing the same sgc->next_update, sgc->{min,
max}capacity, sgc->group_imbalance (as Vincent had pointed out).

By ensuring only remote (i.e. !local) groups are modified (which is what
your patch does), we absolve ourselves of this issue, which is why I prefer
this approach ATM.

> Though I don’t understand why different group sizes will be harmful
> since all groups are calculating avg_load and group_type based on
> their own capacities. Thus, for a smaller group, its capacity would
> be smaller.
>
> Is it because a bigger group has relatively less chance to pull, so
> load balancing will be completed more slowly while small groups have
> high load?
>

Peter's point is that, if at a given tl you have groups that look like

g0: 0-4, g1: 5-6, g2: 7-8

Then g0 is half as likely to pull tasks with load_balance() than g1 or g2
(due to the group size vs should_we_balance())


However, I suppose one "trick" to be aware of here is that since your patch
*doesn't* change the local group, we do have e.g. on CPU0:

[    0.374840]    domain-2: span=0-5 level=NUMA
[    0.375054]     groups: 0:{ span=0-3 cap=4003 }, 4:{ span=4-5 cap=1988 }

*but* on CPU4 we get:

[    0.387019]    domain-2: span=0-1,4-7 level=NUMA
[    0.387211]     groups: 4:{ span=4-7 cap=3984 }, 0:{ span=0-1 cap=2013 }

IOW, at a given tl, all *local* groups have /roughly/ the same size and thus
similar pull probability (it took me writing this mail to see it that
way). So perhaps this is all fine already? 

  reply	other threads:[~2021-02-18 14:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 11:12 [PATCH v2] sched/topology: fix the issue groups don't span domain->span for NUMA diameter > 2 Barry Song
2021-02-03 11:57 ` Meelis Roos
2021-02-03 21:31   ` Song Bao Hua (Barry Song)
2021-02-09 12:55 ` Peter Zijlstra
2021-02-09 20:58   ` Song Bao Hua (Barry Song)
2021-02-10 11:21     ` Peter Zijlstra
2021-02-10 12:27       ` Song Bao Hua (Barry Song)
2021-02-11 19:55       ` Valentin Schneider
2021-02-18  9:17         ` [Linuxarm] " Song Bao Hua (Barry Song)
2021-02-18 12:40           ` Valentin Schneider [this message]
2021-02-18 22:07             ` Song Bao Hua (Barry Song)

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=jhj7dn5sg4q.mognet@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=guodong.xu@linaro.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=mroos@linux.ee \
    --cc=peterz@infradead.org \
    --cc=prime.zeng@hisilicon.com \
    --cc=song.bao.hua@hisilicon.com \
    --cc=tiantao6@hisilicon.com \
    --cc=vincent.guittot@linaro.org \
    --cc=wanghuiqiang@huawei.com \
    --cc=xuwei5@huawei.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