From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Jing Wu <realwujing@gmail.com>, matthew.brost@intel.com
Cc: christian.koenig@amd.com, ray.huang@amd.com,
matthew.auld@intel.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
simona@ffwll.ch, tj@kernel.org, hannes@cmpxchg.org,
mkoutny@suse.com, natalie.vock@gmx.de, mhocko@kernel.org,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
muchun.song@linux.dev, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v7] cgroup/dmem: implement dmem.high soft limit with proactive reclaim
Date: Thu, 09 Jul 2026 11:47:38 +0200 [thread overview]
Message-ID: <265737ad21d42a7509a8c43619975f0ef150f275.camel@linux.intel.com> (raw)
In-Reply-To: <20260709061114.1623774-1-realwujing@gmail.com>
On Thu, 2026-07-09 at 14:11 +0800, Jing Wu wrote:
> On Wed, Jul 09, 2026 at 12:44:37AM -0700, Matthew Brost wrote:
> > This looks quite similar to work Thomas is doing here [1].
>
> Thank you for the pointer, Matt. We were not aware of Thomas's
> series
> before your mail. After reviewing Thomas's v7 [1], the two series
> turn
> out to address different — and complementary — problems:
>
> - Thomas's series hooks a reclaim callback into the dmem.max write
> path: when an administrator lowers dmem.max below current usage,
> the
> kernel calls the driver's reclaim callback to bring device memory
> usage down to the new limit. This is analogous to what happens
> in
> memcg when memory.max is written below current usage.
>
> - Our series adds dmem.high as a soft limit enforced in the charge
> path: when a successful allocation pushes a cgroup's usage above
> dmem.high, TTM proactively evicts one BO from that cgroup before
> returning. This mirrors memory.high semantics in memcg, where
> reclaim is triggered per-allocation to keep usage below the soft
> threshold.
>
> Both mechanisms coexist independently in memcg and serve distinct
> purposes: the max write path handles capacity reconfiguration by
> operators, while the high-limit path provides automatic backpressure
> for workloads approaching their quota. Having both in the dmem
> cgroup
> controller seems correct.
>
> > Are either of you two aware of this seemly overlapping work?
>
> We were not, until your mail. Now that we are, we would like to
> coordinate with Thomas on a few interaction points:
>
> 1. API intersection: Thomas's v5+ replaces the bare u64 size
> argument
> in dmem_cgroup_register_region() with struct dmem_cgroup_init
> (which
> bundles the region size, reclaim ops, and driver private data).
> If
> Thomas's series lands first, we will adapt our patches to the
> new
> registration interface.
>
> 2. File-level conflicts: both series modify ttm_resource.c and
> ttm_bo.c. The changes are semantically independent and should
> compose cleanly after a rebase, whichever lands second.
>
> Thomas, would you be open to coordinating on merge ordering? We are
> happy to rebase our dmem.high series on top of yours once it lands,
> or
> to split out any shared infrastructure as a common prerequisite if
> that
> helps.
Sure. Let's notify eachother of imminent merge plans. I will rebase my
series on yours if yours go in first. If needed let's look at a topic
branch that we can merge into drm or vice versa.
My work is stalled on lack of reviews ATM.
Thanks,
Thomas
>
> Thanks,
> Jing Wu
prev parent reply other threads:[~2026-07-09 9:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 4:02 [PATCH v7] cgroup/dmem: implement dmem.high soft limit with proactive reclaim Qiliang Yuan
2026-07-09 5:44 ` Matthew Brost
2026-07-09 6:11 ` Jing Wu
2026-07-09 9:47 ` Thomas Hellström [this message]
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=265737ad21d42a7509a8c43619975f0ef150f275.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=airlied@gmail.com \
--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=linux-mm@kvack.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=mripard@kernel.org \
--cc=muchun.song@linux.dev \
--cc=natalie.vock@gmx.de \
--cc=ray.huang@amd.com \
--cc=realwujing@gmail.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=simona@ffwll.ch \
--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