Re: [RFC PATCH 8/9] drm/gem: Associate GEM objects with drm cgroup

2021-03-18 Thread Brian Welty
On 3/18/2021 3:16 AM, Daniel Vetter wrote: > On Sat, Mar 6, 2021 at 1:44 AM Brian Welty wrote: >> >> >> On 2/11/2021 7:34 AM, Daniel Vetter wrote: >>> On Wed, Feb 10, 2021 at 02:00:57PM -0800, Brian Welty wrote: >>>> >>>> On 2/9/2021 2:54

Re: [RFC PATCH 8/9] drm/gem: Associate GEM objects with drm cgroup

2021-03-05 Thread Brian Welty
On 2/11/2021 7:34 AM, Daniel Vetter wrote: > On Wed, Feb 10, 2021 at 02:00:57PM -0800, Brian Welty wrote: >> >> On 2/9/2021 2:54 AM, Daniel Vetter wrote: >>> On Tue, Jan 26, 2021 at 01:46:25PM -0800, Brian Welty wrote: >>>> This patch adds tracking of which

Re: [RFC PATCH 8/9] drm/gem: Associate GEM objects with drm cgroup

2021-02-10 Thread Brian Welty
On 2/9/2021 2:54 AM, Daniel Vetter wrote: > On Tue, Jan 26, 2021 at 01:46:25PM -0800, Brian Welty wrote: >> This patch adds tracking of which cgroup to make charges against for a >> given GEM object. We associate the current task's cgroup with GEM objects >> as they a

Re: [RFC PATCH 7/9] drmcg: Add initial support for tracking gpu time usage

2021-02-03 Thread Brian Welty
On 2/3/2021 5:25 AM, Joonas Lahtinen wrote: > Quoting Brian Welty (2021-01-26 23:46:24) >> Single control below is added to DRM cgroup controller in order to track >> user execution time for GPU devices. It is up to device drivers to >> charge execution t

Re: [RFC PATCH 0/9] cgroup support for GPU devices

2021-02-01 Thread Brian Welty
On 1/28/2021 7:00 PM, Xingyou Chen wrote: > On 2021/1/27 上午5:46, Brian Welty wrote: > >> We'd like to revisit the proposal of a GPU cgroup controller for managing >> GPU devices but with just a basic set of controls. This series is based on >> the prior patch serie

[RFC PATCH 9/9] drm/i915: Use memory cgroup for enforcing device memory limit

2021-01-26 Thread Brian Welty
emory regions. FIXME: to release drm cgroup reference requires this additional patch: https://patchwork.freedesktop.org/patch/349029 Signed-off-by: Brian Welty --- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_region.c | 23 ++ drivers/gp

[RFC PATCH 6/9] drmcg: Add memory.total file

2021-01-26 Thread Brian Welty
using procfs. memory.total Read-only value, displays total memory for a device, shown only in root cgroup. Signed-off-by: Brian Welty --- Documentation/admin-guide/cgroup-v2.rst | 4 include/drm/drm_cgroup.h| 2 ++ kernel/cgroup/drm.c

[RFC PATCH 4/9] drmcg: Add skeleton seq_show and write for drmcg files

2021-01-26 Thread Brian Welty
-devel/2020-February/254986.html [2] https://lists.freedesktop.org/archives/dri-devel/2020-February/254990.html Co-developed-by: Kenny Ho Signed-off-by: Brian Welty --- include/drm/drm_cgroup.h | 5 ++ kernel/cgroup/drm.c | 102 +++ 2 files changed, 107

[RFC PATCH 3/9] drm, cgroup: Initialize drmcg properties

2021-01-26 Thread Brian Welty
through all existing drm cgroups and initialize them with the new device accordingly. Extending Kenny's original work, this has been simplified some and the custom_init callback has been removed. (Brian) Signed-off-by Kenny Ho Signed-off-by: Brian Welty --- drivers/gpu/drm/drm_drv.c

[RFC PATCH 8/9] drm/gem: Associate GEM objects with drm cgroup

2021-01-26 Thread Brian Welty
sion of "memory ownership", this seems acceptable [1]. [1] https://www.kernel.org/doc/Documentation/cgroup-v2.txt, "Memory Ownership" Signed-off-by: Brian Welty --- drivers/gpu/drm/drm_gem.c | 89 +++ include/drm/drm_gem.h | 17 2 fil

[RFC PATCH 0/9] cgroup support for GPU devices

2021-01-26 Thread Brian Welty
implements i915 changes to use cgroups for device memory charging and enforcing device memory allocation limit. [1] https://lists.freedesktop.org/archives/dri-devel/2020-February/257052.html [2] https://lists.freedesktop.org/archives/dri-devel/2019-November/242599.html Brian Welty (6): drmc

[RFC PATCH 1/9] cgroup: Introduce cgroup for drm subsystem

