[PATCH 1/9] mm: move some functions from memory_hotplug.c to page_isolation.c
From: akpm@linux-foundation.org (Andrew Morton)
Date: 2011-10-14 23:23:25
Also in:
linux-media, linux-mm, lkml
On Thu, 06 Oct 2011 15:54:41 +0200 Marek Szyprowski [off-list ref] wrote:
From: KAMEZAWA Hiroyuki <redacted> Memory hotplug is a logic for making pages unused in the specified range of pfn. So, some of core logics can be used for other purpose as allocating a very large contigous memory block. This patch moves some functions from mm/memory_hotplug.c to mm/page_isolation.c. This helps adding a function for large-alloc in page_isolation.c with memory-unplug technique. Signed-off-by: KAMEZAWA Hiroyuki <redacted> [m.nazarewicz: reworded commit message] Signed-off-by: Michal Nazarewicz <redacted> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [m.szyprowski: rebased and updated to Linux v3.0-rc1] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> CC: Michal Nazarewicz <redacted> Acked-by: Arnd Bergmann <arnd@arndb.de> ... +/* + * For migration. + */ + +int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn);
This is a rather poor function name. Given that we're now making it a global identifier, perhaps we should give it a better name. pages_in_single_zone()?
quoted hunk ↗ jump to hunk
+unsigned long scan_lru_pages(unsigned long start, unsigned long end); +int do_migrate_range(unsigned long start_pfn, unsigned long end_pfn); ...--- a/mm/page_isolation.c +++ b/mm/page_isolation.c@@ -5,6 +5,9 @@ #include <linux/mm.h> #include <linux/page-isolation.h> #include <linux/pageblock-flags.h> +#include <linux/memcontrol.h> +#include <linux/migrate.h> +#include <linux/mm_inline.h> #include "internal.h" static inline struct page *@@ -139,3 +142,114 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) spin_unlock_irqrestore(&zone->lock, flags); return ret ? 0 : -EBUSY; } + + +/* + * Confirm all pages in a range [start, end) is belongs to the same zone.
It would be good to fix up that sentence while we're touching it. "Confirm that all pages ... belong to the same zone".
...