Skip to contentSkip to conversation

mm: memory_hotplug: fix build error

PATCH In review Bob Liu 2 participants 3 messages Dec 11, 2012

Subsystems (2)
lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 mm: memory_hotplug: fix build error

Fix below build error(and comment):
mm/memory_hotplug.c:646:14: error: ‘ZONE_HIGH’ undeclared (first use in this function)
mm/memory_hotplug.c:646:14: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [mm/memory_hotplug.o] Error 1

---
 mm/memory_hotplug.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/memory_hotplug.c +3 -3
index ea71d0d..9e97530 100644
@@ -636,14 +636,14 @@ static void node_states_check_changes_online(unsigned long nr_pages,
 #ifdef CONFIG_HIGHMEM
 	/*
 	 * If we have movable node, node_states[N_HIGH_MEMORY]
-	 * contains nodes which have zones of 0...ZONE_HIGH,
-	 * set zone_last to ZONE_HIGH.
+	 * contains nodes which have zones of 0...ZONE_HIGHMEM,
+	 * set zone_last to ZONE_HIGHMEM.
 	 *
 	 * If we don't have movable node, node_states[N_NORMAL_MEMORY]
 	 * contains nodes which have zones of 0...ZONE_MOVABLE,
 	 * set zone_last to ZONE_MOVABLE.
 	 */
-	zone_last = ZONE_HIGH;
+	zone_last = ZONE_HIGHMEM;
 	if (N_MEMORY == N_HIGH_MEMORY)
 		zone_last = ZONE_MOVABLE;
 
Signature · 8 lines
1.7.9.5


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw
Quoted 23 lines · On Tue, 11 Dec 2012 16:05:58 +0800 Bob Liu <[email protected]> wrote:

Fix below build error(and comment):
mm/memory_hotplug.c:646:14: error: ___ZONE_HIGH___ undeclared (first use in this function)
mm/memory_hotplug.c:646:14: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [mm/memory_hotplug.o] Error 1

---
 mm/memory_hotplug.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/memory_hotplug.c +1 -2
index ea71d0d..9e97530 100644
@@ -636,14 +636,14 @@ static void node_states_check_changes_online(unsigned long nr_pages,
 #ifdef CONFIG_HIGHMEM
 	/*
 	 * If we have movable node, node_states[N_HIGH_MEMORY]
-	 * contains nodes which have zones of 0...ZONE_HIGH,
-	 * set zone_last to ZONE_HIGH.
+	 * contains nodes which have zones of 0...ZONE_HIGHMEM,

mm/memory_hotplug.c static void node_states_check_changes_online(unsigned long nr_pages, · line 648

Quoted 10 lines
mm/memory_hotplug.c +2 -1
+	 * set zone_last to ZONE_HIGHMEM.
 	 *
 	 * If we don't have movable node, node_states[N_NORMAL_MEMORY]
 	 * contains nodes which have zones of 0...ZONE_MOVABLE,
 	 * set zone_last to ZONE_MOVABLE.
 	 */
-	zone_last = ZONE_HIGH;
+	zone_last = ZONE_HIGHMEM;
 	if (N_MEMORY == N_HIGH_MEMORY)
 		zone_last = ZONE_MOVABLE;

Thanks - there are actually two sites. You only caught one because CONFIG_HIGHMEM was missing its 'F'.

Guys, this isn't very good. Obviously this code wasn't tested well :(

I expect the combination of highmem and memory hotplug will never exist, but it should at least compile.

mm/memory_hotplug.c renamed from mm/memory_hotplug.c~hotplug-update-nodemasks-management-fix +7 -7
@@ -620,14 +620,14 @@ static void node_states_check_changes_on
 #ifdef CONFIG_HIGHMEM
 	/*
 	 * If we have movable node, node_states[N_HIGH_MEMORY]
-	 * contains nodes which have zones of 0...ZONE_HIGH,
-	 * set zone_last to ZONE_HIGH.
+	 * contains nodes which have zones of 0...ZONE_HIGHMEM,
+	 * set zone_last to ZONE_HIGHMEM.
 	 *
 	 * If we don't have movable node, node_states[N_NORMAL_MEMORY]
 	 * contains nodes which have zones of 0...ZONE_MOVABLE,
 	 * set zone_last to ZONE_MOVABLE.
 	 */
-	zone_last = ZONE_HIGH;
+	zone_last = ZONE_HIGHMEM;
 	if (N_MEMORY == N_HIGH_MEMORY)
 		zone_last = ZONE_MOVABLE;
 
@@ -1151,17 +1151,17 @@ static void node_states_check_changes_of
 	else
 		arg->status_change_nid_normal = -1;
 
-#ifdef CONIG_HIGHMEM
+#ifdef CONFIG_HIGHMEM
 	/*
 	 * If we have movable node, node_states[N_HIGH_MEMORY]
-	 * contains nodes which have zones of 0...ZONE_HIGH,
-	 * set zone_last to ZONE_HIGH.
+	 * contains nodes which have zones of 0...ZONE_HIGHMEM,
+	 * set zone_last to ZONE_HIGHMEM.
 	 *
 	 * If we don't have movable node, node_states[N_NORMAL_MEMORY]
 	 * contains nodes which have zones of 0...ZONE_MOVABLE,
 	 * set zone_last to ZONE_MOVABLE.
 	 */
-	zone_last = ZONE_HIGH;
+	zone_last = ZONE_HIGHMEM;
 	if (N_MEMORY == N_HIGH_MEMORY)
 		zone_last = ZONE_MOVABLE;
 

_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#2 lore raw
Quoted 30 lines · Andrew Morton
Quoted 28 lines · On Tue, 11 Dec 2012 16:05:58 +0800 Bob Liu <[email protected]> wrote:

Fix below build error(and comment):
mm/memory_hotplug.c:646:14: error: ___ZONE_HIGH___ undeclared (first use in this function)
mm/memory_hotplug.c:646:14: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [mm/memory_hotplug.o] Error 1

---
 mm/memory_hotplug.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/memory_hotplug.c +2 -2
index ea71d0d..9e97530 100644
@@ -636,14 +636,14 @@ static void node_states_check_changes_online(unsigned long nr_pages,
 #ifdef CONFIG_HIGHMEM
      /*
       * If we have movable node, node_states[N_HIGH_MEMORY]
-      * contains nodes which have zones of 0...ZONE_HIGH,
-      * set zone_last to ZONE_HIGH.
+      * contains nodes which have zones of 0...ZONE_HIGHMEM,
+      * set zone_last to ZONE_HIGHMEM.
       *
       * If we don't have movable node, node_states[N_NORMAL_MEMORY]
       * contains nodes which have zones of 0...ZONE_MOVABLE,
       * set zone_last to ZONE_MOVABLE.
Quoted 9 lines

mm/memory_hotplug.c static void node_states_check_changes_on · line 632

Quoted 5 lines
mm/memory_hotplug.c +1 -1
       */
-     zone_last = ZONE_HIGH;
+     zone_last = ZONE_HIGHMEM;
      if (N_MEMORY == N_HIGH_MEMORY)
              zone_last = ZONE_MOVABLE;

Thanks - there are actually two sites. You only caught one because CONFIG_HIGHMEM was missing its 'F'.

Hmm...You are right.
Sorry for not take more time on it.

Quoted 6 lines

Guys, this isn't very good. Obviously this code wasn't tested well :(

I expect the combination of highmem and memory hotplug will never exist, but it should at least compile.

Agree.

Quoted 46 lines
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~hotplug-update-nodemasks-management-fix +7 -7
@@ -620,14 +620,14 @@ static void node_states_check_changes_on
 #ifdef CONFIG_HIGHMEM
        /*
         * If we have movable node, node_states[N_HIGH_MEMORY]
-        * contains nodes which have zones of 0...ZONE_HIGH,
-        * set zone_last to ZONE_HIGH.
+        * contains nodes which have zones of 0...ZONE_HIGHMEM,
+        * set zone_last to ZONE_HIGHMEM.
         *
         * If we don't have movable node, node_states[N_NORMAL_MEMORY]
         * contains nodes which have zones of 0...ZONE_MOVABLE,
         * set zone_last to ZONE_MOVABLE.
         */
-       zone_last = ZONE_HIGH;
+       zone_last = ZONE_HIGHMEM;
        if (N_MEMORY == N_HIGH_MEMORY)
                zone_last = ZONE_MOVABLE;
 
@@ -1151,17 +1151,17 @@ static void node_states_check_changes_of
        else
                arg->status_change_nid_normal = -1;
 
-#ifdef CONIG_HIGHMEM
+#ifdef CONFIG_HIGHMEM
        /*
         * If we have movable node, node_states[N_HIGH_MEMORY]
-        * contains nodes which have zones of 0...ZONE_HIGH,
-        * set zone_last to ZONE_HIGH.
+        * contains nodes which have zones of 0...ZONE_HIGHMEM,
+        * set zone_last to ZONE_HIGHMEM.
         *
         * If we don't have movable node, node_states[N_NORMAL_MEMORY]
         * contains nodes which have zones of 0...ZONE_MOVABLE,
         * set zone_last to ZONE_MOVABLE.
         */
-       zone_last = ZONE_HIGH;
+       zone_last = ZONE_HIGHMEM;
        if (N_MEMORY == N_HIGH_MEMORY)
                zone_last = ZONE_MOVABLE;
 

_

Signature · 8 lines
Regards,
--Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>