2021-01-26 Thread Brian Welty
From: Kenny Ho With the increased importance of machine learning, data science and other cloud-based applications, GPUs are already in production use in data centers today. Existing GPU resource management is very coarse grain, however, as sysadmins are only able to distribute workload on a per-

[RFC PATCH 5/9] drmcg: Add support for device memory accounting via page counter

2021-01-26 Thread Brian Welty
ry is already handled by the mm subsystem and existing memory accounting controls. Signed-off-by: Brian Welty --- Documentation/admin-guide/cgroup-v2.rst | 29 - include/drm/drm_cgroup.h| 20 include/linux/cgroup_drm.h | 4 +- kernel/cgroup/

[RFC PATCH 2/9] drm, cgroup: Bind drm and cgroup subsystem

2021-01-26 Thread Brian Welty
From: Kenny Ho Since the drm subsystem can be compiled as a module and drm devices can be added and removed during run time, add several functions to bind the drm subsystem as well as drm devices with drmcg. Two pairs of functions: drmcg_bind/drmcg_unbind - used to bind/unbind the drm subsystem

[RFC PATCH 7/9] drmcg: Add initial support for tracking gpu time usage

2021-01-26 Thread Brian Welty
device. The expectation is that this is incremented by DRM device driver's scheduler upon user context completion or context switch. Units of time are in microseconds for consistency with cpu.stats. Signed-off-by: Brian Welty --- Documentation/admin-guide/cgroup-v2.rst

[RFC PATCH libdrm] intel: Handle GET_TILING errors on unsupported platforms

2019-11-12 Thread Brian Welty
upon receiving that error. [1] https://lists.freedesktop.org/archives/intel-gfx/2019-August/210960.html Signed-off-by: Brian Welty --- intel/intel_bufmgr_gem.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c

Re: [RFC PATCH] cgroup: Document interface files and rationale for DRM controller

2019-11-05 Thread Brian Welty
On 11/4/2019 4:15 PM, Tejun Heo wrote: > On Mon, Nov 04, 2019 at 05:08:47PM -0500, Brian Welty wrote: >> + gpuset.units >> + gpuset.units.effective >> + gpuset.units.partition >> + >> + gpuset.mems >> + gpuset.mems.effective >> + gpuset.mems.par

[RFC PATCH] cgroup: Document interface files and rationale for DRM controller

2019-11-04 Thread Brian Welty
: Brian Welty --- Documentation/admin-guide/cgroup-v2.rst | 89 + 1 file changed, 89 insertions(+) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index 5361ebec3361..2a713059ccbd 100644 --- a/Documentation/admin-guide/cgroup-v2

[PATCH] drm/ttm: Refactor ttm_bo_pipeline_move

2019-08-16 Thread Brian Welty
ttm_bo_pipeline_move needlessly duplicates code. Refactor this to instead call ttm_bo_move_accel_cleanup. Signed-off-by: Brian Welty --- Builds but otherwise currently untested. Came across this duplication and thought would see if others cared to see it cleaned up this way or not. drivers

Re: [RFC PATCH 0/3] Propose new struct drm_mem_region

2019-07-30 Thread Brian Welty
ot sure we want any of these details in this shared structure > either. > Thanks for the feedback. I can remove it too. I was unsure if might be a case for having it in future. Well, struct drm_mem_region will be quite small then if it only has a size and type field. Hardly seems worth intro

Re: [RFC PATCH 0/3] Propose new struct drm_mem_region

2019-07-30 Thread Brian Welty
oing to be stolen for > discrete vram for us ... Also if we expand I guess we need to teach > ttm to cope with more, or maybe treat the DRM one as some kind of > sub-flavour. Daniel, maybe what i915 calls stolen could just be DRM_MEM_RESERVED or DRM_MEM_PRIV. Or maybe can argue it falls into

[RFC PATCH 1/3] drm: introduce new struct drm_mem_region

2019-07-29 Thread Brian Welty
ields into drm_mem_region and drm_gem_object strucures. vmwgfx changes included here as just example of what driver updates will look like, and can be moved later to separate patch. Other TTM drivers need to be updated similarly. Signed-off-by: Brian Welty --- drivers/gpu/drm/ttm/ttm_bo.c

[RFC PATCH 2/3] drm: Introduce DRM_MEM defines for specifying type of drm_mem_region

2019-07-29 Thread Brian Welty
Introduce DRM memory region types to be common for both drivers using TTM and for i915. For now, TTM continues to define it's own set but uses the DRM base definitions. Signed-off-by: Brian Welty --- include/drm/drm_mm.h| 8 include/drm/ttm/ttm_placement.h | 8 --

[RFC PATCH 3/3] drm/i915: Update intel_memory_region to use nested drm_mem_region

