Skip to content

Commit 4d59a75

Browse files
Yasuaki Ishimatsutorvalds
Yasuaki Ishimatsu
authored andcommitted
x86: get pg_data_t's memory from other node
During the implementation of SRAT support, we met a problem. In setup_arch(), we have the following call series: 1) memblock is ready; 2) some functions use memblock to allocate memory; 3) parse ACPI tables, such as SRAT. Before 3), we don't know which memory is hotpluggable, and as a result, we cannot prevent memblock from allocating hotpluggable memory. So, in 2), there could be some hotpluggable memory allocated by memblock. Now, we are trying to parse SRAT earlier, before memblock is ready. But I think we need more investigation on this topic. So in this v5, I dropped all the SRAT support, and v5 is just the same as v3, and it is based on 3.8-rc3. As we planned, we will support getting info from SRAT without users' participation at last. And we will post another patch-set to do so. And also, I think for now, we can add this boot option as the first step of supporting movable node. Since Linux cannot migrate the direct mapped pages, the only way for now is to limit the whole node containing only movable memory. Using SRAT is one way. But even if we can use SRAT, users still need an interface to enable/disable this functionality if they don't want to loose their NUMA performance. So I think, a user interface is always needed. For now, users can disable this functionality by not specifying the boot option. Later, we will post SRAT support, and add another option value "movablecore_map=acpi" to using SRAT. This patch: If system can create movable node which all memory of the node is allocated as ZONE_MOVABLE, setup_node_data() cannot allocate memory for the node's pg_data_t. So, use memblock_alloc_try_nid() instead of memblock_alloc_nid() to retry when the first allocation fails. Signed-off-by: Yasuaki Ishimatsu <[email protected]> Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Tang Chen <[email protected]> Signed-off-by: Jiang Liu <[email protected]> Cc: Wu Jianguo <[email protected]> Cc: Wen Congyang <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent aa00d89 commit 4d59a75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/mm/numa.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,9 @@ static void __init setup_node_data(int nid, u64 start, u64 end)
213213
* Allocate node data. Try node-local memory and then any node.
214214
* Never allocate in DMA zone.
215215
*/
216-
nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
216+
nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
217217
if (!nd_pa) {
218-
pr_err("Cannot find %zu bytes in node %d\n",
219-
nd_size, nid);
218+
pr_err("Cannot find %zu bytes in any node\n", nd_size);
220219
return;
221220
}
222221
nd = __va(nd_pa);

0 commit comments

Comments
 (0)