|
@@ -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++;
|
|
|
/*
|