On Tue, May 19, 2026 at 11:59:01AM -0400, Eric Chanudet <[email protected]> 
wrote:
> +/**
> + * mem_cgroup_dmem_uncharge - uncharge memcg from a dmem pool allocation
> + * @cgrp: cgroup of the dmem pool
> + * @nr_pages: number of pages to uncharge
> + */
> +void mem_cgroup_dmem_uncharge(struct cgroup *cgrp, unsigned int nr_pages)
> +{
> +     struct cgroup_subsys_state *mem_css;
> +     struct mem_cgroup *memcg;
> +
> +     /* CGROUP_DMEM and MEMCG guarantees this cannot be NULL. */
> +     mem_css = cgroup_get_e_css(cgrp, &memory_cgrp_subsys);
> +
> +     memcg = mem_cgroup_from_css(mem_css);
> +     if (!memcg || mem_cgroup_is_root(memcg)) {
> +             css_put(mem_css);
> +             return;
> +     }
> +
> +     mod_memcg_state(memcg, MEMCG_DMEM, -nr_pages);
> +     refill_stock(memcg, nr_pages);

This doesn't look right.
Here should be memcg_uncharge().

Regards,
Michal

Attachment: signature.asc
Description: PGP signature

Reply via email to