linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] kernel/cgroups: Add "dev" memory accounting cgroup.
@ 2024-10-23  7:52 Maarten Lankhorst
  2024-10-23  7:52 ` [PATCH 1/7] kernel/cgroup: " Maarten Lankhorst
                   ` (7 more replies)
  0 siblings, 8 replies; 27+ messages in thread
From: Maarten Lankhorst @ 2024-10-23  7:52 UTC (permalink / raw)
  To: intel-xe, linux-kernel, dri-devel, Tejun Heo, Zefan Li,
	Johannes Weiner, Andrew Morton
  Cc: Friedrich Vock, cgroups, linux-mm, Maxime Ripard, Maarten Lankhorst

New submission!
I've added documentation for each call, and integrated the renaming from
drm cgroup to dev cgroup, based on maxime ripard's work.

Maxime has been testing this with dma-buf heaps and v4l2 too, and it seems to work.
In the initial submission, I've decided to only add the smallest enablement possible,
to have less chance of breaking things.

The API has been changed slightly, from "$name region.$regionname=$limit" in a file called
dev.min/low/max to "$subsystem/$name $regionname=$limit" in a file called dev.region.min/low/max.

This hopefully allows us to perhaps extend the API later on with the possibility to
set scheduler weights on the device, like in

https://blogs.igalia.com/tursulin/drm-scheduling-cgroup-controller/

Maarten Lankhorst (5):
  kernel/cgroup: Add "dev" memory accounting cgroup
  drm/ttm: Handle cgroup based eviction in TTM
  drm/xe: Implement cgroup for vram
  drm/amdgpu: Add cgroups implementation
  [HACK] drm/xe: Hack to test with mapped pages instead of vram.

Maxime Ripard (2):
  drm/drv: Add drmm cgroup registration for dev cgroups.
  [DISCUSSION] drm/gem: Add cgroup memory accounting

 Documentation/admin-guide/cgroup-v2.rst       |  51 +
 Documentation/core-api/cgroup.rst             |   9 +
 Documentation/core-api/index.rst              |   1 +
 Documentation/gpu/drm-compute.rst             |  54 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c       |   6 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c  |   6 +
 drivers/gpu/drm/drm_drv.c                     |  32 +-
 drivers/gpu/drm/drm_gem.c                     |   4 +
 drivers/gpu/drm/drm_gem_dma_helper.c          |   4 +
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c       |  18 +-
 .../gpu/drm/ttm/tests/ttm_bo_validate_test.c  |   4 +-
 drivers/gpu/drm/ttm/tests/ttm_resource_test.c |   2 +-
 drivers/gpu/drm/ttm/ttm_bo.c                  |  57 +-
 drivers/gpu/drm/ttm/ttm_resource.c            |  24 +-
 drivers/gpu/drm/xe/xe_device.c                |   4 +
 drivers/gpu/drm/xe/xe_device_types.h          |   4 +
 drivers/gpu/drm/xe/xe_ttm_sys_mgr.c           |  14 +
 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c          |  10 +
 include/drm/drm_device.h                      |   4 +
 include/drm/drm_drv.h                         |   4 +
 include/drm/drm_gem.h                         |   2 +
 include/drm/ttm/ttm_resource.h                |  16 +-
 include/linux/cgroup_dev.h                    |  91 ++
 include/linux/cgroup_subsys.h                 |   4 +
 include/linux/page_counter.h                  |   2 +-
 init/Kconfig                                  |   7 +
 kernel/cgroup/Makefile                        |   1 +
 kernel/cgroup/dev.c                           | 893 ++++++++++++++++++
 mm/page_counter.c                             |   4 +-
 30 files changed, 1307 insertions(+), 27 deletions(-)
 create mode 100644 Documentation/core-api/cgroup.rst
 create mode 100644 Documentation/gpu/drm-compute.rst
 create mode 100644 include/linux/cgroup_dev.h
 create mode 100644 kernel/cgroup/dev.c

-- 
2.45.2



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

end of thread, other threads:[~2024-11-14  8:45 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-23  7:52 [PATCH 0/7] kernel/cgroups: Add "dev" memory accounting cgroup Maarten Lankhorst
2024-10-23  7:52 ` [PATCH 1/7] kernel/cgroup: " Maarten Lankhorst
2024-10-23 15:26   ` Waiman Long
2024-11-11  9:28     ` Maarten Lankhorst
2024-10-25  5:44   ` kernel test robot
2024-10-28 14:53   ` Friedrich Vock
2024-11-11 22:53     ` Maarten Lankhorst
2024-11-14  8:45       ` Friedrich Vock
2024-10-23  7:52 ` [PATCH 2/7] drm/drv: Add drmm cgroup registration for dev cgroups Maarten Lankhorst
2024-10-23  8:45   ` Jani Nikula
2024-10-24 10:35   ` kernel test robot
2024-10-24 15:42   ` kernel test robot
2024-10-23  7:52 ` [PATCH 3/7] drm/ttm: Handle cgroup based eviction in TTM Maarten Lankhorst
2024-10-23  7:52 ` [PATCH 4/7] drm/xe: Implement cgroup for vram Maarten Lankhorst
2024-10-23  7:52 ` [PATCH 5/7] drm/amdgpu: Add cgroups implementation Maarten Lankhorst
2024-10-23  7:52 ` [PATCH 6/7] [HACK] drm/xe: Hack to test with mapped pages instead of vram Maarten Lankhorst
2024-10-23  8:52   ` Jani Nikula
2024-10-23  7:53 ` [PATCH 7/7] [DISCUSSION] drm/gem: Add cgroup memory accounting Maarten Lankhorst
2024-10-23 19:40 ` [PATCH 0/7] kernel/cgroups: Add "dev" memory accounting cgroup Tejun Heo
2024-10-24  7:20   ` Maxime Ripard
2024-10-24 17:06     ` Tejun Heo
2024-10-28 10:05       ` Maxime Ripard
2024-10-29 20:38         ` Johannes Weiner
2024-11-06 10:31           ` Maxime Ripard
2024-11-06 18:20             ` Tejun Heo
2024-11-13 14:58               ` Maarten Lankhorst
2024-11-13 18:29                 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox