From: "T.J. Mercier" <tjmercier@google.com>
To: tjmercier@google.com, Tejun Heo <tj@kernel.org>,
Zefan Li <lizefan.x@bytedance.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: daniel@ffwll.ch, hridya@google.com, christian.koenig@amd.com,
jstultz@google.com, tkjos@android.com, cmllamas@google.com,
surenb@google.com, kaleshsingh@google.com, Kenny.Ho@amd.com,
mkoutny@suse.com, skhan@linuxfoundation.org,
kernel-team@android.com, cgroups@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v7 1/6] gpu: rfc: Proposal for a GPU cgroup controller
Date: Tue, 10 May 2022 23:56:45 +0000 [thread overview]
Message-ID: <20220510235653.933868-2-tjmercier@google.com> (raw)
In-Reply-To: <20220510235653.933868-1-tjmercier@google.com>
From: Hridya Valsaraju <hridya@google.com>
This patch adds a proposal for a new GPU cgroup controller for
accounting/limiting GPU and GPU-related memory allocations.
The proposed controller is based on the DRM cgroup controller[1] and
follows the design of the RDMA cgroup controller.
The new cgroup controller would:
* Allow setting per-device limits on the total size of buffers
allocated by device within a cgroup.
* Expose a per-device/allocator breakdown of the buffers charged to a
cgroup.
The prototype in the following patches is only for memory accounting
using the GPU cgroup controller and does not implement limit setting.
[1]: https://lore.kernel.org/amd-gfx/20210126214626.16260-1-brian.welty@intel.com/
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Signed-off-by: T.J. Mercier <tjmercier@google.com>
---
v7 changes
Remove comment about duplicate name rejection which is not relevant to
cgroups users per Michal Koutn√Ω.
v6 changes
Move documentation into cgroup-v2.rst per Tejun Heo.
v5 changes
Drop the global GPU cgroup "total" (sum of all device totals) portion
of the design since there is no currently known use for this per
Tejun Heo.
Update for renamed functions/variables.
v3 changes
Remove Upstreaming Plan from gpu-cgroup.rst per John Stultz.
Use more common dual author commit message format per John Stultz.
---
Documentation/admin-guide/cgroup-v2.rst | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 69d7a6983f78..2e1d26e327c7 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -2352,6 +2352,29 @@ first, and stays charged to that cgroup until that resource is freed. Migrating
a process to a different cgroup does not move the charge to the destination
cgroup where the process has moved.
+
+GPU
+---
+
+The GPU controller accounts for device and system memory allocated by the GPU
+and related subsystems for graphics use. Resource limits are not currently
+supported.
+
+GPU Interface Files
+~~~~~~~~~~~~~~~~~~~~
+
+ gpu.memory.current
+ A read-only file containing memory allocations in flat-keyed format. The key
+ is a string representing the device name. The value is the size of the memory
+ charged to the device in bytes. The device names are globally unique.::
+
+ $ cat /sys/kernel/fs/cgroup1/gpu.memory.current
+ dev1 4194304
+ dev2 104857600
+
+ The device name string is set by a device driver when it registers with the
+ GPU cgroup controller to participate in resource accounting.
+
Others
------
--
2.36.0.512.ge40c2bad7a-goog
next prev parent reply other threads:[~2022-05-10 23:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 23:56 [PATCH v7 0/6] Proposal for a GPU cgroup controller T.J. Mercier
2022-05-10 23:56 ` T.J. Mercier [this message]
[not found] ` <20220510235653.933868-1-tjmercier-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-05-10 23:56 ` [PATCH v7 2/6] cgroup: gpu: Add a cgroup controller for allocator attribution of GPU memory T.J. Mercier
2022-05-10 23:56 ` [PATCH v7 4/6] dmabuf: Add gpu cgroup charge transfer function T.J. Mercier
2022-05-11 13:21 ` [PATCH v7 0/6] Proposal for a GPU cgroup controller Nicolas Dufresne
2022-05-11 20:31 ` T.J. Mercier
[not found] ` <CABdmKX3ZV6-u-oLvW_wWavAMBfrsZ=C_rCgK_Uz4VjxcRvRFew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-05-12 13:09 ` Nicolas Dufresne
2022-05-13 3:43 ` T.J. Mercier
2022-05-13 16:13 ` Tejun Heo
2022-05-17 23:30 ` T.J. Mercier
2022-05-20 7:47 ` Tejun Heo
2022-05-20 16:25 ` T.J. Mercier
2022-06-15 17:31 ` T.J. Mercier
[not found] ` <CABdmKX0WV8VWgeafVGJ++nJ4xsJD7Wpz=3KX=BW1du=huttfvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-06-24 20:17 ` Daniel Vetter
[not found] ` <YrYbwu0iIAJJGXVg-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2022-06-24 20:32 ` John Stultz
[not found] ` <CANDhNCqGjaq-SFvWwkqnEFj4tJcRqCYupZ03wLyCexqTH5MqMg@mail.gmail.com>
[not found] ` <CANDhNCqGjaq-SFvWwkqnEFj4tJcRqCYupZ03wLyCexqTH5MqMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-06-24 20:36 ` Daniel Vetter
[not found] ` <YrYgWCTtZqfvCt5D-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2022-06-24 21:17 ` T.J. Mercier
2022-05-19 9:30 ` [PATCH v7 1/6] gpu: rfc: " eballetbo
[not found] ` <20220519093034.541481-1-eballetbo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2022-05-21 2:19 ` T.J. Mercier
2022-05-19 10:52 ` [PATCH v7 2/6] cgroup: gpu: Add a cgroup controller for allocator attribution of GPU memory eballetbo
2022-05-20 16:33 ` T.J. Mercier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220510235653.933868-2-tjmercier@google.com \
--to=tjmercier@google.com \
--cc=Kenny.Ho@amd.com \
--cc=cgroups@vger.kernel.org \
--cc=christian.koenig@amd.com \
--cc=cmllamas@google.com \
--cc=corbet@lwn.net \
--cc=daniel@ffwll.ch \
--cc=hannes@cmpxchg.org \
--cc=hridya@google.com \
--cc=jstultz@google.com \
--cc=kaleshsingh@google.com \
--cc=kernel-team@android.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mkoutny@suse.com \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=tkjos@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox