Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1408401 > unrolled thread
| Started by | Zhen Lei <thunder.leizhen@huawei.com> |
|---|---|
| First post | 2016-05-28 11:30 +0200 |
| Last post | 2016-05-28 11:30 +0200 |
| Articles | 5 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v2 0/5] fix some type infos and bugs for arm64/of numa Zhen Lei <thunder.leizhen@huawei.com> - 2016-05-28 11:30 +0200
[PATCH v2 3/5] arm64/numa: add nid check for memory block Zhen Lei <thunder.leizhen@huawei.com> - 2016-05-28 11:30 +0200
[PATCH v2 4/5] of/numa: remove a duplicated warning Zhen Lei <thunder.leizhen@huawei.com> - 2016-05-28 11:30 +0200
[PATCH v2 5/5] arm64/numa: avoid inconsistent information to be printed Zhen Lei <thunder.leizhen@huawei.com> - 2016-05-28 11:30 +0200
[PATCH v2 1/5] of/numa: remove a duplicated pr_debug information Zhen Lei <thunder.leizhen@huawei.com> - 2016-05-28 11:30 +0200
| From | Zhen Lei <thunder.leizhen@huawei.com> |
|---|---|
| Date | 2016-05-28 11:30 +0200 |
| Subject | [PATCH v2 0/5] fix some type infos and bugs for arm64/of numa |
| Message-ID | <rDIJb-78P-3@gated-at.bofh.it> |
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. Zhen Lei (5): 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 arch/arm64/mm/numa.c | 11 ++++++++--- drivers/of/of_numa.c | 42 ++++++++++++------------------------------ 2 files changed, 20 insertions(+), 33 deletions(-) -- 2.5.0
[toc] | [next] | [standalone]
| From | Zhen Lei <thunder.leizhen@huawei.com> |
|---|---|
| Date | 2016-05-28 11:30 +0200 |
| Subject | [PATCH v2 3/5] arm64/numa: add nid check for memory block |
| Message-ID | <rDIJb-78P-15@gated-at.bofh.it> |
| In reply to | #1408401 |
Use the same tactic to cpu and numa-distance nodes.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
arch/arm64/mm/numa.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index c7fe3ec..2601660 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -141,6 +141,11 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
{
int ret;
+ if (nid >= MAX_NUMNODES) {
+ pr_warn("NUMA: Node id %u exceeds maximum value\n", nid);
+ return -EINVAL;
+ }
+
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",
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Zhen Lei <thunder.leizhen@huawei.com> |
|---|---|
| Date | 2016-05-28 11:30 +0200 |
| Subject | [PATCH v2 4/5] of/numa: remove a duplicated warning |
| Message-ID | <rDIJb-78P-13@gated-at.bofh.it> |
| In reply to | #1408401 |
This warning has been printed in of_numa_parse_cpu_nodes before.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/of/of_numa.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c
index fa85a51..fb62307 100644
--- a/drivers/of/of_numa.c
+++ b/drivers/of/of_numa.c
@@ -175,13 +175,8 @@ int of_node_to_nid(struct device_node *device)
np->name);
of_node_put(np);
- if (!r) {
- if (nid >= MAX_NUMNODES)
- pr_warn("NUMA: Node id %u exceeds maximum value\n",
- nid);
- else
- return nid;
- }
+ if (!r)
+ return nid;
return NUMA_NO_NODE;
}
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Zhen Lei <thunder.leizhen@huawei.com> |
|---|---|
| Date | 2016-05-28 11:30 +0200 |
| Subject | [PATCH v2 5/5] arm64/numa: avoid inconsistent information to be printed |
| Message-ID | <rDIJc-78P-19@gated-at.bofh.it> |
| In reply to | #1408401 |
numa_init(of_numa_init) may returned error because of numa configuration
error. So "No NUMA configuration found" is inaccurate. In fact, specific
configuration error information should be immediately printed by the
testing branch.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
arch/arm64/mm/numa.c | 6 +++---
drivers/of/of_numa.c | 7 +++----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 2601660..1b9622c 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -338,8 +338,10 @@ static int __init numa_init(int (*init_func)(void))
if (ret < 0)
return ret;
- if (nodes_empty(numa_nodes_parsed))
+ if (nodes_empty(numa_nodes_parsed)) {
+ pr_info("No NUMA configuration found\n");
return -EINVAL;
+ }
ret = numa_register_nodes();
if (ret < 0)
@@ -370,8 +372,6 @@ static int __init dummy_numa_init(void)
if (numa_off)
pr_info("NUMA disabled\n"); /* Forced off on command line. */
- else
- pr_info("No NUMA configuration found\n");
pr_info("NUMA: Faking a node at [mem %#018Lx-%#018Lx]\n",
0LLU, PFN_PHYS(max_pfn) - 1);
diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c
index fb62307..3157130 100644
--- a/drivers/of/of_numa.c
+++ b/drivers/of/of_numa.c
@@ -63,7 +63,7 @@ static int __init of_numa_parse_memory_nodes(void)
struct device_node *np = NULL;
struct resource rsrc;
u32 nid;
- int i, r = 0;
+ int i, r;
for_each_node_by_type(np, "memory") {
r = of_property_read_u32(np, "numa-node-id", &nid);
@@ -81,12 +81,11 @@ static int __init of_numa_parse_memory_nodes(void)
if (!i || r) {
of_node_put(np);
pr_err("NUMA: bad property in memory node\n");
- r = r ? : -EINVAL;
- break;
+ return r ? : -EINVAL;
}
}
- return r;
+ return 0;
}
static int __init of_numa_parse_distance_map_v1(struct device_node *map)
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Zhen Lei <thunder.leizhen@huawei.com> |
|---|---|
| Date | 2016-05-28 11:30 +0200 |
| Subject | [PATCH v2 1/5] of/numa: remove a duplicated pr_debug information |
| Message-ID | <rDIJc-78P-21@gated-at.bofh.it> |
| In reply to | #1408401 |
This information will be printed in the subfunction numa_add_memblk.
They are not the same, but very similar.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/of/of_numa.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c
index ed5a097..fb71b4e 100644
--- a/drivers/of/of_numa.c
+++ b/drivers/of/of_numa.c
@@ -88,10 +88,6 @@ static int __init of_numa_parse_memory_nodes(void)
break;
}
- pr_debug("NUMA: base = %llx len = %llx, node = %u\n",
- rsrc.start, rsrc.end - rsrc.start + 1, nid);
-
-
r = numa_add_memblk(nid, rsrc.start, rsrc.end + 1);
if (r)
break;
--
2.5.0
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web