Skip to contentSkip to conversation

mm, memory_hotplug: use node instead of zone in can_online_high_movable

PATCH New [email protected] 1 participant 1 message Jul 6, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 44/108 mm, memory_hotplug: use node instead of zone in can_online_high_movable

From: Michal Hocko <[email protected]>
Subject: mm, memory_hotplug: use node instead of zone in can_online_high_movable

The primary purpose of this helper is to query the node state so use the node id directly. This is a preparatory patch for later changes.

This shouldn't introduce any functional change

Cc Andi Kleen <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Dan Williams <[email protected]>
Cc Daniel Kiper <[email protected]>
Cc David Rientjes <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Jerome Glisse <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Martin Schwidefsky <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Reza Arbab <[email protected]>
Cc Tobias Regnery <[email protected]>
Cc Toshi Kani <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Cc Xishi Qiu <[email protected]>

---

 mm/memory_hotplug.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-memory_hotplug-use-node-instead-of-zone-in-can_online_high_movable +4 -4
diff -puN mm/memory_hotplug.c~mm-memory_hotplug-use-node-instead-of-zone-in-can_online_high_movable mm/memory_hotplug.c
@@ -941,15 +941,15 @@ static int online_pages_range(unsigned l
  * When CONFIG_MOVABLE_NODE, we permit onlining of a node which doesn't have
  * normal memory.
  */
-static bool can_online_high_movable(struct zone *zone)
+static bool can_online_high_movable(int nid)
 {
 	return true;
 }
 #else /* CONFIG_MOVABLE_NODE */
 /* ensure every online node has NORMAL memory */
-static bool can_online_high_movable(struct zone *zone)
+static bool can_online_high_movable(int nid)
 {
-	return node_state(zone_to_nid(zone), N_NORMAL_MEMORY);
+	return node_state(nid, N_NORMAL_MEMORY);
 }
 #endif /* CONFIG_MOVABLE_NODE */
 
@@ -1083,7 +1083,7 @@ int __ref online_pages(unsigned long pfn
 
 	if ((zone_idx(zone) > ZONE_NORMAL ||
 	    online_type == MMOP_ONLINE_MOVABLE) &&
-	    !can_online_high_movable(zone))
+	    !can_online_high_movable(pfn_to_nid(pfn)))
 		return -EINVAL;
 
 	if (online_type == MMOP_ONLINE_KERNEL) {

_