From e297fb4e603dbc776564b907614ed40710f795c6 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Fri, 20 Jan 2012 14:33:55 -0800 Subject: [PATCH] --- yaml --- r: 286594 b: refs/heads/master c: 687875fb7de4a95223af20ee024282fa9099f860 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 528f99de2381..122ec76e7b97 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6536e3123e5d3371a6f52e32a3d0694bcc987702 +refs/heads/master: 687875fb7de4a95223af20ee024282fa9099f860 diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 0027d8f4a1bb..21c272d517bc 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -5414,6 +5414,17 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) bool is_pageblock_removable_nolock(struct page *page) { struct zone *zone = page_zone(page); + unsigned long pfn = page_to_pfn(page); + + /* + * We have to be careful here because we are iterating over memory + * sections which are not zone aware so we might end up outside of + * the zone but still within the section. + */ + if (!zone || zone->zone_start_pfn > pfn || + zone->zone_start_pfn + zone->spanned_pages <= pfn) + return false; + return __count_immobile_pages(zone, page, 0); }