* [PATCH v6 08/14] arm64: numa: Use pr_fmt()
[not found] ` <1470908028-8596-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2016-08-11 9:33 ` Zhen Lei
2016-08-11 9:33 ` [PATCH v6 09/14] arm64/numa: support HAVE_SETUP_PER_CPU_AREA Zhen Lei
` (4 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Zhen Lei @ 2016-08-11 9:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Rob Herring, Frank Rowand, devicetree
Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Zhen Lei
From: Kefeng Wang <wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Use pr_fmt to prefix kernel output, and remove duplicated msg
of NUMA turned off.
Signed-off-by: Kefeng Wang <wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/arm64/mm/numa.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index fe26ed9..0a159d3 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#define pr_fmt(fmt) "numa: " fmt
+
#include <linux/acpi.h>
#include <linux/bootmem.h>
#include <linux/memblock.h>
@@ -36,10 +38,9 @@ static __init int numa_parse_early_param(char *opt)
{
if (!opt)
return -EINVAL;
- if (!strncmp(opt, "off", 3)) {
- pr_info("%s\n", "NUMA turned off");
+ if (!strncmp(opt, "off", 3))
numa_off = true;
- }
+
return 0;
}
early_param("numa", numa_parse_early_param);
@@ -108,7 +109,7 @@ static void __init setup_node_to_cpumask_map(void)
set_cpu_numa_node(cpu, NUMA_NO_NODE);
/* cpumask_of_node() will now work */
- pr_debug("NUMA: Node to cpumask map for %d nodes\n", nr_node_ids);
+ pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids);
}
/*
@@ -143,13 +144,13 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
ret = memblock_set_node(start, (end - start), &memblock.memory, nid);
if (ret < 0) {
- pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n",
+ pr_err("memblock [0x%llx - 0x%llx] failed to add on node %d\n",
start, (end - 1), nid);
return ret;
}
node_set(nid, numa_nodes_parsed);
- pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n",
+ pr_info("Adding memblock [0x%llx - 0x%llx] on node %d\n",
start, (end - 1), nid);
return ret;
}
@@ -164,19 +165,18 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
void *nd;
int tnid;
- pr_info("NUMA: Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
- nid, start_pfn << PAGE_SHIFT,
- (end_pfn << PAGE_SHIFT) - 1);
+ pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
+ nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
nd = __va(nd_pa);
/* report and initialize */
- pr_info("NUMA: NODE_DATA [mem %#010Lx-%#010Lx]\n",
+ pr_info(" NODE_DATA [mem %#010Lx-%#010Lx]\n",
nd_pa, nd_pa + nd_size - 1);
tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
if (tnid != nid)
- pr_info("NUMA: NODE_DATA(%d) on node %d\n", nid, tnid);
+ pr_info(" NODE_DATA(%d) on node %d\n", nid, tnid);
node_data[nid] = nd;
memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
@@ -233,8 +233,7 @@ static int __init numa_alloc_distance(void)
numa_distance[i * numa_distance_cnt + j] = i == j ?
LOCAL_DISTANCE : REMOTE_DISTANCE;
- pr_debug("NUMA: Initialized distance table, cnt=%d\n",
- numa_distance_cnt);
+ pr_debug("Initialized distance table, cnt=%d\n", numa_distance_cnt);
return 0;
}
@@ -255,20 +254,20 @@ static int __init numa_alloc_distance(void)
void __init numa_set_distance(int from, int to, int distance)
{
if (!numa_distance) {
- pr_warn_once("NUMA: Warning: distance table not allocated yet\n");
+ pr_warn_once("Warning: distance table not allocated yet\n");
return;
}
if (from >= numa_distance_cnt || to >= numa_distance_cnt ||
from < 0 || to < 0) {
- pr_warn_once("NUMA: Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
+ pr_warn_once("Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
from, to, distance);
return;
}
if ((u8)distance != distance ||
(from == to && distance != LOCAL_DISTANCE)) {
- pr_warn_once("NUMA: Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
+ pr_warn_once("Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
from, to, distance);
return;
}
@@ -295,7 +294,7 @@ static int __init numa_register_nodes(void)
/* Check that valid nid is set to memblks */
for_each_memblock(memory, mblk)
if (mblk->nid == NUMA_NO_NODE || mblk->nid >= MAX_NUMNODES) {
- pr_warn("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
+ pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
mblk->nid, mblk->base,
mblk->base + mblk->size - 1);
return -EINVAL;
@@ -366,9 +365,10 @@ static int __init dummy_numa_init(void)
struct memblock_region *mblk;
if (numa_off)
- pr_info("NUMA disabled\n"); /* Forced off on command line. */
- pr_info("NUMA: Faking a node at [mem %#018Lx-%#018Lx]\n",
- 0LLU, PFN_PHYS(max_pfn) - 1);
+ pr_warn("NUMA turned off by user\n"); /* Forced off on command line. */
+
+ pr_info("Faking a node at [mem %#018Lx-%#018Lx]\n",
+ 0LLU, PFN_PHYS(max_pfn) - 1);
for_each_memblock(memory, mblk) {
ret = numa_add_memblk(0, mblk->base, mblk->base + mblk->size);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v6 09/14] arm64/numa: support HAVE_SETUP_PER_CPU_AREA
[not found] ` <1470908028-8596-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-08-11 9:33 ` [PATCH v6 08/14] arm64: numa: " Zhen Lei
@ 2016-08-11 9:33 ` Zhen Lei
2016-08-11 9:33 ` [PATCH v6 10/14] arm64/numa: define numa_distance as array to simplify code Zhen Lei
` (3 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Zhen Lei @ 2016-08-11 9:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Rob Herring, Frank Rowand, devicetree
Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Zhen Lei
To make each percpu area allocated from its local numa node. Without this
patch, all percpu areas will be allocated from the node which cpu0 belongs
to.
Signed-off-by: Zhen Lei <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/arm64/Kconfig | 8 ++++++++
arch/arm64/mm/numa.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index bc3f00f..2815af6 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -603,6 +603,14 @@ config USE_PERCPU_NUMA_NODE_ID
def_bool y
depends on NUMA
+config HAVE_SETUP_PER_CPU_AREA
+ def_bool y
+ depends on NUMA
+
+config NEED_PER_CPU_EMBED_FIRST_CHUNK
+ def_bool y
+ depends on NUMA
+
source kernel/Kconfig.preempt
source kernel/Kconfig.hz
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 0a159d3..69aacf4 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -25,6 +25,8 @@
#include <linux/module.h>
#include <linux/of.h>
+#include <asm/sections.h>
+
struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
EXPORT_SYMBOL(node_data);
nodemask_t numa_nodes_parsed __initdata;
@@ -129,6 +131,60 @@ void __init early_map_cpu_to_node(unsigned int cpu, int nid)
cpu_to_node_map[cpu] = nid;
}
+#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
+unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
+EXPORT_SYMBOL(__per_cpu_offset);
+
+static int __init early_cpu_to_node(int cpu)
+{
+ return cpu_to_node_map[cpu];
+}
+
+static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)
+{
+ if (early_cpu_to_node(from) == early_cpu_to_node(to))
+ return LOCAL_DISTANCE;
+ else
+ return REMOTE_DISTANCE;
+}
+
+static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size,
+ size_t align)
+{
+ int nid = early_cpu_to_node(cpu);
+
+ return memblock_virt_alloc_try_nid(size, align,
+ __pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, nid);
+}
+
+static void __init pcpu_fc_free(void *ptr, size_t size)
+{
+ memblock_free_early(__pa(ptr), size);
+}
+
+void __init setup_per_cpu_areas(void)
+{
+ unsigned long delta;
+ unsigned int cpu;
+ int rc;
+
+ /*
+ * Always reserve area for module percpu variables. That's
+ * what the legacy allocator did.
+ */
+ rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,
+ PERCPU_DYNAMIC_RESERVE, PAGE_SIZE,
+ pcpu_cpu_distance,
+ pcpu_fc_alloc, pcpu_fc_free);
+ if (rc < 0)
+ panic("Failed to initialize percpu areas.");
+
+ delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
+ for_each_possible_cpu(cpu)
+ __per_cpu_offset[cpu] = delta + pcpu_unit_offsets[cpu];
+}
+#endif
+
/**
* numa_add_memblk - Set node id to memblk
* @nid: NUMA node ID of the new memblk
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v6 10/14] arm64/numa: define numa_distance as array to simplify code
[not found] ` <1470908028-8596-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-08-11 9:33 ` [PATCH v6 08/14] arm64: numa: " Zhen Lei
2016-08-11 9:33 ` [PATCH v6 09/14] arm64/numa: support HAVE_SETUP_PER_CPU_AREA Zhen Lei
@ 2016-08-11 9:33 ` Zhen Lei
2016-08-11 9:33 ` [PATCH v6 11/14] arm64/numa: support HAVE_MEMORYLESS_NODES Zhen Lei
` (2 subsequent siblings)
5 siblings, 0 replies; 16+ messages in thread
From: Zhen Lei @ 2016-08-11 9:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Rob Herring, Frank Rowand, devicetree
Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Zhen Lei
1. MAX_NUMNODES is base on CONFIG_NODES_SHIFT, the default value of the
latter is very small now.
2. Suppose the default value of MAX_NUMNODES is enlarged to 64, so the
size of numa_distance is 4K, it's still acceptable if run the Image
on other processors.
3. It will make function __node_distance quicker than before.
Signed-off-by: Zhen Lei <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/arm64/include/asm/numa.h | 1 -
arch/arm64/mm/numa.c | 74 +++----------------------------------------
2 files changed, 5 insertions(+), 70 deletions(-)
diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h
index 600887e..9b6cc38 100644
--- a/arch/arm64/include/asm/numa.h
+++ b/arch/arm64/include/asm/numa.h
@@ -32,7 +32,6 @@ static inline const struct cpumask *cpumask_of_node(int node)
void __init arm64_numa_init(void);
int __init numa_add_memblk(int nodeid, u64 start, u64 end);
void __init numa_set_distance(int from, int to, int distance);
-void __init numa_free_distance(void);
void __init early_map_cpu_to_node(unsigned int cpu, int nid);
void numa_store_cpu_info(unsigned int cpu);
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 69aacf4..bd4d26a9 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -32,8 +32,7 @@ EXPORT_SYMBOL(node_data);
nodemask_t numa_nodes_parsed __initdata;
static int cpu_to_node_map[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE };
-static int numa_distance_cnt;
-static u8 *numa_distance;
+static u8 numa_distance[MAX_NUMNODES][MAX_NUMNODES];
static bool numa_off;
static __init int numa_parse_early_param(char *opt)
@@ -242,59 +241,6 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
}
/**
- * numa_free_distance
- *
- * The current table is freed.
- */
-void __init numa_free_distance(void)
-{
- size_t size;
-
- if (!numa_distance)
- return;
-
- size = numa_distance_cnt * numa_distance_cnt *
- sizeof(numa_distance[0]);
-
- memblock_free(__pa(numa_distance), size);
- numa_distance_cnt = 0;
- numa_distance = NULL;
-}
-
-/**
- *
- * Create a new NUMA distance table.
- *
- */
-static int __init numa_alloc_distance(void)
-{
- size_t size;
- u64 phys;
- int i, j;
-
- size = nr_node_ids * nr_node_ids * sizeof(numa_distance[0]);
- phys = memblock_find_in_range(0, PFN_PHYS(max_pfn),
- size, PAGE_SIZE);
- if (WARN_ON(!phys))
- return -ENOMEM;
-
- memblock_reserve(phys, size);
-
- numa_distance = __va(phys);
- numa_distance_cnt = nr_node_ids;
-
- /* fill with the default distances */
- for (i = 0; i < numa_distance_cnt; i++)
- for (j = 0; j < numa_distance_cnt; j++)
- numa_distance[i * numa_distance_cnt + j] = i == j ?
- LOCAL_DISTANCE : REMOTE_DISTANCE;
-
- pr_debug("Initialized distance table, cnt=%d\n", numa_distance_cnt);
-
- return 0;
-}
-
-/**
* numa_set_distance - Set inter node NUMA distance from node to node.
* @from: the 'from' node to set distance
* @to: the 'to' node to set distance
@@ -309,12 +255,7 @@ static int __init numa_alloc_distance(void)
*/
void __init numa_set_distance(int from, int to, int distance)
{
- if (!numa_distance) {
- pr_warn_once("Warning: distance table not allocated yet\n");
- return;
- }
-
- if (from >= numa_distance_cnt || to >= numa_distance_cnt ||
+ if (from >= MAX_NUMNODES || to >= MAX_NUMNODES ||
from < 0 || to < 0) {
pr_warn_once("Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
from, to, distance);
@@ -328,7 +269,7 @@ void __init numa_set_distance(int from, int to, int distance)
return;
}
- numa_distance[from * numa_distance_cnt + to] = distance;
+ numa_distance[from][to] = distance;
}
/**
@@ -336,9 +277,9 @@ void __init numa_set_distance(int from, int to, int distance)
*/
int __node_distance(int from, int to)
{
- if (from >= numa_distance_cnt || to >= numa_distance_cnt)
+ if (from >= MAX_NUMNODES || to >= MAX_NUMNODES)
return from == to ? LOCAL_DISTANCE : REMOTE_DISTANCE;
- return numa_distance[from * numa_distance_cnt + to];
+ return numa_distance[from][to];
}
EXPORT_SYMBOL(__node_distance);
@@ -378,11 +319,6 @@ static int __init numa_init(int (*init_func)(void))
nodes_clear(numa_nodes_parsed);
nodes_clear(node_possible_map);
nodes_clear(node_online_map);
- numa_free_distance();
-
- ret = numa_alloc_distance();
- if (ret < 0)
- return ret;
ret = init_func();
if (ret < 0)
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v6 11/14] arm64/numa: support HAVE_MEMORYLESS_NODES
[not found] ` <1470908028-8596-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
` (2 preceding siblings ...)
2016-08-11 9:33 ` [PATCH v6 10/14] arm64/numa: define numa_distance as array to simplify code Zhen Lei
@ 2016-08-11 9:33 ` Zhen Lei
2016-08-11 9:33 ` [PATCH v6 12/14] arm64/numa: remove some useless code Zhen Lei
2016-08-22 7:47 ` [PATCH v6 00/14] fix some type infos and bugs for arm64/of numa Leizhen (ThunderTown)
5 siblings, 0 replies; 16+ messages in thread
From: Zhen Lei @ 2016-08-11 9:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Rob Herring, Frank Rowand, devicetree
Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Zhen Lei
Some numa nodes may have no memory. For example:
1. cpu0 on node0
2. cpu1 on node1
3. device0 access the momory from node0 and node1 take the same time.
So, we can not simply classify device0 to node0 or node1, but we can
define a node2 which distances to node0 and node1 are the same.
Signed-off-by: Zhen Lei <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/arm64/Kconfig | 4 ++++
arch/arm64/kernel/smp.c | 1 +
arch/arm64/mm/numa.c | 43 +++++++++++++++++++++++++++++++++++++++++--
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 2815af6..3a2b6ed 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -611,6 +611,10 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK
def_bool y
depends on NUMA
+config HAVE_MEMORYLESS_NODES
+ def_bool y
+ depends on NUMA
+
source kernel/Kconfig.preempt
source kernel/Kconfig.hz
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 76a6d92..aa677f4 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -619,6 +619,7 @@ static void __init of_parse_and_init_cpus(void)
}
bootcpu_valid = true;
+ early_map_cpu_to_node(0, of_node_to_nid(dn));
/*
* cpu_logical_map has already been
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index bd4d26a9..30d3279 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -128,6 +128,14 @@ void __init early_map_cpu_to_node(unsigned int cpu, int nid)
nid = 0;
cpu_to_node_map[cpu] = nid;
+
+ /*
+ * We should set the numa node of cpu0 as soon as possible, because it
+ * has already been set up online before. cpu_to_node(0) will soon be
+ * called.
+ */
+ if (!cpu)
+ set_cpu_numa_node(cpu, nid);
}
#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
@@ -210,6 +218,35 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
return ret;
}
+static u64 __init alloc_node_data_from_nearest_node(int nid, const size_t size)
+{
+ int i, best_nid, distance;
+ u64 pa;
+ DECLARE_BITMAP(nodes_map, MAX_NUMNODES);
+
+ bitmap_zero(nodes_map, MAX_NUMNODES);
+ bitmap_set(nodes_map, nid, 1);
+
+find_nearest_node:
+ best_nid = NUMA_NO_NODE;
+ distance = INT_MAX;
+
+ for_each_clear_bit(i, nodes_map, MAX_NUMNODES)
+ if (numa_distance[nid][i] < distance) {
+ best_nid = i;
+ distance = numa_distance[nid][i];
+ }
+
+ pa = memblock_alloc_nid(size, SMP_CACHE_BYTES, best_nid);
+ if (!pa) {
+ BUG_ON(best_nid == NUMA_NO_NODE);
+ bitmap_set(nodes_map, best_nid, 1);
+ goto find_nearest_node;
+ }
+
+ return pa;
+}
+
/**
* Initialize NODE_DATA for a node on the local memory
*/
@@ -223,7 +260,9 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1);
- nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
+ nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
+ if (!nd_pa)
+ nd_pa = alloc_node_data_from_nearest_node(nid, nd_size);
nd = __va(nd_pa);
/* report and initialize */
@@ -233,7 +272,7 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
if (tnid != nid)
pr_info(" NODE_DATA(%d) on node %d\n", nid, tnid);
- node_data[nid] = nd;
+ NODE_DATA(nid) = nd;
memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
NODE_DATA(nid)->node_id = nid;
NODE_DATA(nid)->node_start_pfn = start_pfn;
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v6 12/14] arm64/numa: remove some useless code
[not found] ` <1470908028-8596-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
` (3 preceding siblings ...)
2016-08-11 9:33 ` [PATCH v6 11/14] arm64/numa: support HAVE_MEMORYLESS_NODES Zhen Lei
@ 2016-08-11 9:33 ` Zhen Lei
2016-08-22 7:47 ` [PATCH v6 00/14] fix some type infos and bugs for arm64/of numa Leizhen (ThunderTown)
5 siblings, 0 replies; 16+ messages in thread
From: Zhen Lei @ 2016-08-11 9:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Rob Herring, Frank Rowand, devicetree
Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Zhen Lei
1. Currently only cpu0 set on cpu_possible_mask and percpu areas have not
been initialized.
2. No reason to limit cpu0 must belongs to node0.
Signed-off-by: Zhen Lei <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/arm64/mm/numa.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 30d3279..1796789 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -93,7 +93,6 @@ void numa_clear_node(unsigned int cpu)
*/
static void __init setup_node_to_cpumask_map(void)
{
- unsigned int cpu;
int node;
/* setup nr_node_ids if not done yet */
@@ -106,9 +105,6 @@ static void __init setup_node_to_cpumask_map(void)
cpumask_clear(node_to_cpumask_map[node]);
}
- for_each_possible_cpu(cpu)
- set_cpu_numa_node(cpu, NUMA_NO_NODE);
-
/* cpumask_of_node() will now work */
pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids);
}
@@ -374,10 +370,6 @@ static int __init numa_init(int (*init_func)(void))
setup_node_to_cpumask_map();
- /* init boot processor */
- cpu_to_node_map[0] = 0;
- map_cpu_to_node(0, 0);
-
return 0;
}
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v6 00/14] fix some type infos and bugs for arm64/of numa
[not found] ` <1470908028-8596-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
` (4 preceding siblings ...)
2016-08-11 9:33 ` [PATCH v6 12/14] arm64/numa: remove some useless code Zhen Lei
@ 2016-08-22 7:47 ` Leizhen (ThunderTown)
5 siblings, 0 replies; 16+ messages in thread
From: Leizhen (ThunderTown) @ 2016-08-22 7:47 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel,
Rob Herring, Frank Rowand, devicetree
Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo
Hi everybody:
Is this patch series can be accepted or still need to be improved? It seems
to have been a long time.
Thanks,
Zhen Lei
On 2016/8/11 17:33, Zhen Lei wrote:
> v5 -> v6:
> Move memblk nid check from arch/arm64/mm/numa.c into drivers/of/of_numa.c,
> because this check is arch independent.
>
> This modification only related to patch 3, but impacted the contents of patch 7 and 8,
> other patches have no change.
>
> v4 -> v5:
> This version has no code changes, just add "Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>"
> into patches 1, 2, 4, 6, 7, 13, 14. Because these patches rely on some acpi numa
> patches, and the latter had not been upstreamed in 4.7, but upstreamed in 4.8-rc1,
> so I resend my patches again.
>
> v3 -> v4:
> 1. Packed three patches of Kefeng Wang, patch6-8.
> 2. Add 6 new patches(9-15) to enhance the numa on arm64.
>
> v2 -> v3:
> 1. Adjust patch2 and patch5 according to Matthias Brugger's advice, to make the
> patches looks more well. The final code have no change.
>
> v1 -> v2:
> 1. Base on https://lkml.org/lkml/2016/5/24/679
> 2. Rewrote of_numa_parse_memory_nodes according to Rob Herring's advice. So that it looks more clear.
> 3. Rewrote patch 5 because some scenes were not considered before.
>
> Kefeng Wang (3):
> of_numa: Use of_get_next_parent to simplify code
> of_numa: Use pr_fmt()
> arm64: numa: Use pr_fmt()
>
> Zhen Lei (11):
> of/numa: remove a duplicated pr_debug information
> of/numa: fix a memory@ node can only contains one memory block
> arm64/numa: add nid check for memory block
> of/numa: remove a duplicated warning
> arm64/numa: avoid inconsistent information to be printed
> arm64/numa: support HAVE_SETUP_PER_CPU_AREA
> arm64/numa: define numa_distance as array to simplify code
> arm64/numa: support HAVE_MEMORYLESS_NODES
> arm64/numa: remove some useless code
> of/numa: remove the constraint on the distances of node pairs
> Documentation: remove the constraint on the distances of node pairs
>
> Documentation/devicetree/bindings/numa.txt | 1 -
> arch/arm64/Kconfig | 12 ++
> arch/arm64/include/asm/numa.h | 1 -
> arch/arm64/kernel/smp.c | 1 +
> arch/arm64/mm/numa.c | 223 ++++++++++++++++-------------
> drivers/of/of_numa.c | 88 ++++++------
> 6 files changed, 178 insertions(+), 148 deletions(-)
>
> --
> 2.5.0
>
>
>
> .
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 16+ messages in thread