mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karim Manaouil <kmanaouil.dev@gmail.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: k.manaouil@gmail.com
Subject: Memory fragmentation and compaction test and evaluation
Date: Wed, 27 May 2026 16:45:56 +0100	[thread overview]
Message-ID: <20260527154556.chak2cd7woi3gagy@wrangler> (raw)

Hi folks,

With mTHP/THP, large block sizes, and increasing adoption of larger
pages in various subsystems (e.g. drm/ttm [1]), there is an increasing
pressure on physical memory contiguity and hence anti-fragmentation,
defragmentation and compaction. This brings attention to revisiting
existing mechanisms in the kernel, especially with the rapidly changing
hardware landscape in terms of memory technology, memory bandwidth,
CPU microarchitecture, CPU core count, interconnects and other factors.

However, it turns out it's extremely hard to evaluate fragmentation,
compaction and huge page availability. The main challenge rests on
reliable reproduction. We need tools and workloads. Specifically,
we need tools that:

	1. Reliably reproduce fragmentation on a system. Preferably
	   with varying degrees and some control over movable vs unmovable.

	2. We need tools/workloads that continously stress the system
	   and continously introduce fragmentation and challenge large
	   block allocation while other workloads are running,
	   preferably without interference between the two.

For memory fragmentation, a famous synthetic way that is widely adopted in
previous patches is allocating massive amout of anonymous/file memory while
an I/O metadata intensive workload is running on paralle to interleave
unmovable slab allocations from the filesystem with movable allocations, for
example by running "find /" or running fio in parallel as is the case with
mmtests/thpchallenge. This addresses point (1) to some extent.

Point (2) remains entirely un-addressed.

It is also important to have real world workloads.

I would love to see how other people address these challenges and how
people here test and evaluate fragmentation and compaction, especially
under sustained pressure. We can always start from a fragmented system
(for example mmtests/thpchallenge way) and run a workload to completion,
but that only tests how the system recovers initially and not how it
copes with continous stress.

Please share you experiences in this thread and share any workloads and
ideas for tools that you think could help in these sorts of development.

[1] https://lore.kernel.org/linux-mm/20260506033300.3534883-1-matthew.brost@intel.com/

Thanks
-- 
~karim

                 reply	other threads:[~2026-05-27 15:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260527154556.chak2cd7woi3gagy@wrangler \
    --to=kmanaouil.dev@gmail.com \
    --cc=k.manaouil@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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

all inboxes | Powered by JetHome®