diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2011-05-24 20:12:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:22 -0400 |
commit | 700c2a46e88265326764197d5b8842490bae5569 (patch) | |
tree | 65f02f083e5eebfab0296499318e5a40992116a9 /mm | |
parent | 22943ab116af1ead4dc112ec408a93cf1365b34a (diff) |
mem-hotplug: call isolate_lru_page with elevated refcount
isolate_lru_page() must be called only with stable reference to page. So,
let's grab normal page reference.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory_hotplug.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 59ac18fefd65..89b0391f14a8 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -706,7 +706,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) | |||
706 | if (!pfn_valid(pfn)) | 706 | if (!pfn_valid(pfn)) |
707 | continue; | 707 | continue; |
708 | page = pfn_to_page(pfn); | 708 | page = pfn_to_page(pfn); |
709 | if (!page_count(page)) | 709 | if (!get_page_unless_zero(page)) |
710 | continue; | 710 | continue; |
711 | /* | 711 | /* |
712 | * We can skip free pages. And we can only deal with pages on | 712 | * We can skip free pages. And we can only deal with pages on |
@@ -714,6 +714,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) | |||
714 | */ | 714 | */ |
715 | ret = isolate_lru_page(page); | 715 | ret = isolate_lru_page(page); |
716 | if (!ret) { /* Success */ | 716 | if (!ret) { /* Success */ |
717 | put_page(page); | ||
717 | list_add_tail(&page->lru, &source); | 718 | list_add_tail(&page->lru, &source); |
718 | move_pages--; | 719 | move_pages--; |
719 | inc_zone_page_state(page, NR_ISOLATED_ANON + | 720 | inc_zone_page_state(page, NR_ISOLATED_ANON + |
@@ -725,6 +726,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) | |||
725 | pfn); | 726 | pfn); |
726 | dump_page(page); | 727 | dump_page(page); |
727 | #endif | 728 | #endif |
729 | put_page(page); | ||
728 | /* Because we don't have big zone->lock. we should | 730 | /* Because we don't have big zone->lock. we should |
729 | check this again here. */ | 731 | check this again here. */ |
730 | if (page_count(page)) { | 732 | if (page_count(page)) { |