linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Idle THPs
@ 2021-06-10  3:43 Matthew Wilcox
  2021-06-14  8:16 ` SeongJae Park
       [not found] ` <59f61523-cb38-bf8c-51ba-1017ea7212d2@google.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Wilcox @ 2021-06-10  3:43 UTC (permalink / raw)
  To: Vladimir Davydov, Kirill A. Shutemov, Hugh Dickins, linux-mm

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?



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-17 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-10  3:43 Idle THPs Matthew Wilcox
2021-06-14  8:16 ` SeongJae Park
     [not found] ` <59f61523-cb38-bf8c-51ba-1017ea7212d2@google.com>
     [not found]   ` <CAHbLzkrznNBhGHZCN-Pf=1tUK+9Ad0TEXkC_fwDNcjceDt3vuw@mail.gmail.com>
2021-06-17 15:57     ` Shakeel Butt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).