From: "David Hildenbrand (Arm)" <david@kernel.org>
To: lsf-pc@lists.linux-foundation.org
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: LSF/MM/BPF TOPIC] Deferred folio splitting: extend or remove/replace?
Date: Fri, 8 May 2026 14:05:16 +0200 [thread overview]
Message-ID: <4da9d106-deef-4a82-add5-cadc929b0057@kernel.org> (raw)
In-Reply-To: <71247244-73fe-44ce-ab05-69c852f3aa1a@kernel.org>
On 2/23/26 12:26, David Hildenbrand (Arm) wrote:
> Hi,
>
> the "deferred" folio splitting mechanism was originally introduced to reclaim
> memory from partially-mapped anonymous THPs under memory pressure. Partially-
> mapped anonymous folios (often) guarantee that at least some memory can get
> reclaimed easily.
>
> Ever since, we extended it to also handle smaller large folios (mTHPs),
> but also to scan for mostly-zero-filled mTHPs that can be reclaimed by replacing
> them with the shared zeropage.
>
> Nowadays, each and every (m)THP we allocate gets added to the deferred split
> list as default, as "split_underused_thp = true", which is rather suboptimal.
>
> Historically, handling deferred splits has been rather complicated and error-prone.
>
> So I've been wondering whether that complexity still warranted. Could we instead
> just let LRU scanning deal with that and get rid of the shrinker?
>
> Or could a shrinker instead use existing LRU lists?
>
>
> We could flag folios for being
> * Partially mapped (which we already do)
> * Possibly over-allocated (unscanned for zero since added)
>
> To prioritize processing them.
>
> One of my motivations for looking into this topic is that with
> CONFIG_NO_PAGE_MAPCOUNT, we can sometimes not reliably detect "partially mapped"
> folios and only know that a folio "might be partially mapped". To figure out
> whether it is actually partially-mapped, we have to walk the RMAP.
>
> While I could extend the deferred splitting mechanism to handle such partially-
> mapped folios as well, it would imply taking the deferred split locks more
> frequently when unmapping pages ... not having to mess with another list might
> simplify things.
>
Slides at:
https://share.daveh.de/s/bQsDpD7xigJ6wD8/download?path=&files=LSF_MM%2726_%20Deferred_folio_splitting.pdf
--
Cheers,
David
prev parent reply other threads:[~2026-05-08 12:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9d5af75e-e41d-4052-bade-8e51c9622523@kernel.org>
2026-02-23 11:26 ` LSF/MM/BPF TOPIC] Deferred folio splitting: extend or remove/replace? David Hildenbrand (Arm)
2026-05-08 12:05 ` David Hildenbrand (Arm) [this message]
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=4da9d106-deef-4a82-add5-cadc929b0057@kernel.org \
--to=david@kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
/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