2019-07-29 Thread Brian Welty
-gfx/2019-June/203649.html Signed-off-by: Brian Welty --- drivers/gpu/drm/i915/gem/i915_gem_object.c| 2 +- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 10 +++ drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm

[RFC PATCH 0/3] Propose new struct drm_mem_region

2019-07-29 Thread Brian Welty
which is in progress to add vram support to i915 [2]. [1] https://lists.freedesktop.org/archives/dri-devel/2019-June/224501.html [2] https://lists.freedesktop.org/archives/intel-gfx/2019-June/203649.html Brian Welty (3): drm: introduce new struct drm_mem_region drm: Introduce DRM_MEM define

[RFC PATCH 2/3] drm: Introduce DRM_MEM defines for specifying type of drm_mem_region

2019-07-29 Thread Brian Welty
Introduce DRM memory region types to be common for both drivers using TTM and for i915. For now, TTM continues to define it's own set but uses the DRM base definitions. Signed-off-by: Brian Welty --- include/drm/drm_mm.h| 8 include/drm/ttm/ttm_placement.h | 8 --

[RFC PATCH 3/3] drm/i915: Update intel_memory_region to use nested drm_mem_region

2019-07-29 Thread Brian Welty
-gfx/2019-June/203649.html Signed-off-by: Brian Welty --- drivers/gpu/drm/i915/gem/i915_gem_object.c| 2 +- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 10 +++ drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm

[RFC PATCH 0/3] Propose new struct drm_mem_region

2019-07-29 Thread Brian Welty
https://lists.freedesktop.org/archives/intel-gfx/2019-June/203649.html Brian Welty (3): drm: introduce new struct drm_mem_region drm: Introduce DRM_MEM defines for specifying type of drm_mem_region drm/i915: Update intel_memory_region to use nested drm_mem_region drivers/gpu/drm/i915/gem/i915_gem_obj

[RFC PATCH 1/3] drm: introduce new struct drm_mem_region

2019-07-29 Thread Brian Welty
ields into drm_mem_region and drm_gem_object strucures. vmwgfx changes included here as just example of what driver updates will look like, and can be moved later to separate patch. Other TTM drivers need to be updated similarly. Signed-off-by: Brian Welty --- drivers/gpu/drm/ttm/ttm_bo.c

[RFC PATCH 5/5] drm/i915: Use memory cgroup for enforcing device memory limit

2019-05-01 Thread Brian Welty
devel@lists.freedesktop.org Cc: Matt Roper Signed-off-by: Brian Welty --- drivers/gpu/drm/i915/i915_drv.c| 2 +- drivers/gpu/drm/i915/intel_memory_region.c | 24 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/driver

[RFC PATCH 1/5] cgroup: Add cgroup_subsys per-device registration framework

2019-05-01 Thread Brian Welty
cgroup_register_device. cgroup_device_unregister will remove files from all current cgroups. Cc: cgro...@vger.kernel.org Cc: linux...@kvack.org Cc: dri-devel@lists.freedesktop.org Cc: Matt Roper Signed-off-by: Brian Welty --- include/linux/cgroup-defs.h | 28 include/linux/cgroup.h | 3 + kernel

[RFC PATCH 3/5] memcg: Add per-device support to memory cgroup subsystem

2019-05-01 Thread Brian Welty
ll, such that hierarchial charging to device files is supported. Cc: cgro...@vger.kernel.org Cc: linux...@kvack.org Cc: dri-devel@lists.freedesktop.org Cc: Matt Roper Signed-off-by: Brian Welty --- include/linux/memcontrol.h | 10 ++ mm/memcontrol.c| 183 +

[RFC PATCH 4/5] drm: Add memory cgroup registration and DRIVER_CGROUPS feature bit

2019-05-01 Thread Brian Welty
on logic. [1] https://www.kernel.org/doc/Documentation/cgroup-v2.txt, "Memory Ownership" Cc: cgro...@vger.kernel.org Cc: linux...@kvack.org Cc: dri-devel@lists.freedesktop.org Cc: Matt Roper Signed-off-by: Brian Welty --- drivers/gpu/drm/drm_drv.c | 12 drivers/gpu/drm/drm_g

[RFC PATCH 2/5] cgroup: Change kernfs_node for directories to store cgroup_subsys_state

2019-05-01 Thread Brian Welty
: cgro...@vger.kernel.org Signed-off-by: Brian Welty --- kernel/cgroup/cgroup-v1.c | 10 kernel/cgroup/cgroup.c| 48 +-- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index

[RFC PATCH 0/5] cgroup support for GPU devices

2019-05-01 Thread Brian Welty
drivers to follow? [1] https://patchwork.freedesktop.org/series/56683/ [2] https://lists.freedesktop.org/archives/dri-devel/2018-November/197106.html [3] https://lists.freedesktop.org/archives/intel-gfx/2018-January/153156.html Brian Welty (5): cgroup: Add cgroup_subsys per-device registration