linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org,
	vincent.guittot@linaro.org, morten.rasmussen@arm.com,
	mgorman@suse.de, song.bao.hua@hisilicon.com
Subject: Re: [PATCH 1/1] sched/topology: Make sched_init_numa() use a set for the deduplicating sort
Date: Mon, 01 Feb 2021 11:55:30 +0000	[thread overview]
Message-ID: <jhj1re00zpp.mognet@arm.com> (raw)
In-Reply-To: <6000e39e-7d28-c360-9cd6-8798fd22a9bf@arm.com>

On 01/02/21 10:53, Dietmar Eggemann wrote:
> On 22/01/2021 13:39, Valentin Schneider wrote:
>
> [...]
>
>> @@ -1705,7 +1702,7 @@ void sched_init_numa(void)
>>      /* Compute default topology size */
>>      for (i = 0; sched_domain_topology[i].mask; i++);
>>
>> -	tl = kzalloc((i + level + 1) *
>> +	tl = kzalloc((i + nr_levels) *
>>                      sizeof(struct sched_domain_topology_level), GFP_KERNEL);
>>      if (!tl)
>>              return;
>
> This hunk creates issues during startup on my Arm64 juno board on tip/sched/core.
>
> ---8<---
>
> From: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Date: Mon, 1 Feb 2021 09:58:04 +0100
> Subject: [PATCH] sched/topology: Fix sched_domain_topology_level alloc in
>  sched_init_numa
>
> Commit "sched/topology: Make sched_init_numa() use a set for the
> deduplicating sort" allocates 'i + nr_levels (level)' instead of
> 'i + nr_levels + 1' sched_domain_topology_level.
>
> This led to an Oops (on Arm64 juno with CONFIG_SCHED_DEBUG):
>
> sched_init_domains
>   build_sched_domains()
>     __free_domain_allocs()
>       __sdt_free() {
>       ...
>         for_each_sd_topology(tl)
>         ...
>           sd = *per_cpu_ptr(sdd->sd, j); <--
>         ...
>       }
>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

Damn, I forgot the topology level stuff must terminate in a NULL'd
sentinel! Vincent fixed the same thing a few years ago...

  c515db8cd311 ("sched/numa: Fix initialization of sched_domain_topology for NUMA")

Thanks for fixing up my mistake, I ought to have tested !NUMA setups.

  parent reply	other threads:[~2021-02-01 11:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 12:39 [PATCH 0/1] sched/topology: NUMA distance deduplication Valentin Schneider
2021-01-22 12:39 ` [PATCH 1/1] sched/topology: Make sched_init_numa() use a set for the deduplicating sort Valentin Schneider
2021-01-25  2:23   ` Song Bao Hua (Barry Song)
2021-01-25  9:26     ` Valentin Schneider
2021-01-25 16:45       ` Valentin Schneider
2021-01-25 21:35         ` Song Bao Hua (Barry Song)
2021-01-28 14:47           ` Valentin Schneider
2021-01-29  2:02             ` Song Bao Hua (Barry Song)
2021-02-01 12:03               ` Valentin Schneider
2021-02-01  9:53   ` Dietmar Eggemann
2021-02-01 10:19     ` Vincent Guittot
2021-02-01 10:35     ` Song Bao Hua (Barry Song)
2021-02-01 11:55     ` Valentin Schneider [this message]
2021-02-02 10:03     ` [tip: sched/core] sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa() tip-bot2 for Dietmar Eggemann
2021-02-17 13:17     ` tip-bot2 for Dietmar Eggemann

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=jhj1re00zpp.mognet@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=vincent.guittot@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).