mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/3] drm/ttm: allow direct reclaim to be skipped
@ 2025-09-18 20:09 Thadeu Lima de Souza Cascardo
  2025-09-18 20:09 ` [PATCH RFC v2 1/3] ttm: pool: allow requests to prefer latency over throughput Thadeu Lima de Souza Cascardo
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2025-09-18 20:09 UTC (permalink / raw)
  To: Christian Koenig, Michel Dänzer, Huang Rui, Matthew Auld,
	Matthew Brost, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, kernel-dev, Tvrtko Ursulin,
	Sergey Senozhatsky, Thadeu Lima de Souza Cascardo

On certain workloads, like on ChromeOS when opening multiple tabs and
windows, and switching desktops, memory pressure can build up and latency
is observed as high order allocations result in memory reclaim. This was
observed when running on an amdgpu.

This is caused by TTM pool allocations and turning off direct reclaim when
doing those higher order allocations leads to lower memory pressure.

Since turning direct reclaim off might also lead to lower throughput,
make it tunable, both as a module parameter that can be changed in sysfs
and as a flag when allocating a GEM object.

A latency option will avoid direct reclaim for higher order allocations.

The throughput option could be later used to more agressively compact pages
or reclaim, by not using __GFP_NORETRY.

Other drivers can later opt to use this mechanism too.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
Changes in v2:
- Make disabling direct reclaim an option.
- Link to v1: https://lore.kernel.org/r/20250910-ttm_pool_no_direct_reclaim-v1-1-53b0fa7f80fa@igalia.com

---
Thadeu Lima de Souza Cascardo (3):
      ttm: pool: allow requests to prefer latency over throughput
      ttm: pool: add a module parameter to set latency preference
      drm/amdgpu: allow allocation preferences when creating GEM object

 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    |  3 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |  3 ++-
 drivers/gpu/drm/ttm/ttm_pool.c             | 23 +++++++++++++++++------
 drivers/gpu/drm/ttm/ttm_tt.c               |  2 +-
 include/drm/ttm/ttm_bo.h                   |  5 +++++
 include/drm/ttm/ttm_pool.h                 |  2 +-
 include/drm/ttm/ttm_tt.h                   |  2 +-
 include/uapi/drm/amdgpu_drm.h              |  9 +++++++++
 8 files changed, 38 insertions(+), 11 deletions(-)
---
base-commit: f83ec76bf285bea5727f478a68b894f5543ca76e
change-id: 20250909-ttm_pool_no_direct_reclaim-ee0807a2d3fe

Best regards,
-- 
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>


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

end of thread, other threads:[~2025-09-19 12:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-18 20:09 [PATCH RFC v2 0/3] drm/ttm: allow direct reclaim to be skipped Thadeu Lima de Souza Cascardo
2025-09-18 20:09 ` [PATCH RFC v2 1/3] ttm: pool: allow requests to prefer latency over throughput Thadeu Lima de Souza Cascardo
2025-09-18 20:09 ` [PATCH RFC v2 2/3] ttm: pool: add a module parameter to set latency preference Thadeu Lima de Souza Cascardo
2025-09-18 20:09 ` [PATCH RFC v2 3/3] drm/amdgpu: allow allocation preferences when creating GEM object Thadeu Lima de Souza Cascardo
2025-09-19  6:46 ` [PATCH RFC v2 0/3] drm/ttm: allow direct reclaim to be skipped Christian König
2025-09-19  7:43   ` Tvrtko Ursulin
2025-09-19  8:01     ` Christian König
2025-09-19  8:46       ` Tvrtko Ursulin
2025-09-19 10:17         ` Christian König
2025-09-19 10:42           ` Tvrtko Ursulin
2025-09-19 12:04             ` Christian König
2025-09-19 11:13       ` Thadeu Lima de Souza Cascardo
2025-09-19 11:39         ` Christian König

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®