From: David Gibson <david@gibson.dropbear.id.au>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v8 3/5] powerpc/pseries: Consolidate different NUMA distance update code paths
Date: Tue, 17 Aug 2021 13:27:16 +1000 [thread overview]
Message-ID: <YRsslK9jf91T+ly7@yekko> (raw)
In-Reply-To: <20210812132223.225214-4-aneesh.kumar@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1804 bytes --]
On Thu, Aug 12, 2021 at 06:52:21PM +0530, Aneesh Kumar K.V wrote:
> The associativity details of the newly added resourced are collected from
> the hypervisor via "ibm,configure-connector" rtas call. Update the numa
> distance details of the newly added numa node after the above call.
>
> Instead of updating NUMA distance every time we lookup a node id
> from the associativity property, add helpers that can be used
> during boot which does this only once. Also remove the distance
> update from node id lookup helpers.
>
> Currently, we duplicate parsing code for ibm,associativity and
> ibm,associativity-lookup-arrays in the kernel. The associativity array provided
> by these device tree properties are very similar and hence can use
> a helper to parse the node id and numa distance details.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
There are a handful of nits it would be nice to clean up as followups, though:
[snip]
> +static int get_nid_and_numa_distance(struct drmem_lmb *lmb)
> +{
> + struct assoc_arrays aa = { .arrays = NULL };
> + int default_nid = NUMA_NO_NODE;
I don't think there's any point to the 'default_nid' variable.
> + int nid = default_nid;
> + int rc, index;
> +
> + if ((primary_domain_index < 0) || !numa_enabled)
> + return default_nid;
> +
> + rc = of_get_assoc_arrays(&aa);
> + if (rc)
> + return default_nid;
> +
> + if (primary_domain_index <= aa.array_sz &&
You don't need this test any more - it's included in __associativity_to_nid().
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-08-17 3:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 13:22 [PATCH v8 0/5] Add support for FORM2 associativity Aneesh Kumar K.V
2021-08-12 13:22 ` [PATCH v8 1/5] powerpc/pseries: rename min_common_depth to primary_domain_index Aneesh Kumar K.V
2021-08-12 13:22 ` [PATCH v8 2/5] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY Aneesh Kumar K.V
2021-08-12 13:22 ` [PATCH v8 3/5] powerpc/pseries: Consolidate different NUMA distance update code paths Aneesh Kumar K.V
2021-08-17 3:27 ` David Gibson [this message]
2021-08-12 13:22 ` [PATCH v8 4/5] powerpc/pseries: Add a helper for form1 cpu distance Aneesh Kumar K.V
2021-08-12 13:22 ` [PATCH v8 5/5] powerpc/pseries: Add support for FORM2 associativity Aneesh Kumar K.V
2021-08-17 3:40 ` David Gibson
2021-08-18 13:38 ` [PATCH v8 0/5] " Michael Ellerman
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=YRsslK9jf91T+ly7@yekko \
--to=david@gibson.dropbear.id.au \
--cc=aneesh.kumar@linux.ibm.com \
--cc=danielhb413@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nathanl@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).