All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Hugh Dickins <hughd@google.com>,
	linux-mm@kvack.org
Subject: Idle THPs
Date: Thu, 10 Jun 2021 04:43:18 +0100	[thread overview]
Message-ID: <YMGKVmt8trMJ9kOP@casper.infradead.org> (raw)

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?



             reply	other threads:[~2021-06-10  3:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  3:43 Matthew Wilcox [this message]
2021-06-14  8:16 ` Idle THPs 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMGKVmt8trMJ9kOP@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=vdavydov.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.