mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Schneider <vschneid@redhat.com>
To: Huang Ying <ying.huang@intel.com>, Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, Huang Ying <ying.huang@intel.com>,
	Valentin Schneider <valentin.schneider@arm.com>,
	Ingo Molnar <mingo@redhat.com>, Mel Gorman <mgorman@suse.de>,
	Rik van Riel <riel@surriel.com>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: Re: [PATCH -V2] sched,topology: Update sched topology atomically
Date: Mon, 25 Apr 2022 16:52:33 +0100	[thread overview]
Message-ID: <xhsmh7d7d9n3y.mognet@vschneid.remote.csb> (raw)
In-Reply-To: <20220421003125.195470-1-ying.huang@intel.com>

On 21/04/22 08:31, Huang Ying wrote:
> When Peter Zijlstra reviewed commit 0fb3978b0aac ("sched/numa: Fix
> NUMA topology for systems with CPU-less nodes") [1], he pointed out
> that sched_domains_numa_distance and sched_domains_numa_masks are made
> separate RCU variables.  That could go side-ways if there were a
> function using both, although there isn't for now.
>
> So we update sched_domains_numa_distance and sched_domains_numa_masks
> and some other related sched topology parameters atomically to address
> the potential issues.
>
> [1] https://lkml.kernel.org/r/20220214121553.582248-1-ying.huang@intel.com
>
> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Cc: Valentin Schneider <valentin.schneider@arm.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Rik van Riel <riel@surriel.com>
> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
>
> Changelog:
>
> v2:
>
> - Addressed comments from Valentin Schneider, Thanks!

One small bug and a whitespace nit below, with those fixed:

Reviewed-by: Valentin Schneider <vschneid@redhat.com>

FWIW I briefly tested this vs hotplug on QEMU.

> @@ -1806,8 +1873,7 @@ void sched_init_numa(int offline_node)
>
>                       if (distance < LOCAL_DISTANCE || distance >= NR_DISTANCE_VALUES) {
>                               sched_numa_warn("Invalid distance value range");
> -				bitmap_free(distance_map);
> -				return;
> +                                goto free_bitmap;

The indentation here is wrong (spaces vs tabs).

>                       }
>
>                       bitmap_set(distance_map, distance, 1);

>       /* Compute default topology size */
>       for (i = 0; sched_domain_topology[i].mask; i++);

After the original boot this will now be the default topology with the NUMA
bits on top, so we'll just keep growing the array every time we hotplug a
node. This should use sched_domain_topology_default instead (ditto for the
copy loop further down).


  reply	other threads:[~2022-04-25 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  0:31 Huang Ying
2022-04-25 15:52 ` Valentin Schneider [this message]
2022-04-26  6:43   ` ying.huang

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=xhsmh7d7d9n3y.mognet@vschneid.remote.csb \
    --to=vschneid@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=valentin.schneider@arm.com \
    --cc=ying.huang@intel.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

all inboxes | Powered by JetHome®