On Tue, Dec 27, 2022 at 08:27:08PM +0800, Kefeng Wang wrote: > -static struct page *page_idle_get_page(unsigned long pfn) > +static struct folio *page_idle_get_folio(unsigned long pfn) > { > struct page *page = pfn_to_online_page(pfn); > + struct folio *folio; > > - if (!page || !PageLRU(page) || > - !get_page_unless_zero(page)) > + if (!page || !PageLRU(page) || !get_page_unless_zero(page)) > return NULL; Mmmm, no. PageLRU hides a compound_head() call. Try doing this instead: if (!page || PageTail(page)) return NULL; folio = page_folio(page); if (!folio_test_lru(folio) || !folio_try_get(folio)) return NULL; if (page_folio(page) != folio || !folio_test_lru(folio)) { folio_put(folio); folio = NULL; } return NULL;