From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21FB63CFF6C for ; Mon, 24 Aug 2026 07:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787554962; cv=none; b=YOT+qw+rjJBwFoD/IupkbX7L0qBsmrNx9/9bO1zj+qUubEVPOoWSGeh7SKMLfEeQChTc3qTOIElapYPcTz7uQdYrsxH2A6+xbwb8cCes1B9wqEwDEq6BfamR2U+IzhGR4lifhjMUX3LDwEpRQAjGIOtvtmCAjZdPy19xq/ed3ZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787554962; c=relaxed/simple; bh=dAiTN3K2/qWL/BjZQGm3J+P5250uVTACobJF5aguZWg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZxbcigijV5x9PN/eOf7rA4t5ArQXMAq1Ib1J2VokaggdD/MIjwe/gq8/y4G7totmguOI73bKBdAxnft+HA617zx2isy18Zr1mFjoSwTj7Ss7tNt62hsdzPa+8v/5nPtIVeZNuhPQxp1IWRKz0gZ5nu88sF1FS/7GeSIFLA7ajLE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YZI6lOHM; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=dNqr63DG; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YZI6lOHM"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="dNqr63DG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787554958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G7d7HgiMHwmpzIOyoUl4AR6/ya+8tZe+ferjW/FC15c=; b=YZI6lOHMxobrn8Khnj1cJd0OyZXjI97Awl/KRm+AcEaktQcYm8ftUwh8VNMQTiYEzeSqcY 9oO+UKTixN3Vhwxe+GYUtBZkp8Xr93s7p7p7aMv9oxw8ZS3sUmRH8x9Vk1vmlSYccg7njA GtWWHfEM/uRzTCcRRv1+HLA3MC47DNg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-cmb2ZQ0vMB-5wiQxza65BQ-1; Mon, 24 Aug 2026 03:02:37 -0400 X-MC-Unique: cmb2ZQ0vMB-5wiQxza65BQ-1 X-Mimecast-MFC-AGG-ID: cmb2ZQ0vMB-5wiQxza65BQ_1787554956 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-499b99a8a10so17689565e9.0 for ; Mon, 24 Aug 2026 00:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1787554956; x=1788159756; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=G7d7HgiMHwmpzIOyoUl4AR6/ya+8tZe+ferjW/FC15c=; b=dNqr63DGHUfCVlXW3wYsy+pCzlgWPFw04bw9FRIoX3GwZC5wOEyx4dEELzu88LDv2O t5YMcqh+xN9IknOJjPiwW0ku1QtG7spZPApXUnE81BKSgwtHtBDPkwwleqkpAVJqNiGC fAj5I4I7uTUgCw5UNJDUDgzLYmCto2IDAbfHmyxB3h443k6zp815+O60aHoHCndovsSt z9jXu0m7aSyTkt4UYZBkXUZnQwenThBcFpvSZLvQTvccUQhIF5N/Yq148ipT+Mhns5Lm H0RIP/pMpKbH+RHxwg7RT4pahxK+agbFVuxDd32nz/NVE5r/rAl/2S3Oeli0fJKFYNqz owlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787554956; x=1788159756; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=G7d7HgiMHwmpzIOyoUl4AR6/ya+8tZe+ferjW/FC15c=; b=a605o7iAKv9fyTI35iWZ962foRvfErvjk8kpapJC+D3dlThdHe/2IsVr7IuWUjVYMe n211mloMAKYhIBzdZe0fQMLRg2doYXMx2hhkH+tFjU1zGdzjjGl+kTsi3Lwd0udGfJM7 RyD28EHRhNDAoT/kF4oINDpBJqkQvO4mb0QAuh5eltgjY6wVR2/s3UCvnVbIokrkWd5r 7ooLUiQHJe+ut9X2r5Fp/3ujNhAAh8VlzeLyhcTbk5P5+HPUBYKzQMbyKwTkrGA/yDE7 PtYv2/8j5tISQksp3Bc2QeqeGNMfWaAJmVBe0aoyM6hoRWRDvdI3Y6RzhSpf7mS8RFuz ZQQw== X-Forwarded-Encrypted: i=1; AHgh+RqQEipN66amf1Xy4rb8BIdSgg/k5QWrrJeNr7f+F0ddAMF3K5NPn3PJ02Xnpi99nQhvtpt9/kVXq+DGEik=@vger.kernel.org X-Gm-Message-State: AFuF++mhfDK3uVzDP/iC3/F8hu3azHH+CrXkEPNZtMbgf4L4qyjPSHhx UybOPjGuw+peRjfwly+tlU0/sU7gGwt7tAJdtyiPhbUpI94pBsijnF/3TUBt4zgtKIOB3h2EI6c tqVJgxvC/Bxs7wgnnqxTr9ZJy4M++9d5QTAqUK4UGrytm94aZ7Gpou7PuPWNbUs2HbA== X-Gm-Gg: AR+sD12PyoA7mMxbf5ePj8yJEehN4XD9bRSzXiixGJ3gCMEVL0j/zgZfW2iUGZ9hkzZ OlxQUl6F8o2HZjEbvEgxyDldkh7FjQfX4NaTKSWUvrqSC7/QuYn4q3pz7EDCkQP+19TOU4BDnKL UMbGeMvsbM5UUnemvyYvWznMjPm3wrwk9lDKicXrMl4tll0x23s1ylmolZ1BuOAeloSSVUFJa9S PdWAjTcLPa2IKIIkj4GI+vV8dD2DdPFdY5x6ZpB/lk4GHqvAQ4VU6WK1MTtMx1qLwO+WJT2Vr/f /+Appn6thAcqH575UakVjO2kc4MugvUCi1t5XxsdpvyAOCKHjW5aQDTJryQbADEF3SGcULKiuw= = X-Received: by 2002:a05:600c:4688:b0:499:5f80:83ac with SMTP id 5b1f17b1804b1-499b91ad940mr188043575e9.7.1787554956229; Mon, 24 Aug 2026 00:02:36 -0700 (PDT) X-Received: by 2002:a05:600c:4688:b0:499:5f80:83ac with SMTP id 5b1f17b1804b1-499b91ad940mr188039125e9.7.1787554954215; Mon, 24 Aug 2026 00:02:34 -0700 (PDT) Received: from localhost ([2a01:e0a:a99:9822:ca7f:54ff:fe01:374c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499bae8bb6fsm103521345e9.0.2026.08.24.00.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 00:02:32 -0700 (PDT) Date: Mon, 24 Aug 2026 09:02:30 +0200 From: Maxime Ripard To: Eric Chanudet Cc: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Tejun Heo , Johannes Weiner , Michal =?utf-8?Q?Koutn=C3=BD?= , Jonathan Corbet , Shuah Khan , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Shuah Khan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Albert Esteve Subject: Re: [PATCH 03/11] cgroup: add memory_cma_accounting mount option Message-ID: <20260824-poised-meaty-shellfish-9a09d2@houat> References: <20260821-cma-memcg-regions-v1-0-d21b165b8440@redhat.com> <20260821-cma-memcg-regions-v1-3-d21b165b8440@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="l2avhy4pfliwz3eh" Content-Disposition: inline In-Reply-To: <20260821-cma-memcg-regions-v1-3-d21b165b8440@redhat.com> --l2avhy4pfliwz3eh Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 03/11] cgroup: add memory_cma_accounting mount option MIME-Version: 1.0 On Fri, Aug 21, 2026 at 02:56:55PM -0400, Eric Chanudet wrote: > Add a cgroup v2 mount option that will be used later in this series to > enable CMA memory accounting under memcg. >=20 > The option is made opt-in as it will charge allocations to the cgroup's > overall memory usage, which changes existing expectations. >=20 > Signed-off-by: Eric Chanudet > --- > Documentation/admin-guide/cgroup-v2.rst | 20 ++++++++++++++++++++ > include/linux/cgroup-defs.h | 5 +++++ > kernel/cgroup/cgroup.c | 15 ++++++++++++++- > 3 files changed, 39 insertions(+), 1 deletion(-) >=20 > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admi= n-guide/cgroup-v2.rst > index aed195a71cbf..3dfc13f31a0c 100644 > --- a/Documentation/admin-guide/cgroup-v2.rst > +++ b/Documentation/admin-guide/cgroup-v2.rst > @@ -246,6 +246,26 @@ cgroup v2 currently supports the following mount opt= ions. > will not be tracked by the memory controller (even if cgroup > v2 is remounted later on). > =20 > + memory_cma_accounting > + Count CMA memory usage towards the cgroup's overall memory usage= for > + the memory controller, and expose per-CMA-area usage counters. T= his > + behavior is opt-in, so as to not cause regression on existing se= tups. > + > + A few caveats to keep in mind: > + > + * CMA areas are reserved at boot time, memory is only charged to= a > + cgroup when a CMA allocation is performed on its behalf. > + * CMA pages allocated while this option is not enabled will not = be > + tracked by the memory controller, even if cgroup v2 is remount= ed > + later on with this option. Charges happen at allocation. And what would happen if it's the other way around, ie mounted with this option enabled, then remounted with the option disabled? Maxime --l2avhy4pfliwz3eh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaovshgAKCRAnX84Zoj2+ dmgFAYD2QpXyIkC2UzudfuMMWSQyhPMvADvZ8Rf/HrEEqUh/MjtRgmrUG5NqgkMI UAktDh4BgIRrcGChUBI+vsNkyPAnIa8ElouZIe+7PjdeK6u1QPgT/QlxiYNC2N8b AaFU79ONPw== =PSxk -----END PGP SIGNATURE----- --l2avhy4pfliwz3eh--