From 5322cce29ce5059eed0010f0f04ab36a83611935 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Tue, 31 Jul 2012 16:42:59 -0700 Subject: [PATCH] --- yaml --- r: 320792 b: refs/heads/master c: 97d255c816946388bab504122937730d3447c612 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 902bae007af9..488913da6b5e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: de34d965a80d0f61a354bdefa0b15a88bcff2028 +refs/heads/master: 97d255c816946388bab504122937730d3447c612 diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 18747528eec3..bb790f5919e3 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -5500,11 +5500,18 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) continue; page = pfn_to_page(check); - if (!page_count(page)) { + /* + * We can't use page_count without pin a page + * because another CPU can free compound page. + * This check already skips compound tails of THP + * because their page->_count is zero at all time. + */ + if (!atomic_read(&page->_count)) { if (PageBuddy(page)) iter += (1 << page_order(page)) - 1; continue; } + if (!PageLRU(page)) found++; /*