Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634398 > unrolled thread

[PATCH V2 0/3] Refine numa_emulation

Started byWei Yang <richard.weiyang@gmail.com>
First post2017-05-02 15:10 +0200
Last post2017-05-02 15:10 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH V2 0/3] Refine numa_emulation Wei Yang <richard.weiyang@gmail.com> - 2017-05-02 15:10 +0200
    [PATCH V2 3/3] x86/numa_emulation: restructures numa_nodes_parsed from emulated nodes Wei Yang <richard.weiyang@gmail.com> - 2017-05-02 15:10 +0200

#1634398 — [PATCH V2 0/3] Refine numa_emulation

FromWei Yang <richard.weiyang@gmail.com>
Date2017-05-02 15:10 +0200
Subject[PATCH V2 0/3] Refine numa_emulation
Message-ID<tCFJ0-77a-21@gated-at.bofh.it>
My previous patch "x86/mm/numa: Remove numa_nodemask_from_meminfo()" hits a
problem in numa_emulation. The reason is numa_nodes_parsed is not set
correctly after emulation.

This patch set tries to fix this and also with two code refine.

Detailed discussions are in this thread:

    https://lkml.org/lkml/2017/3/13/1230

and test result is posted :

    https://lkml.org/lkml/2017/4/10/641

V2:
    * refresh the change log based on David comments
    * use nodes_clear()

Wei Yang (3):
  x86/numa_emulation: fix potential memory leak
  x86/numa_emulation: assign physnode_mask directly from
    numa_nodes_parsed
  x86/numa_emulation: restructures numa_nodes_parsed from emulated nodes

 arch/x86/mm/numa_emulation.c | 61 ++++++++++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 28 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1634401 — [PATCH V2 3/3] x86/numa_emulation: restructures numa_nodes_parsed from emulated nodes

FromWei Yang <richard.weiyang@gmail.com>
Date2017-05-02 15:10 +0200
Subject[PATCH V2 3/3] x86/numa_emulation: restructures numa_nodes_parsed from emulated nodes
Message-ID<tCFJ0-77a-43@gated-at.bofh.it>
In reply to#1634398
By emulating numa, it may contains more or less nodes than physical nodes.
In numa_emulation(), numa_meminfo/numa_distance/__apicid_to_node is
restructured according to emulated nodes, except numa_nodes_parsed.

This patch restructures numa_nodes_parsed from emulated nodes.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>

---
v2: use nodes_clear(numa_nodes_parsedd);
---
 arch/x86/mm/numa_emulation.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c
index a6d01931b9a1..6e5ccbfc3deb 100644
--- a/arch/x86/mm/numa_emulation.c
+++ b/arch/x86/mm/numa_emulation.c
@@ -391,6 +391,13 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
 	/* commit */
 	*numa_meminfo = ei;
 
+	/* Make sure numa_nodes_parsed only contains emulated nodes */
+	nodes_clear(numa_nodes_parsed);
+	for (i = 0; i < ARRAY_SIZE(ei.blk); i++)
+		if (ei.blk[i].start != ei.blk[i].end &&
+		    ei.blk[i].nid != NUMA_NO_NODE)
+			node_set(ei.blk[i].nid, numa_nodes_parsed);
+
 	/*
 	 * Transform __apicid_to_node table to use emulated nids by
 	 * reverse-mapping phys_nid.  The maps should always exist but fall
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web