From: Dan Williams <dan.j.williams@intel.com>
To: tglx@linutronix.de, mingo@redhat.com
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
peterz@infradead.org, dave.hansen@linux.intel.com, hch@lst.de,
linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org,
x86@kernel.org
Subject: [PATCH v4 3/6] powerpc/papr_scm: Switch to numa_map_to_online_node()
Date: Tue, 21 Jan 2020 19:04:50 -0800 [thread overview]
Message-ID: <157966229059.2508551.6086588174339773492.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <157966227494.2508551.7206194169374588977.stgit@dwillia2-desk3.amr.corp.intel.com>
Now that the core exports numa_map_to_online_node() switch to that
instead of the locally coded duplicate.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Oliver O'Halloran" <oohall@gmail.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Reported-by: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Link: https://lore.kernel.org/r/157401276263.43284.12616818803654229788.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
arch/powerpc/platforms/pseries/papr_scm.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
index c2ef320ba1bf..057ed703e882 100644
--- a/arch/powerpc/platforms/pseries/papr_scm.c
+++ b/arch/powerpc/platforms/pseries/papr_scm.c
@@ -284,25 +284,6 @@ int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
return 0;
}
-static inline int papr_scm_node(int node)
-{
- int min_dist = INT_MAX, dist;
- int nid, min_node;
-
- if ((node == NUMA_NO_NODE) || node_online(node))
- return node;
-
- min_node = first_online_node;
- for_each_online_node(nid) {
- dist = node_distance(node, nid);
- if (dist < min_dist) {
- min_dist = dist;
- min_node = nid;
- }
- }
- return min_node;
-}
-
static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
{
struct device *dev = &p->pdev->dev;
@@ -347,7 +328,7 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
memset(&ndr_desc, 0, sizeof(ndr_desc));
target_nid = dev_to_node(&p->pdev->dev);
- online_nid = papr_scm_node(target_nid);
+ online_nid = numa_map_to_online_node(target_nid);
ndr_desc.numa_node = online_nid;
ndr_desc.target_node = target_nid;
ndr_desc.res = &p->res;
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
next prev parent reply other threads:[~2020-01-22 3:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 3:04 [PATCH v4 0/6] Memory Hierarchy: Enable target node lookups for reserved memory Dan Williams
2020-01-22 3:04 ` [PATCH v4 1/6] ACPI: NUMA: Up-level "map to online node" functionality Dan Williams
2020-01-22 3:04 ` [PATCH v4 2/6] mm/numa: Skip NUMA_NO_NODE and online nodes in numa_map_to_online_node() Dan Williams
2020-01-22 3:04 ` Dan Williams [this message]
2020-01-22 3:04 ` [PATCH v4 4/6] x86/mm: Introduce CONFIG_KEEP_NUMA Dan Williams
2020-02-13 9:32 ` Ingo Molnar
2020-02-13 21:19 ` Dan Williams
2020-02-13 11:22 ` Thomas Gleixner
2020-02-13 21:21 ` Dan Williams
2020-01-22 3:05 ` [PATCH v4 5/6] x86/numa: Provide a range-to-target_node lookup facility Dan Williams
2020-02-13 9:36 ` Ingo Molnar
2020-02-13 11:37 ` Thomas Gleixner
2020-02-13 21:40 ` Dan Williams
2020-01-22 3:05 ` [PATCH v4 6/6] libnvdimm/e820: Retrieve and populate correct 'target_node' info Dan Williams
2020-02-13 2:28 ` [PATCH v4 0/6] Memory Hierarchy: Enable target node lookups for reserved memory Dan Williams
2020-02-13 9:37 ` Ingo Molnar
2020-02-16 20:00 ` [PATCH v5 " Dan Williams
2020-02-16 20:00 ` [PATCH v5 1/6] ACPI: NUMA: Up-level "map to online node" functionality Dan Williams
2020-02-16 20:00 ` [PATCH v5 2/6] mm/numa: Skip NUMA_NO_NODE and online nodes in numa_map_to_online_node() Dan Williams
2020-02-16 20:00 ` [PATCH v5 3/6] powerpc/papr_scm: Switch to numa_map_to_online_node() Dan Williams
2020-02-16 20:01 ` [PATCH v5 4/6] x86/mm: Introduce CONFIG_NUMA_KEEP_MEMINFO Dan Williams
2020-02-17 8:21 ` Thomas Gleixner
2020-02-16 20:01 ` [PATCH v5 5/6] x86/NUMA: Provide a range-to-target_node lookup facility Dan Williams
2020-02-17 8:22 ` Thomas Gleixner
2020-02-16 20:01 ` [PATCH v5 6/6] libnvdimm/e820: Retrieve and populate correct 'target_node' info Dan Williams
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=157966229059.2508551.6086588174339773492.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=dan.j.williams@intel.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=dave.hansen@linux.intel.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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).