All of lore.kernel.org
 help / color / mirror / Atom feed
* [rfc] drm/ttm/memcg: simplest initial memcg/ttm integration
@ 2025-04-23 21:37 Dave Airlie
  2025-04-23 21:37 ` [PATCH 1/5] memcg: add GPU statistic Dave Airlie
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Dave Airlie @ 2025-04-23 21:37 UTC (permalink / raw)
  To: dri-devel, tj, christian.koenig; +Cc: cgroups

Hey,

I've been tasked to look into this, and I'm going start from hopeless
naivety and see how far I can get. This is an initial attempt to hook
TTM system memory allocations into memcg and account for them.

It does:
1. Adds memcg GPU statistic,
2. Adds TTM memcg pointer for drivers to set on their user object
allocation paths
3. Adds a singular path where we account for memory in TTM on cached
non-pooled non-dma allocations. Cached memory allocations used to be
pooled but we dropped that a while back which makes them the best target
to start attacking this from.
4. It only accounts for memory that is allocated directly from a userspace
TTM operation (like page faults or validation). It *doesn't* account for
memory allocated in eviction paths due to device memory pressure.

This seems to work for me here on my hacked up tests systems at least, I
can see the GPU stats moving and they look sane.

Future work:
Account for pooled non-cached
Account for pooled dma allocations (no idea how that looks)
Figure out if accounting for eviction is possible, and what it might look
like.

Dave.


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

end of thread, other threads:[~2025-04-29  7:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 21:37 [rfc] drm/ttm/memcg: simplest initial memcg/ttm integration Dave Airlie
2025-04-23 21:37 ` [PATCH 1/5] memcg: add GPU statistic Dave Airlie
2025-04-23 21:37 ` [PATCH 2/5] memcg: export stat change function Dave Airlie
2025-04-23 21:37 ` [PATCH 3/5] ttm: add initial memcg integration Dave Airlie
2025-04-23 21:37 ` [PATCH 4/5] amdgpu: add support for " Dave Airlie
2025-04-23 21:37 ` [PATCH 5/5] nouveau: add " Dave Airlie
2025-04-28 10:43 ` [rfc] drm/ttm/memcg: simplest initial memcg/ttm integration Christian König
2025-04-28 16:00   ` Simona Vetter
2025-04-28 19:31   ` Dave Airlie
2025-04-29  7:29     ` Christian König

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.