All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/6] Proposal for a GPU cgroup controller
@ 2022-01-15  1:05 ` Hridya Valsaraju
  0 siblings, 0 replies; 41+ messages in thread
From: Hridya Valsaraju @ 2022-01-15  1:05 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Jonathan Corbet, Greg Kroah-Hartman,
	Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, Sumit Semwal, Benjamin Gaignard, Liam Mark,
	Laura Abbott, Brian Starkey, John Stultz, Christian König,
	Tejun Heo, Zefan Li, Johannes Weiner, Dave Airlie, Matthew Brost,
	Kenneth Graunke, Matthew Auld, Li Li, Marco Ballesio,
	Finn Behrens, Hang Lu, Wedson Almeida Filho, Masahiro Yamada,
	Andrew Morton, Nathan Chancellor, Kees Cook, Nick Desaulniers,
	Miguel Ojeda, Vipin Sharma, Chris Down, Daniel Borkmann,
	Vlastimil Babka, Arnd Bergmann, dri-devel, linux-doc,
	linux-kernel, linux-media, linaro-mm-sig, cgroups
  Cc: Kenny.Ho, daniels, kaleshsingh, tjmercier

This patch series revisits the proposal for a GPU cgroup controller to
track and limit memory allocations by various device/allocator
subsystems. The patch series also contains a simple prototype to
illustrate how Android intends to implement DMA-BUF allocator
attribution using the GPU cgroup controller. The prototype does not
include resource limit enforcements.

History of the GPU cgroup controller
====================================
The GPU/DRM cgroup controller came into being when a consensus[1]
was reached that the resources it tracked were unsuitable to be integrated
into memcg. Originally, the proposed controller was specific to the DRM
subsystem and was intended to track GEM buffers and GPU-specific resources[2].
In order to help establish a unified memory accounting model for all GPU and
all related subsystems, Daniel Vetter put forth a suggestion to move it out of
the DRM subsystem so that it can be used by other DMA-BUF exporters as well[3].
This RFC proposes an interface that does the same.

[1]: https://patchwork.kernel.org/project/dri-devel/cover/20190501140438.9506-1-brian.welty@intel.com/#22624705
[2]: https://lore.kernel.org/amd-gfx/20210126214626.16260-1-brian.welty@intel.com/
[3]: https://lore.kernel.org/amd-gfx/YCVOl8%2F87bqRSQei@phenom.ffwll.local/

Hridya Valsaraju (6):
  gpu: rfc: Proposal for a GPU cgroup controller
  cgroup: gpu: Add a cgroup controller for allocator attribution of GPU
    memory
  dmabuf: heaps: Use the GPU cgroup charge/uncharge APIs
  dma-buf: Add DMA-BUF exporter op to charge a DMA-BUF to a cgroup.
  dmabuf: system_heap: implement dma-buf op for GPU cgroup charge
    transfer
  android: binder: Add a buffer flag to relinquish ownership of fds

 Documentation/gpu/rfc/gpu-cgroup.rst | 192 +++++++++++++++++
 Documentation/gpu/rfc/index.rst      |   4 +
 drivers/android/binder.c             |  32 +++
 drivers/dma-buf/dma-heap.c           |  27 +++
 drivers/dma-buf/heaps/system_heap.c  |  68 ++++++
 include/linux/cgroup_gpu.h           | 120 +++++++++++
 include/linux/cgroup_subsys.h        |   4 +
 include/linux/dma-buf.h              |  18 ++
 include/linux/dma-heap.h             |  11 +
 include/uapi/linux/android/binder.h  |   1 +
 init/Kconfig                         |   7 +
 kernel/cgroup/Makefile               |   1 +
 kernel/cgroup/gpu.c                  | 305 +++++++++++++++++++++++++++
 13 files changed, 790 insertions(+)
 create mode 100644 Documentation/gpu/rfc/gpu-cgroup.rst
 create mode 100644 include/linux/cgroup_gpu.h
 create mode 100644 kernel/cgroup/gpu.c

-- 
2.34.1.703.g22d0c6ccf7-goog


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

end of thread, other threads:[~2022-01-19 18:25 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15  1:05 [RFC 0/6] Proposal for a GPU cgroup controller Hridya Valsaraju
2022-01-15  1:05 ` Hridya Valsaraju
2022-01-15  1:05 ` Hridya Valsaraju
2022-01-15  1:05 ` [RFC 1/6] gpu: rfc: " Hridya Valsaraju
2022-01-15  1:05   ` Hridya Valsaraju
2022-01-15  1:06 ` [RFC 2/6] cgroup: gpu: Add a cgroup controller for allocator attribution of GPU memory Hridya Valsaraju
2022-01-15  1:06   ` Hridya Valsaraju
     [not found]   ` <20220115010622.3185921-3-hridya-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-01-19 15:40     ` Randy Dunlap
2022-01-19 15:40   ` Randy Dunlap
2022-01-19 15:40     ` Randy Dunlap
2022-01-19 18:24     ` Hridya Valsaraju
2022-01-19 18:24       ` Hridya Valsaraju
2022-01-19 18:24       ` Hridya Valsaraju
2022-01-15  1:06 ` [RFC 3/6] dmabuf: heaps: Use the GPU cgroup charge/uncharge APIs Hridya Valsaraju
2022-01-15  1:06   ` Hridya Valsaraju
     [not found] ` <20220115010622.3185921-1-hridya-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-01-15  1:05   ` [RFC 1/6] gpu: rfc: Proposal for a GPU cgroup controller Hridya Valsaraju
