All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] GPU memory tracepoints
@ 2021-10-21  3:10 Gurchetan Singh
  2021-10-21  3:10 ` [RFC PATCH 1/8] tracing/gpu: modify gpu_mem_total Gurchetan Singh
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Gurchetan Singh @ 2021-10-21  3:10 UTC (permalink / raw)
  To: dri-devel; +Cc: kaleshsingh, daniel, rostedt

This is latest iteration of GPU memory tracepoints [1].

In the past, there were questions about the "big picture" of memory  
accounting [2], especially given related work on dma-buf heaps and DRM
cgroups [3].  Also, there was a desire for a non-driver specific solution.

The great news is the dma-buf heaps work as recently landed [4].  It uses
sys-fs and the plan is to use it in conjunction with the tracepoint
solution [5].  We're aiming for the GPU tracepoint to calculate totals
per DRM-instance (a proxy for per-process on Android) and per-DRM device.

The cgroups work looks terrific too and hopefully we can deduplicate code once
that's merged.  Though that's abit of an implementation detail, so long as
the "GPU tracepoints" +  "dma-buf heap stats" plan sounds good for Android.

This series modifies the GPU memory tracepoint API in a non-breaking fashion
(patch 1), and adds accounting via the GEM subsystem (patches 2 --> 7). Given
the multiple places where memory events happen, there's a bunch trace events
scattered in various places.  The hardest part is allocation, where each driver
has their own API.  If there's a better way, do say so.

The last patch is incomplete; we would like general feedback before proceeding
further.

[1] https://lore.kernel.org/lkml/20200302235044.59163-1-zzyiwei@google.com/
[2] https://lists.freedesktop.org/archives/dri-devel/2021-January/295120.html
[3] https://www.spinics.net/lists/cgroups/msg27867.html
[4] https://www.spinics.net/lists/linux-doc/msg97788.html
[5] https://source.android.com/devices/graphics/implement-dma-buf-gpu-mem

Gurchetan Singh (8):
  tracing/gpu: modify gpu_mem_total
  drm: add new tracepoint fields to drm_device and drm_file
  drm: add helper functions for gpu_mem_total and gpu_mem_instance
  drm: start using drm_gem_trace_gpu_mem_total
  drm: start using drm_gem_trace_gpu_mem_instance
  drm: track real and fake imports in drm_prime_member
  drm: trace memory import per DRM file
  drm: trace memory import per DRM device

 drivers/gpu/drm/Kconfig        |  1 +
 drivers/gpu/drm/drm_gem.c      | 65 +++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/drm_internal.h |  4 +--
 drivers/gpu/drm/drm_prime.c    | 22 +++++++++---
 include/drm/drm_device.h       | 16 +++++++++
 include/drm/drm_file.h         | 16 +++++++++
 include/drm/drm_gem.h          |  7 ++++
 include/trace/events/gpu_mem.h | 61 +++++++++++++++++++++----------
 8 files changed, 166 insertions(+), 26 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-11-17 18:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  3:10 [RFC PATCH 0/8] GPU memory tracepoints Gurchetan Singh
2021-10-21  3:10 ` [RFC PATCH 1/8] tracing/gpu: modify gpu_mem_total Gurchetan Singh
2021-10-21 11:56   ` Daniel Vetter
2021-10-21 13:07     ` Steven Rostedt
2021-10-28 15:21       ` Daniel Vetter
2021-10-21  3:10 ` [RFC PATCH 2/8] drm: add new tracepoint fields to drm_device and drm_file Gurchetan Singh
2021-10-21  3:10 ` [RFC PATCH 3/8] drm: add helper functions for gpu_mem_total and gpu_mem_instance Gurchetan Singh
2021-10-21  3:10 ` [RFC PATCH 4/8] drm: start using drm_gem_trace_gpu_mem_total Gurchetan Singh
2021-10-21  3:49   ` Steven Rostedt
2021-10-21  3:10 ` [RFC PATCH 5/8] drm: start using drm_gem_trace_gpu_mem_instance Gurchetan Singh
2021-10-21  3:50   ` Steven Rostedt
2021-11-05  8:24   ` [drm] a31246115b: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2021-11-05  8:24     ` kernel test robot
2021-10-21  3:10 ` [RFC PATCH 6/8] drm: track real and fake imports in drm_prime_member Gurchetan Singh
2021-10-21  3:10 ` [RFC PATCH 7/8] drm: trace memory import per DRM file Gurchetan Singh
2021-10-21  3:10 ` [RFC PATCH 8/8] drm: trace memory import per DRM device Gurchetan Singh
2021-10-21 12:00 ` [RFC PATCH 0/8] GPU memory tracepoints Daniel Vetter
2021-10-21 22:38   ` Kalesh Singh
2021-11-01 18:54     ` Kalesh Singh
2021-11-17 18:06       ` Kalesh Singh

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.