From: Mike Rapoport <rppt@kernel.org>
To: Eric Chanudet <echanude@redhat.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"David Hildenbrand" <david@kernel.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Michal Hocko" <mhocko@suse.com>, "Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Michal Hocko" <mhocko@kernel.org>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Shakeel Butt" <shakeel.butt@linux.dev>,
"Muchun Song" <muchun.song@linux.dev>,
"Shuah Khan" <shuah@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org,
"Maxime Ripard" <mripard@redhat.com>,
"Albert Esteve" <aesteve@redhat.com>
Subject: Re: [PATCH 00/11] mm/cma: charge cma allocation to memcg using per area counters
Date: Sun, 23 Aug 2026 10:02:35 +0300 [thread overview]
Message-ID: <aoqbCyX-32doBJwd@kernel.org> (raw)
In-Reply-To: <20260821-cma-memcg-regions-v1-0-d21b165b8440@redhat.com>
Hi Eric,
On Fri, Aug 21, 2026 at 02:56:52PM -0400, Eric Chanudet wrote:
> CMA allocations are currently unaccounted for by cgroup memory
> controllers. As system resources, they should fall under memcg, but CMA
> areas partition the available space for different purposes and memcg
> doesn't have a good representation for that.
>
> Add a memory_cma_accounting cgroupfs option in preparation for the
> following new behavior. Make it disabled by default since it will
> account for CMA allocations in memcg which may affect existing systems.
>
> Provide CMA charge/uncharge functions to memcg that introduce a CMA area
> specific counter per CMA area. Charges are issued to memcg and to a page
> counter for the CMA area used. The allocation's folios are marked with
> the cgroup via commit_charge() (once for large folios, per-page for
> 0-order ones) so they can be later uncharged correctly.
>
> Add the new memcg calls into the cma allocator under __cma_alloc_frozen,
> for both cma and hugetlb_cma allocations accounting.
>
> Finally register the per-area usage counters in the cgroupfs. Each CMA
> area creates a memory.cma.<area>.{current,max} pair for reporting and
> limitation for each area.
>
> Selftests and a vmtest script are added to this series for convenience.
> The tests are simple accounting and limit enforcement verification using
> the default reserved CMA area (cma=) and hugetlb_cma.
>
> Signed-off-by: Eric Chanudet <echanude@redhat.com>
> ---
> Eric Chanudet (11):
> mm/cma: drop const for struct page on release API
> mm/cma: include linux/cma.h in cma.h
> cgroup: add memory_cma_accounting mount option
> memcg: add cma charge/uncharge functions for area counters
> mm/cma: charge cma allocation to memcg per area counters
> memcg: register per-area usage counters in cgroupfs
> selftests: cgroup: add cma configs for cgroup selftest suite
> selftests: cgroup: add memcg cma tests
> selftests: cgroup: add a vmtest script for memcg
> selftests: cgroup: add memcg hugetlb_cma tests
> selftests: cgroup: amend vmtest-memcg to run the hugetlb cma tests
CI found issues:
https://github.com/linux-mm/linux-mm/actions/runs/32519133924
> Documentation/admin-guide/cgroup-v2.rst | 35 +++
> include/linux/cgroup-defs.h | 5 +
> include/linux/cma.h | 4 +-
> include/linux/memcontrol.h | 19 ++
> kernel/cgroup/cgroup.c | 15 +-
> mm/cma.c | 14 +-
> mm/cma.h | 6 +
> mm/cma_debug.c | 1 -
> mm/cma_sysfs.c | 1 -
> mm/memcontrol.c | 205 ++++++++++++
> tools/testing/selftests/cgroup/.gitignore | 1 +
> tools/testing/selftests/cgroup/Makefile | 2 +
> tools/testing/selftests/cgroup/config | 5 +
> tools/testing/selftests/cgroup/test_cma_memcg.c | 402 ++++++++++++++++++++++++
> tools/testing/selftests/cgroup/vmtest-memcg.sh | 197 ++++++++++++
> 15 files changed, 903 insertions(+), 9 deletions(-)
> ---
> base-commit: 98f21c54f99519329c18e2625b0ea6db14524d09
> change-id: 20260706-cma-memcg-regions-696cb5ef7998
>
> Best regards,
> --
> Eric Chanudet <echanude@redhat.com>
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-08-23 7:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 18:56 [PATCH 00/11] mm/cma: charge cma allocation to memcg using per area counters Eric Chanudet
2026-08-21 18:56 ` [PATCH 01/11] mm/cma: drop const for struct page on release API Eric Chanudet
2026-08-21 18:56 ` [PATCH 02/11] mm/cma: include linux/cma.h in cma.h Eric Chanudet
2026-08-21 18:56 ` [PATCH 03/11] cgroup: add memory_cma_accounting mount option Eric Chanudet
2026-08-24 7:02 ` Maxime Ripard
2026-08-24 22:03 ` Eric Chanudet
2026-08-21 18:56 ` [PATCH 04/11] memcg: add cma charge/uncharge functions for area counters Eric Chanudet
2026-08-21 18:56 ` [PATCH 05/11] mm/cma: charge cma allocation to memcg per " Eric Chanudet
2026-08-21 18:56 ` [PATCH 06/11] memcg: register per-area usage counters in cgroupfs Eric Chanudet
2026-08-21 18:56 ` [PATCH 07/11] selftests: cgroup: add cma configs for cgroup selftest suite Eric Chanudet
2026-08-21 18:57 ` [PATCH 08/11] selftests: cgroup: add memcg cma tests Eric Chanudet
2026-08-21 18:57 ` [PATCH 09/11] selftests: cgroup: add a vmtest script for memcg Eric Chanudet
2026-08-21 18:57 ` [PATCH 10/11] selftests: cgroup: add memcg hugetlb_cma tests Eric Chanudet
2026-08-21 18:57 ` [PATCH 11/11] selftests: cgroup: amend vmtest-memcg to run the hugetlb cma tests Eric Chanudet
2026-08-23 7:02 ` Mike Rapoport [this message]
2026-08-24 21:58 ` [PATCH 00/11] mm/cma: charge cma allocation to memcg using per area counters Eric Chanudet
2026-08-25 7:40 ` Michal Hocko
2026-08-24 8:58 ` Michal Hocko
2026-08-25 14:47 ` Eric Chanudet
2026-08-25 14:59 ` Michal Hocko
2026-08-25 18:33 ` Eric Chanudet
2026-08-25 19:19 ` Michal Hocko
2026-08-25 20:58 ` Eric Chanudet
2026-08-26 8:04 ` Michal Hocko
2026-08-26 20:31 ` Eric Chanudet
2026-08-25 15:45 ` David Hildenbrand (Arm)
2026-08-25 16:26 ` Michal Hocko
2026-08-25 18:50 ` Eric Chanudet
2026-08-26 8:02 ` David Hildenbrand (Arm)
2026-08-26 20:15 ` Eric Chanudet
2026-08-24 13:18 ` Michal Koutný
2026-08-25 14:54 ` Eric Chanudet
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=aoqbCyX-32doBJwd@kernel.org \
--to=rppt@kernel.org \
--cc=aesteve@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=echanude@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=liam@infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=mkoutny@suse.com \
--cc=mripard@redhat.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=vbabka@kernel.org \
/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