diff mbox

powerpc/mm: allow memory hotplug into an offline node

Message ID 1479314703-18989-1-git-send-email-arbab@linux.vnet.ibm.com (mailing list archive)
State Accepted
Headers show

Commit Message

Reza Arbab Nov. 16, 2016, 4:45 p.m. UTC
Relax the check preventing us from hotplugging into an offline node.

This limitation was added in commit 482ec7c403d2 ("[PATCH] powerpc numa:
Support sparse online node map") to prevent adding resources to an
uninitialized node.

These days, there is no harm in doing so. The addition will actually
cause the node to be initialized and onlined; add_memory_resource()
calls hotadd_new_pgdat() (if necessary) and node_set_online().

Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: John Allen <jallen@linux.vnet.ibm.com>
Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
---
This applies on top of "powerpc/mm: allow memory hotplug into a
memoryless node", currently in the -mm tree:
http://lkml.kernel.org/r/1479160961-25840-2-git-send-email-arbab@linux.vnet.ibm.com

 arch/powerpc/mm/numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Feb. 1, 2017, 1:05 a.m. UTC | #1
On Wed, 2016-11-16 at 16:45:03 UTC, Reza Arbab wrote:
> Relax the check preventing us from hotplugging into an offline node.
> 
> This limitation was added in commit 482ec7c403d2 ("[PATCH] powerpc numa:
> Support sparse online node map") to prevent adding resources to an
> uninitialized node.
> 
> These days, there is no harm in doing so. The addition will actually
> cause the node to be initialized and onlined; add_memory_resource()
> calls hotadd_new_pgdat() (if necessary) and node_set_online().
> 
> Cc: Balbir Singh <bsingharora@gmail.com>
> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> Cc: John Allen <jallen@linux.vnet.ibm.com>
> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2a8628d41602dc9f988af051a657ee

cheers
diff mbox

Patch

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index d69f6f6..07620c9 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1091,7 +1091,7 @@  int hot_add_scn_to_nid(unsigned long scn_addr)
 		nid = hot_add_node_scn_to_nid(scn_addr);
 	}
 
-	if (nid < 0 || !node_online(nid))
+	if (nid < 0 || !node_possible(nid))
 		nid = first_online_node;
 
 	return nid;