[Devel] [PATCH hci-8.1 6/6] ms/cgroup/dmem: Add reclaim callback for lowering max below current usage

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Mon Nov 2 02:57:42 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] cgroup/dmem: subject and body claim a reclaim callback the patch lacks
--

commit 10f437866e4dd01de14e6d0d5054df57b3119a81
Author: Thomas Hellström <thomas.hellstrom at linux.intel.com>

ms/cgroup/dmem: Add reclaim callback for lowering max below current usage

This is a rebased backport of an upstream change. Only set_resource_max()
is changed. It now stores the new limit directly with xchg() instead of
calling page_counter_set_max(). The reclaim callback, retry loop,
O_NONBLOCK handling and SRCU protection described in the commit message
are not part of this tree.

Link: https://patch.msgid.link/20260725100036.2372-4-thomas.hellstrom@linux.intel.com

> ms/cgroup/dmem: Add reclaim callback for lowering max below current usage

[Severity: Low]
The subject says this adds a reclaim callback, and the body and the v1-v7
changelog describe the same feature. Examples are "Add an optional reclaim
callback to struct dmem_cgroup_region" and "the driver is asked to evict
memory to bring usage back below the limit". Is that accurate for this
commit?

The diff below touches only set_resource_max() in kernel/cgroup/dmem.c. It
adds no reclaim callback, no retry loop, no signal abort, no O_NONBLOCK
handling and no SRCU domain. The rebase note at the end of the message says
so itself.

Could the subject be changed to match what the patch does? For example,
"cgroup/dmem: apply dmem.max immediately even below current usage". The
rebase note can stay.

> diff --git a/kernel/cgroup/dmem.c b/kernel/cgroup/dmem.c
> index 8424df801bc0..46b6aca765a4 100644
> --- a/kernel/cgroup/dmem.c
> +++ b/kernel/cgroup/dmem.c
> @@ -158,7 +158,10 @@ set_resource_low(struct dmem_cgroup_pool_state *pool, u64 val)
>  static void
>  set_resource_max(struct dmem_cgroup_pool_state *pool, u64 val)
>  {
> -	page_counter_set_max(&pool->cnt, val);
> +	unsigned long limit = (unsigned long)val;
> +
> +	/* Apply the new limit immediately so concurrent allocations are throttled. */
> +	xchg(&pool->cnt.max, limit);
>  }
>  
>  static u64 get_resource_low(struct dmem_cgroup_pool_state *pool)

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261101235155.124059-1-mirian.shilakadze@virtuozzo.com?part=6



More information about the Devel mailing list