From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
intel-xe@lists.freedesktop.org
Cc: "Natalie Vock" <natalie.vock@gmx.de>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Tejun Heo" <tj@kernel.org>, "Michal Koutný" <mkoutny@suse.com>,
cgroups@vger.kernel.org, "Huang Rui" <ray.huang@amd.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Simona Vetter" <simona@ffwll.ch>,
"David Airlie" <airlied@gmail.com>,
"Christian König" <christian.koenig@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] drm/xe: Wire up dmem cgroup reclaim for VRAM manager
Date: Tue, 28 Apr 2026 12:03:23 +0200 [thread overview]
Message-ID: <be6168a0-38b2-41ac-94d8-cfc2b19dec2e@linux.intel.com> (raw)
In-Reply-To: <5d36326b1b9c009cd544fe5ca195ae484dbbc915.camel@linux.intel.com>
Hey,
Den 2026-04-28 kl. 12:02, skrev Thomas Hellström:
> On Tue, 2026-04-28 at 11:50 +0200, Maarten Lankhorst wrote:
>>
>>
>> Den 2026-04-28 kl. 09:31, skrev Thomas Hellström:
>>> Register the VRAM manager with the dmem cgroup reclaim
>>> infrastructure
>>> so that lowering dmem.max below current VRAM usage triggers TTM
>>> eviction rather than failing with -EBUSY.
>>>
>>> Assisted-by: GitHub Copilot:claude-sonnet-4.6
>>> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>> ---
>>> drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 19 ++++++++++++-------
>>> 1 file changed, 12 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
>>> b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
>>> index 5fd0d5506a7e..1bdcb3fee901 100644
>>> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
>>> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
>>> @@ -303,13 +303,6 @@ int __xe_ttm_vram_mgr_init(struct xe_device
>>> *xe, struct xe_ttm_vram_mgr *mgr,
>>> struct ttm_resource_manager *man = &mgr->manager;
>>> int err;
>>>
>>> - if (mem_type != XE_PL_STOLEN) {
>>> - const char *name = mem_type == XE_PL_VRAM0 ?
>>> "vram0" : "vram1";
>>> - man->cg = drmm_cgroup_register_region(&xe->drm,
>>> name, size);
>>> - if (IS_ERR(man->cg))
>>> - return PTR_ERR(man->cg);
>>> - }
>>> -
>>> man->func = &xe_ttm_vram_mgr_func;
>>> mgr->mem_type = mem_type;
>>> mutex_init(&mgr->lock);
>>> @@ -318,6 +311,18 @@ int __xe_ttm_vram_mgr_init(struct xe_device
>>> *xe, struct xe_ttm_vram_mgr *mgr,
>>> mgr->visible_avail = io_size;
>>>
>>> ttm_resource_manager_init(man, &xe->ttm, size);
>>> +
>>> + if (mem_type != XE_PL_STOLEN) {
>>> + const char *name = mem_type == XE_PL_VRAM0 ?
>>> "vram0" : "vram1";
>>> + struct dmem_cgroup_region *cg =
>>> + drmm_cgroup_register_region(&xe->drm,
>>> name, size);
>>> +
>>> + if (IS_ERR(cg))
>>> + return PTR_ERR(cg);
>>> +
>>> + ttm_resource_manager_set_dmem_region(man, cg);
>>> + }
>>> +
>>> err = gpu_buddy_init(&mgr->mm, man->size,
>>> default_page_size);
>>> if (err)
>>> return err;
>>
>> This patch will conflict with
>> https://patchwork.freedesktop.org/series/164694/ which removes
>> stolen support, can we merge that patch first while we wait for AMD
>> acks?
>
> Sure, np.
>
>>
>> Do I need an ack to get the series through drm-misc?
>
> Which series? The stolen support or this cgroup series?
This one, I think it might be easiest to just merge stolen through xe,
and then backmerge into drm-misc.
next prev parent reply other threads:[~2026-04-28 10:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 7:31 [PATCH v2 0/4] Add reclaim to the dmem cgroup controller Thomas Hellström
2026-04-28 7:31 ` [PATCH v2 1/4] cgroup/dmem: Add reclaim callback for lowering max below current usage Thomas Hellström
2026-04-28 7:31 ` [PATCH v2 2/4] drm/ttm: Hook up a cgroup-aware reclaim callback for the dmem controller Thomas Hellström
2026-04-28 7:31 ` [PATCH v2 3/4] drm/xe: Wire up dmem cgroup reclaim for VRAM manager Thomas Hellström
2026-04-28 9:38 ` Upadhyay, Tejas
2026-04-28 9:50 ` Maarten Lankhorst
2026-04-28 10:02 ` Thomas Hellström
2026-04-28 10:03 ` Maarten Lankhorst [this message]
2026-04-28 7:31 ` [PATCH v2 4/4] drm/amdgpu: " Thomas Hellström
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=be6168a0-38b2-41ac-94d8-cfc2b19dec2e@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=cgroups@vger.kernel.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hannes@cmpxchg.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mkoutny@suse.com \
--cc=mripard@kernel.org \
--cc=natalie.vock@gmx.de \
--cc=ray.huang@amd.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tj@kernel.org \
--cc=tzimmermann@suse.de \
/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