summaryrefslogtreecommitdiff
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2009-09-21 17:01:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 07:17:25 -0700
commit6fb332fabd7288af9dbe7992394aa6ba97c1a537 (patch)
tree261fe72f01461d65532730f283108be2306b80b5 /mm/page_alloc.c
parent112067f0905b2de862c607ee62411cf47d2fe5c4 (diff)
memory hotplug: exclude isolated page from pco page alloc
Pages marked as isolated should not be allocated again. If such pages reside in pcp list, they can be allocated too, so there is a ping-pong memory offline frees some pages to pcp list and the pages get allocated and then memory offline frees them again, this loop will happen again and again. This should have no impact in normal code path, because in normal code path, pages in pcp list aren't isolated, and below loop will break in the first entry. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Yakui Zhao <yakui.zhao@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 1a3a893ef50e..8a8302711725 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1143,10 +1143,20 @@ again:
/* Allocate more to the pcp list if necessary */
if (unlikely(&page->lru == &pcp->list)) {
+ int get_one_page = 0;
+
pcp->count += rmqueue_bulk(zone, 0,
pcp->batch, &pcp->list,
migratetype, cold);
- page = list_entry(pcp->list.next, struct page, lru);
+ list_for_each_entry(page, &pcp->list, lru) {
+ if (get_pageblock_migratetype(page) !=
+ MIGRATE_ISOLATE) {
+ get_one_page = 1;
+ break;
+ }
+ }
+ if (!get_one_page)
+ goto failed;
}
list_del(&page->lru);