Re: [PATCH] x86/mm/numa: fix becoming single node on numa machine with 32-bit kernel.

2013-12-06 Thread Andi Kleen
Lans Zhang  writes:
>
> Signed-off-by: Lans Zhang 

Patch looks good to me.

-Andi

-- 
a...@linux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] x86/mm/numa: fix becoming single node on numa machine with 32-bit kernel.

2013-12-06 Thread Andi Kleen
Lans Zhang jia.zh...@windriver.com writes:

 Signed-off-by: Lans Zhang jia.zh...@windriver.com

Patch looks good to me.

-Andi

-- 
a...@linux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86/mm/numa: fix becoming single node on numa machine with 32-bit kernel.

2013-12-05 Thread Lans Zhang
On numa machine, if a 32-bit kernel runs over it, node data cannot
be allocated from local node if the account of memory for node 0
covers the low memory space entirely:

[0.00] Initmem setup node 0 [mem 0x-0x83fff]
[0.00]   NODE_DATA [mem 0x367ed000-0x367edfff]
[0.00] Initmem setup node 1 [mem 0x84000-0xf]
[0.00] Cannot find 4096 bytes in node 1
[0.00] 64664MB HIGHMEM available.
[0.00] 871MB LOWMEM available.

To fix this issue, node data is allowed to be allocated from other
nodes if the memory of local node is still not mapped. The expected
result looks like this:

[0.00] Initmem setup node 0 [mem 0x-0x83fff]
[0.00]   NODE_DATA [mem 0x367ed000-0x367edfff]
[0.00] Initmem setup node 1 [mem 0x84000-0xf]
[0.00]   NODE_DATA [mem 0x367ec000-0x367ecfff]
[0.00] NODE_DATA(1) on node 0
[0.00] 64664MB HIGHMEM available.
[0.00] 871MB LOWMEM available.

Signed-off-by: Lans Zhang 
---
 arch/x86/mm/numa.c |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 24aec58..c85da7b 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -211,9 +211,13 @@ static void __init setup_node_data(int nid, u64 start, u64 
end)
 */
nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
if (!nd_pa) {
-   pr_err("Cannot find %zu bytes in node %d\n",
-  nd_size, nid);
-   return;
+   nd_pa = __memblock_alloc_base(nd_size, SMP_CACHE_BYTES,
+ MEMBLOCK_ALLOC_ACCESSIBLE);
+   if (!nd_pa) {
+   pr_err("Cannot find %zu bytes in node %d\n",
+  nd_size, nid);
+   return;
+   }
}
nd = __va(nd_pa);
 
-- 
1.7.8.110.g4cb5d

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] x86/mm/numa: fix becoming single node on numa machine with 32-bit kernel.

2013-12-05 Thread Lans Zhang
On numa machine, if a 32-bit kernel runs over it, node data cannot
be allocated from local node if the account of memory for node 0
covers the low memory space entirely:

[0.00] Initmem setup node 0 [mem 0x-0x83fff]
[0.00]   NODE_DATA [mem 0x367ed000-0x367edfff]
[0.00] Initmem setup node 1 [mem 0x84000-0xf]
[0.00] Cannot find 4096 bytes in node 1
[0.00] 64664MB HIGHMEM available.
[0.00] 871MB LOWMEM available.

To fix this issue, node data is allowed to be allocated from other
nodes if the memory of local node is still not mapped. The expected
result looks like this:

[0.00] Initmem setup node 0 [mem 0x-0x83fff]
[0.00]   NODE_DATA [mem 0x367ed000-0x367edfff]
[0.00] Initmem setup node 1 [mem 0x84000-0xf]
[0.00]   NODE_DATA [mem 0x367ec000-0x367ecfff]
[0.00] NODE_DATA(1) on node 0
[0.00] 64664MB HIGHMEM available.
[0.00] 871MB LOWMEM available.

Signed-off-by: Lans Zhang jia.zh...@windriver.com
---
 arch/x86/mm/numa.c |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 24aec58..c85da7b 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -211,9 +211,13 @@ static void __init setup_node_data(int nid, u64 start, u64 
end)
 */
nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
if (!nd_pa) {
-   pr_err(Cannot find %zu bytes in node %d\n,
-  nd_size, nid);
-   return;
+   nd_pa = __memblock_alloc_base(nd_size, SMP_CACHE_BYTES,
+ MEMBLOCK_ALLOC_ACCESSIBLE);
+   if (!nd_pa) {
+   pr_err(Cannot find %zu bytes in node %d\n,
+  nd_size, nid);
+   return;
+   }
}
nd = __va(nd_pa);
 
-- 
1.7.8.110.g4cb5d

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/