Idle THPs
From: Matthew Wilcox <willy@infradead.org>
Date: 2021-06-10 03:43:54
As part of the folio work, I'm looking at PageIdle and PageYoung and
they're defined to operate on PF_ANY. So, for example, in
pagecache_get_page(), we will call clear_page_idle() on the head page
(actually, I changed this in a8cf7f272b5a -- before, it would call
clear_page_idle() on the tail page).
However, we never actually call set_page_idle() on tail pages. This is
because we only call it here:
page = page_idle_get_page(pfn);
if (page) {
page_idle_clear_pte_refs(page);
set_page_idle(page);
put_page(page);
}
where page_idle_get_page() does:
struct page *page = pfn_to_online_page(pfn);
if (!page || !PageLRU(page) ||
!get_page_unless_zero(page))
return NULL;
get_page_unless_zero() will always fail for tail pages (as it uses
page_ref_add_unless(), which does not redirect to the head page's
refcount). So all tail pages read back as !idle in
page_idle_bitmap_read(). Is this intended? Should they rather
mirror the state of their head page?