2022-01-15  1:06   ` [RFC 2/6] cgroup: gpu: Add a cgroup controller for allocator attribution of GPU memory Hridya Valsaraju
2022-01-15  1:06   ` [RFC 3/6] dmabuf: heaps: Use the GPU cgroup charge/uncharge APIs Hridya Valsaraju
2022-01-15  1:06   ` [RFC 4/6] dma-buf: Add DMA-BUF exporter op to charge a DMA-BUF to a cgroup Hridya Valsaraju
2022-01-15  1:06   ` [RFC 6/6] android: binder: Add a buffer flag to relinquish ownership of fds Hridya Valsaraju
2022-01-15  1:06 ` [RFC 4/6] dma-buf: Add DMA-BUF exporter op to charge a DMA-BUF to a cgroup Hridya Valsaraju
2022-01-15  1:06   ` Hridya Valsaraju
2022-01-17  7:46   ` Christian König
2022-01-17  7:46     ` Christian König
2022-01-18 18:54     ` Hridya Valsaraju
2022-01-18 18:54       ` Hridya Valsaraju
2022-01-18 18:54       ` Hridya Valsaraju
2022-01-19 15:54       ` Daniel Vetter
2022-01-19 15:54         ` Daniel Vetter
2022-01-19 15:54         ` Daniel Vetter
2022-01-19 15:58         ` Christian König
2022-01-19 18:21           ` Hridya Valsaraju
2022-01-19 18:21             ` Hridya Valsaraju
2022-01-19 18:21             ` Hridya Valsaraju
     [not found]         ` <Yeg0GGi0tdnnCLHg-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2022-01-19 15:58           ` Christian König
     [not found]   ` <20220115010622.3185921-5-hridya-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-01-17  7:46     ` Christian König
2022-01-15  1:06 ` [RFC 5/6] dmabuf: system_heap: implement dma-buf op for GPU cgroup charge transfer Hridya Valsaraju
2022-01-15  1:06   ` Hridya Valsaraju
2022-01-15  1:06   ` Hridya Valsaraju
2022-01-15  1:06 ` [RFC 6/6] android: binder: Add a buffer flag to relinquish ownership of fds Hridya Valsaraju
2022-01-15  1:06   ` Hridya Valsaraju

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.