All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] drm/ttm: fix excessive idle memory retention
@ 2026-11-24 22:28 Eduardo P. Gomez
  2026-11-24 22:28 ` [RFC PATCH 1/2] drm/ttm: reclaim pooled pages after a period of inactivity Eduardo P. Gomez
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eduardo P. Gomez @ 2026-11-24 22:28 UTC (permalink / raw)
  To: nat, arunpravin.paneerselvam
  Cc: dri-devel, matthew.auld, matthew.brost, thomas.hellstrom,
	Eduardo P. Gomez

I started looking into this after my Intel Xe desktop with 32 GiB of RAM
would eventually freeze following repeated graphics allocations (A test
program allocated around 12 GiB without freeing up). In a
separate test, a standalone kernel module exercised the TTM page pool
directly. On unpatched 7.4-rc4 in a single-node QEMU guest, 768 MiB
remained in the pool 60s after the module returned its pages.

Patch 1 adds a 5s timeout after the last page return. It can
stand on its own and drains the idle pool. In QEMU, the pool was empty
at the eight-second sample. The trade-off is that the next burst may
have to allocate and prepare those pages again.

Patch 2 builds on the timeout and keeps a 128 MiB reserve per NUMA node
to reduce that trade-off. With both patches, the same 768 MiB test left
128 MiB in the pool at the 8s and 60s samples. The
shrinker can still reclaim the reserve under memory pressure.

In a separate QEMU benchmark with a 750ms timeout, the median time to
allocate 128 MiB after expiry was 185ms after a full drain and 0.45ms
with the reserve. A 768 MiB request took 1.13s after a full drain and
0.95s with the reserve. The unpatched kernel kept the entire pool and
reused those 768 MiB in about 2ms. These tests measure idle retention
and allocation latency in QEMU.

The test files can be downloaded at https://codeberg.org/EduApps-CDG/linux-ttm-pool.
It includes 2 C files (one for test and another for benchmark), my logs,
some build/test helping bash scripts and the compiled binary I'm using
on my machine right now.

Feedback and change requests are welcome.

Eduardo P. Gomez (2):
  drm/ttm: reclaim pooled pages after a period of inactivity
  drm/ttm: retain a reserve during idle pool reclaim

 drivers/gpu/drm/ttm/ttm_pool.c | 92 +++++++++++++++++++++++++++++++---
 1 file changed, 85 insertions(+), 7 deletions(-)


base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
-- 
2.55.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-29  3:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 22:28 [RFC PATCH 0/2] drm/ttm: fix excessive idle memory retention Eduardo P. Gomez
2026-11-24 22:28 ` [RFC PATCH 1/2] drm/ttm: reclaim pooled pages after a period of inactivity Eduardo P. Gomez
2026-11-25  9:04   ` sashiko-bot
2026-11-24 22:28 ` [RFC PATCH 2/2] drm/ttm: retain a reserve during idle pool reclaim Eduardo P. Gomez
2026-11-25  9:00   ` sashiko-bot
2026-11-25 10:14 ` [RFC PATCH 0/2] drm/ttm: fix excessive idle memory retention Thomas Hellström
2026-11-25 13:27   ` Eduardo P. Gomez
2026-11-25 15:47     ` Thomas Hellström
2026-11-25 19:36       ` Eduardo P. Gomez
2026-11-26 10:35         ` Thomas Hellström
2026-11-29  3:46           ` Eduardo P. Gomez

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.