Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Rogerio Lucas <rogeriolucas@gmail.com>
To: Natalie Vock <nat@pixelcluster.dev>,
	Arun Pravin <arunpravin.paneerselvam@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	Matthew Brost <matthew.brost@intel.com>
Cc: "Rogerio Lucas" <rogeriolucas@gmail.com>,
	"Huang Rui" <ray.huang@amd.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org, regressions@lists.linux.dev,
	stable@vger.kernel.org
Subject: [PATCH] Revert "drm/ttm/pool: Try harder for beneficial orders"
Date: Fri,  4 Dec 2026 23:44:57 -0300	[thread overview]
Message-ID: <20261205024457.1581691-2-rogeriolucas@gmail.com> (raw)
In-Reply-To: <20261205024457.1581691-1-rogeriolucas@gmail.com>

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


           reply	other threads:[~2026-12-05  2:56 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20261205024457.1581691-1-rogeriolucas@gmail.com>]

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=20261205024457.1581691-2-rogeriolucas@gmail.com \
    --to=rogeriolucas@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arunpravin.paneerselvam@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=nat@pixelcluster.dev \
    --cc=ray.huang@amd.com \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /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