linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Yu Zhao <yuzhao@google.com>
Cc: lsf-pc@lists.linux-foundation.org, Linux-MM <linux-mm@kvack.org>,
	Yang Shi <shy828301@gmail.com>,
	"Yin, Fengwei" <fengwei.yin@intel.com>,
	Hugh Dickins <hughd@google.com>,
	"Kirill A . Shutemov" <kirill@shutemov.name>
Subject: Re: [LSF/MM/BPF TOPIC] Flexible orders for anonymous folios
Date: Thu, 23 Feb 2023 04:01:27 +0000	[thread overview]
Message-ID: <Y/blF0GIunm+pRIC@casper.infradead.org> (raw)
In-Reply-To: <CAOUHufYEj+pYK7tO4JGJx80xYsFdgGcHzMjqr5tJnYuuf7YG7w@mail.gmail.com>

On Wed, Feb 22, 2023 at 04:55:20PM -0700, Yu Zhao wrote:
> Currently anonymous folios only support two orders: 0 and the PMD
> order. Flexible orders for anonymous folios can resist both internal
> or external fragmentations when the PMD order is too underutilized or
> costly to allocate. Flexible orders can also leverage the TLB
> coalescing feature, .e.g., order 3 for AMD and order 4 for ARM CPUs.
> 
> Discussion points:
> 1. The page fault path: determining the best order and the fallback policy.
> 2. The reclaim path: detecting the utilization and the splitting policy.
> 3. The refcount and the mapcount models, e.g., reuse the PMD-mapped
> THP model or not.
> 4. The splitting, and the collapsing if needed.
> 5. Other paths: COW, GUP, madvise(), mprotect(), page migration, etc.

6. Swap out an entire folio instead of splitting it before swap.
7. At some point we're going to want Zi Yan's patches to split a folio
   into arbitrary order folios instead of just to order-0.
8. For file folios, folio->index % folio->nr_pages is 0.  Do we want
   to maintain that invariant for anon folios?  It helps tile the
   folios so we don't end up with say, order-0, order-4, order-2 folios
   in a sequence.
9. How do we ensure that two page faults do not overwrite each others
   folios, eg PF1 decides to allocate an order-0 folio at index 6 and
   PF2 decides to allocate an order-2 folio at index 4?

Probably some other things left to decide.

> Now it seems to be a good time to revisit. Yang Shi and I have been
> looking at some details, trying to scope out the work that would be
> required. We don't have anything definitive yet, but we should have
> enough to share by the time of the LSF/MM/BPF.

Excellent.  There are other people also interested in this.  eg:

Ryan Roberts: https://lore.kernel.org/linux-mm/4c991dcb-c5bb-86bb-5a29-05df24429607@arm.com/
Fengwei Yin: https://lore.kernel.org/linux-mm/20230109072232.2398464-1-fengwei.yin@intel.com/

Obviously I'm keenly interested.
https://lore.kernel.org/linux-mm/Y%2FU8bQd15aUO97vS@casper.infradead.org/

This is definitely worth its own session in the MM track.


  parent reply	other threads:[~2023-02-23  4:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 23:55 [LSF/MM/BPF TOPIC] Flexible orders for anonymous folios Yu Zhao
2023-02-23  0:16 ` Suren Baghdasaryan
2023-02-23  4:01 ` Matthew Wilcox [this message]
2023-02-23  4:45   ` Yin, Fengwei
2023-02-23 18:07   ` Yang Shi
2023-03-01 10:35   ` Ryan Roberts
2023-03-06 20:57   ` Zi Yan
2023-02-24 20:34 ` Jason Gunthorpe
2023-02-26  1:30 ` Hillf Danton
2023-02-26  2:34   ` Matthew Wilcox
2023-02-26  4:12     ` Hillf Danton
2023-02-27  0:58       ` Hillf Danton
2023-03-01 23:29 ` Chris Li
2023-03-02  4:05 ` Yu Zhao

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=Y/blF0GIunm+pRIC@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=fengwei.yin@intel.com \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=shy828301@gmail.com \
    --cc=yuzhao@google.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 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).