A pull request submitted this week to DRM-Next ahead of the upcoming Linux 6.14 cycle is introducing the notion of device memory “DMEM” to cgroup with the main intended use being to restrict device memory usage based on the cgroup hierarchy such as for graphics cards with their dedicated vRAM.
Maarten Lankhorst of Intel has been driving the DMEM cgroup effort and for now only the Direct Rendering Manager (DRM) subsystem is the user of this code though in the future this device memory cgroup handling could be extended to other device types with dedicated memory attached.
For Linux 6.14, the DMEM cgroup support is wired up into the Intel Xe kernel graphics driver for allowing the video memory to be limited based on the cgroup hierarchy for Intel graphics cards. This DMEM cgroup code for vRAM memory accounting can also be “trivially” used by other kernel graphics drivers relying on TTM for memory management.
This DMEM cgroup support for controlling video memory limits was submitted via this pull request on Monday ahead of the Linux 6.14 merge window opening later this month.