At Fri, 26 Nov 2004 18:52:36 +0900, IWAMOTO Toshihiro wrote: > I've put a set of memory migration test programs at > > http://people.valinux.co.jp/~iwamoto/mh/tests/ > > tests-041126.tar.gz should work either with Dave Hansen's patchset or > with my zone based hotplug emulation patch. > > I found the tests does not work well with Dave's patchset. > I've found the followings: > > - setup_per_zone_pages_min() calls should be added in > capture_page_range() and online_pages() > - lru_add_drain() should be called before try_to_migrate_pages() The following patch deals with the first item. Signed-off-by: IWAMOTO Toshihiro Signed-off-by: Dave Hansen --- memhotplug-dave/include/linux/mmzone.h | 1 + memhotplug-dave/mm/memory_hotplug.c | 3 ++- memhotplug-dave/mm/page_alloc.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff -puN include/linux/mmzone.h~N0-call_setup_per_zone_pages_min_after_memory_size_change include/linux/mmzone.h --- memhotplug/include/linux/mmzone.h~N0-call_setup_per_zone_pages_min_after_memory_size_change 2005-02-17 15:25:50.000000000 -0800 +++ memhotplug-dave/include/linux/mmzone.h 2005-02-17 15:25:50.000000000 -0800 @@ -279,6 +279,7 @@ void build_all_zonelists(void); void wakeup_kswapd(struct zone *zone, int order); int zone_watermark_ok(struct zone *z, int order, unsigned long mark, int alloc_type, int can_try_harder, int gfp_high); +void setup_per_zone_pages_min(void); /* * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc. diff -L include/linux/mmzone.h.save -puN /dev/null /dev/null diff -puN mm/memory_hotplug.c~N0-call_setup_per_zone_pages_min_after_memory_size_change mm/memory_hotplug.c --- memhotplug/mm/memory_hotplug.c~N0-call_setup_per_zone_pages_min_after_memory_size_change 2005-02-17 15:25:50.000000000 -0800 +++ memhotplug-dave/mm/memory_hotplug.c 2005-02-17 15:25:50.000000000 -0800 @@ -151,7 +151,8 @@ int online_pages(unsigned long pfn, unsi page_zone(pfn_to_page(pfn))->present_pages += nr_pages; - /* need error checking */ + setup_per_zone_pages_min(); + return 0; } diff -L mm/memory_hotplug.c.save -puN /dev/null /dev/null diff -puN mm/page_alloc.c~N0-call_setup_per_zone_pages_min_after_memory_size_change mm/page_alloc.c --- memhotplug/mm/page_alloc.c~N0-call_setup_per_zone_pages_min_after_memory_size_change 2005-02-17 15:25:50.000000000 -0800 +++ memhotplug-dave/mm/page_alloc.c 2005-02-17 15:25:50.000000000 -0800 @@ -2033,7 +2033,7 @@ static void setup_per_zone_lowmem_reserv * that the pages_{min,low,high} values for each zone are set correctly * with respect to min_free_kbytes. */ -static void setup_per_zone_pages_min(void) +void setup_per_zone_pages_min(void) { unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10); unsigned long lowmem_pages = 0; diff -L mm/page_alloc.c.save -puN /dev/null /dev/null _