summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2026-06-12 15:57:57 -0700
committerMatthew Brost <matthew.brost@intel.com>2026-06-13 17:30:33 -0700
commita56a73ec85c81c7e533bc249ff0fd996256053fd (patch)
treee482aa746e5bd8c003b701dec45830611165d401
parent2afdfc658f7a7e9ee2a67ec6663922da9c799c53 (diff)
downloadlinux-a56a73ec85c81c7e533bc249ff0fd996256053fd.tar.gz
linux-a56a73ec85c81c7e533bc249ff0fd996256053fd.zip
drm/ttm: Issue direct reclaim at beneficial_order
Triggering kswap at an order higher than beneficial_order makes little sense, as the driver has already indicated the optimal order at which reclaim is effective. Similarly, issuing direct reclaim or triggering kswap at a lower order than beneficial_order is ineffective, since the driver does not benefit from reclaiming lower-order pages. As a result, direct reclaim should only be issued with __GFP_NORETRY at exactly beneficial_order, or as a fallback, direct reclaim without __GFP_NORETRY at order 0 when failure is not an option. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Christian Koenig <christian.koenig@amd.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patch.msgid.link/20260612225757.3844350-1-matthew.brost@intel.com
-rw-r--r--drivers/gpu/drm/ttm/ttm_pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index 278bbe7a11ad..e76c3a5c67bd 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -165,8 +165,8 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
* Do not add latency to the allocation path for allocations orders
* device tolds us do not bring them additional performance gains.
*/
- if (beneficial_order && order > beneficial_order)
- gfp_flags &= ~__GFP_DIRECT_RECLAIM;
+ if (order && beneficial_order && order != beneficial_order)
+ gfp_flags &= ~__GFP_RECLAIM;
if (!ttm_pool_uses_dma_alloc(pool)) {
p = alloc_pages_node(pool->nid, gfp_flags, order);