* [PATCH] Revert "drm/ttm/pool: Try harder for beneficial orders"
[not found] <20261205024457.1581691-1-rogeriolucas@gmail.com>
@ 2026-12-05 2:44 ` Rogerio Lucas
0 siblings, 0 replies; only message in thread
From: Rogerio Lucas @ 2026-12-05 2:44 UTC (permalink / raw)
To: Natalie Vock, Arun Pravin, Christian Koenig, Matthew Brost
Cc: Rogerio Lucas, Huang Rui, Matthew Auld, Thomas Hellström,
Alex Deucher, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
dri-devel, amd-gfx, intel-xe, regressions, stable
This reverts commit dd8dde5745eaf7509d5565d539d0c0bf4148bfe7.
With __GFP_RETRY_MAYFAIL instead of __GFP_NORETRY, an allocation at the
beneficial order no longer fails fast when compaction cannot form a
block. It enters direct reclaim and the reclaim/compaction retry loops,
for every chunk of every new BO.
amdgpu sets the beneficial order to 2 MiB, and on APUs most BOs are
system memory. On a Radeon 610M with fragmented memory, the compositor
enters direct reclaim at order 9 from amdgpu_gem_create_ioctl(), and the
cursor and window switching stall. Seen on distribution kernels, with
kwin_wayland and plasmashell on 7.3-rc4 and with gnome-shell on 7.3.5:
87 direct reclaims in 15 s, all order 9 with gfp_flags 0x386dc2, the
gnome-shell cgroup spending up to 514 ms of each second stalled on
memory with its main thread running in reclaim and compaction rather
than blocked.
With one page pinned per pageblock on 7.3-rc6, 64 order-9 allocations
with the TTM flags took 12 ms at the median and up to 321 ms with this
commit, against 0.1 ms without it. Each run reclaimed about 280 MiB
directly, pushed about 0.4 GiB to swap, and the retries got one 2 MiB
page in 128 attempts.
Fixes: dd8dde5745ea ("drm/ttm/pool: Try harder for beneficial orders")
Cc: stable@vger.kernel.org # v7.3+
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: dri-devel@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Signed-off-by: Rogerio Lucas <rogeriolucas@gmail.com>
---
drivers/gpu/drm/ttm/ttm_pool.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index 1bf37023..48a7d5b6 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -183,11 +183,6 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
if (order && beneficial_order && order != beneficial_order)
gfp_flags &= ~__GFP_RECLAIM;
- if (beneficial_order && order == beneficial_order) {
- gfp_flags &= ~__GFP_NORETRY;
- gfp_flags |= __GFP_RETRY_MAYFAIL;
- }
-
if (!ttm_pool_uses_dma_alloc(pool)) {
p = alloc_pages_node(pool->nid, gfp_flags, order);
if (p) {
--
2.56.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-05 2:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261205024457.1581691-1-rogeriolucas@gmail.com>
2026-12-05 2:44 ` [PATCH] Revert "drm/ttm/pool: Try harder for beneficial orders" Rogerio Lucas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox