linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: lsf-pc@lists.linux-foundation.org
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: LSF/MM/BPF TOPIC] Deferred folio splitting: extend or remove/replace?
Date: Mon, 23 Feb 2026 12:26:10 +0100	[thread overview]
Message-ID: <71247244-73fe-44ce-ab05-69c852f3aa1a@kernel.org> (raw)
In-Reply-To: <9d5af75e-e41d-4052-bade-8e51c9622523@kernel.org>

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.

-- 
Cheers,

David


           reply	other threads:[~2026-02-23 11:26 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <9d5af75e-e41d-4052-bade-8e51c9622523@kernel.org>]

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=71247244-73fe-44ce-ab05-69c852f3aa1a@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