From: Valentin Schneider <valentin.schneider@arm.com>
To: Barry Song <song.bao.hua@hisilicon.com>,
vincent.guittot@linaro.org, mgorman@suse.de, mingo@kernel.org,
peterz@infradead.org, dietmar.eggemann@arm.com,
morten.rasmussen@arm.com, linux-kernel@vger.kernel.org
Cc: linuxarm@openeuler.org, xuwei5@huawei.com,
liguozhu@hisilicon.com, tiantao6@hisilicon.com,
wanghuiqiang@huawei.com, prime.zeng@hisilicon.com,
jonathan.cameron@huawei.com, guodong.xu@linaro.org,
Barry Song <song.bao.hua@hisilicon.com>,
Meelis Roos <mroos@linux.ee>
Subject: Re: [PATCH] sched/topology: fix the issue groups don't span domain->span for NUMA diameter > 2
Date: Mon, 01 Feb 2021 18:11:26 +0000 [thread overview]
Message-ID: <jhj7dnr4q0h.mognet@arm.com> (raw)
In-Reply-To: <20210201033830.15040-1-song.bao.hua@hisilicon.com>
Hi,
On 01/02/21 16:38, Barry Song wrote:
> A tricky thing is that we shouldn't use the sgc of the 1st CPU of node2
> for the sched_group generated by grandchild, otherwise, when this cpu
> becomes the balance_cpu of another sched_group of cpus other than node0,
> our sched_group generated by grandchild will access the same sgc with
> the sched_group generated by child of another CPU.
>
> So in init_overlap_sched_group(), sgc's capacity be overwritten:
> build_balance_mask(sd, sg, mask);
> cpu = cpumask_first_and(sched_group_span(sg), mask);
>
> sg->sgc = *per_cpu_ptr(sdd->sgc, cpu);
>
> And WARN_ON_ONCE(!cpumask_equal(group_balance_mask(sg), mask)) will
> also be triggered:
> static void init_overlap_sched_group(struct sched_domain *sd,
> struct sched_group *sg)
> {
> if (atomic_inc_return(&sg->sgc->ref) == 1)
> cpumask_copy(group_balance_mask(sg), mask);
> else
> WARN_ON_ONCE(!cpumask_equal(group_balance_mask(sg), mask));
> }
>
> So here move to use the sgc of the 2nd cpu. For the corner case, if NUMA
> has only one CPU, we will still trigger this WARN_ON_ONCE. But It is
> really unlikely to be a real case for one NUMA to have one CPU only.
>
Well, it's trivial to boot this with QEMU, and it's actually the example
the comment atop that WARN_ONCE() is based on. Also, you could end up with
a single CPU on a node during hotplug operations...
I am not entirely sure whether having more than one CPU per node is a
sufficient condition. I'm starting to *think* it is, but I'm not entirely
convinced yet - and now I need a new notebook.
next prev parent reply other threads:[~2021-02-01 18:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 3:38 [PATCH] sched/topology: fix the issue groups don't span domain->span for NUMA diameter > 2 Barry Song
2021-02-01 5:36 ` kernel test robot
2021-02-01 18:11 ` Valentin Schneider [this message]
2021-02-01 21:49 ` Song Bao Hua (Barry Song)
2021-02-02 15:17 ` Valentin Schneider
2021-02-02 16:48 ` Valentin Schneider
2021-02-03 10:23 ` Song Bao Hua (Barry Song)
2021-02-03 11:42 ` Valentin Schneider
2021-02-03 10:27 ` 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=jhj7dnr4q0h.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