Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andy Whitcroft <apw@...>, Andrew Morton <akpm@...>
Cc: Paul Mundt <lethal@...>, <linux-kernel@...>, <linux-mm@...>
Date: Tuesday, September 11, 2007 - 5:37 am

> > +	if (onlined_pages){

Ah, Ok. I attached fixed patch in this mail.


Thanks for your explanation.
You mentioned all of my intention correctly. :-)


----

Fix kswapd doesn't run when memory is added on memory-less-node.
Fix compile error of zone->node when CONFIG_NUMA is off.

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Andy Whitcroft <apw@shadowen.org>


---
 mm/memory_hotplug.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Index: current/mm/memory_hotplug.c
===================================================================
--- current.orig/mm/memory_hotplug.c	2007-09-07 18:08:07.000000000 +0900
+++ current/mm/memory_hotplug.c	2007-09-11 17:29:19.000000000 +0900
@@ -211,10 +211,12 @@ int online_pages(unsigned long pfn, unsi
 		online_pages_range);
 	zone->present_pages += onlined_pages;
 	zone->zone_pgdat->node_present_pages += onlined_pages;
-	if (onlined_pages)
-		node_set_state(zone->node, N_HIGH_MEMORY);
 
 	setup_per_zone_pages_min();
+	if (onlined_pages) {
+		kswapd_run(zone_to_nid(zone));
+		node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
+	}
 
 	if (need_zonelists_rebuild)
 		build_all_zonelists();
@@ -269,9 +271,6 @@ int add_memory(int nid, u64 start, u64 s
 		if (!pgdat)
 			return -ENOMEM;
 		new_pgdat = 1;
-		ret = kswapd_run(nid);
-		if (ret)
-			goto error;
 	}
 
 	/* call arch's memory hotadd */

-- 
Yasunori Goto 


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Yasunori Goto, (Tue Sep 11, 4:18 am)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Andy Whitcroft, (Tue Sep 11, 5:15 am)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Yasunori Goto, (Tue Sep 11, 5:37 am)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Andrew Morton, (Thu Sep 13, 9:44 pm)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Yasunori Goto, (Thu Sep 13, 10:02 pm)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Andrew Morton, (Thu Sep 13, 10:41 pm)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Lee Schermerhorn, (Fri Sep 14, 10:09 am)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Andrew Morton, (Fri Sep 14, 4:51 pm)
Re: [PATCH -mm] mm: Fix memory hotplug + sparsemem build., Yasunori Goto, (Fri Sep 14, 1:14 am)