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

New update. Instead of calling it the 'dev' cgroup, it's now the 'dmem' cgroup.

Because it only deals with memory regions, the UAPI has been updated to use dmem.min/low/max/current, and to make the API cleaner, the names are changed too.

dmem.current could contain a line like:
"drm/0000:03:00.0/vram0 1073741824"

But I think using "drm/card0/vram0" instead of PCIID would perhaps be good too. I'm open to changing it to that based on feedback.

I've created an IGT test for min and max, and found the changes
from Friedrich Vock sent as feedback were needed.
I've integrated those into the first patch.

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

Maxime Ripard (2):
  drm/drv: Add drmm managed registration helper for dmem cgroups.
  drm/gem: Add cgroup memory accounting for VRAM helper.

 Documentation/admin-guide/cgroup-v2.rst       |  58 +-
 Documentation/core-api/cgroup.rst             |   9 +
 Documentation/core-api/index.rst              |   1 +
 Documentation/gpu/drm-compute.rst             |  54 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c  |   4 +
 drivers/gpu/drm/drm_drv.c                     |  32 +
 drivers/gpu/drm/drm_gem_vram_helper.c         |  15 +-
 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                  |  54 +-
 drivers/gpu/drm/ttm/ttm_resource.c            |  23 +-
 drivers/gpu/drm/xe/xe_ttm_sys_mgr.c           |   5 +
 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c          |   8 +
 include/drm/drm_drv.h                         |   5 +
 include/drm/ttm/ttm_resource.h                |  12 +-
 include/linux/cgroup_dmem.h                   |  67 ++
 include/linux/cgroup_subsys.h                 |   4 +
 include/linux/page_counter.h                  |   2 +-
 init/Kconfig                                  |  10 +
 kernel/cgroup/Makefile                        |   1 +
 kernel/cgroup/dmem.c                          | 861 ++++++++++++++++++
 mm/page_counter.c                             |   4 +-
 23 files changed, 1219 insertions(+), 34 deletions(-)
 create mode 100644 Documentation/core-api/cgroup.rst
 create mode 100644 Documentation/gpu/drm-compute.rst
 create mode 100644 include/linux/cgroup_dmem.h
 create mode 100644 kernel/cgroup/dmem.c

-- 
2.43.0


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

end of thread, other threads:[~2025-01-14 18:01 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-04 13:44 [PATCH v2 0/7] kernel/cgroups: Add "dmem" memory accounting cgroup Maarten Lankhorst
2024-12-04 13:44 ` [PATCH v2 1/7] kernel/cgroup: " Maarten Lankhorst
2024-12-04 14:31   ` [PATCH v2.1 1/1] " Maarten Lankhorst
2024-12-04 21:00     ` kernel test robot
2024-12-05  2:27     ` kernel test robot
2024-12-05 12:07       ` Maarten Lankhorst
2025-01-14 10:16     ` Geert Uytterhoeven
2025-01-14 18:01       ` Maxime Ripard
2025-01-06 17:48   ` [PATCH v2 1/7] " Michal Koutný
2024-12-04 13:44 ` [PATCH v2 2/7] drm/drv: Add drmm managed registration helper for dmem cgroups Maarten Lankhorst
2024-12-04 13:44 ` [PATCH v2 3/7] drm/ttm: Handle cgroup based eviction in TTM Maarten Lankhorst
2024-12-04 13:44 ` [PATCH v2 4/7] drm/xe: Implement cgroup for vram Maarten Lankhorst
2024-12-19 12:03   ` Maxime Ripard
2024-12-20 14:22     ` Rodrigo Vivi
2024-12-04 13:44 ` [PATCH v2 5/7] drm/amdgpu: Add cgroups implementation Maarten Lankhorst
2024-12-19 12:01   ` Maxime Ripard
2024-12-04 13:44 ` [PATCH v2 6/7] drm/xe: Hack to test with mapped pages instead of vram Maarten Lankhorst
2024-12-04 13:44 ` [PATCH v2 7/7] drm/gem: Add cgroup memory accounting for VRAM helper Maarten Lankhorst
2024-12-08 12:15 ` [PATCH v2 0/7] kernel/cgroups: Add "dmem" memory accounting cgroup Friedrich Vock
2024-12-13 13:07   ` Maxime Ripard
2024-12-13 14:13     ` Maarten Lankhorst
2024-12-13 15:22       ` Maxime Ripard
2024-12-13 13:03 ` Maxime Ripard
2024-12-13 14:53   ` Maarten Lankhorst
2024-12-13 15:21     ` Maxime Ripard
2024-12-13 16:06       ` Maarten Lankhorst
2024-12-17  7:46         ` Maxime Ripard
2024-12-17 14:28           ` Maarten Lankhorst
2024-12-17 17:11             ` Tejun Heo
2024-12-17 17:34               ` Maxime Ripard
2024-12-17 17:37               ` Maarten Lankhorst
2024-12-17 18:23                 ` Tejun Heo
2024-12-17 20:17                   ` Maarten Lankhorst
2025-01-07 15:13                     ` Maxime Ripard
2024-12-18 10:28                 ` Friedrich Vock

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