From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org, selinux@vger.kernel.org
Subject: Re: [PATCH v3 1/8] memcg: Add MEMCG_DMABUF accounting infrastructure
Date: Wed, 28 Oct 2026 15:04:31 +0000 [thread overview]
Message-ID: <sashiko-outbox-188026@kernel.org> (raw)
In-Reply-To: <20261027-v2_20230123_tjmercier_google_com-v3-1-78d2c4cb8647@redhat.com>
> From: "T.J. Mercier" <tjmercier@google.com>
>
> Introduce a MEMCG_DMABUF stat counter and helpers for
> reserve/commit/cancel and uncharging dma-buf memory against a
> memory cgroup:
>
> The charge is tracked on struct dma_buf via a new memcg pointer. The
> page count is derived internally from PAGE_ALIGN(dmabuf->size), and
> the memcg reference is stored into (or cleared from) dmabuf->memcg by
> the helpers themselves, removing the need for callers to manage those
> details. The release path in dma_buf_release() is reduced to a single
> mem_cgroup_uncharge_dmabuf() call.
>
> This decouples accounting from the backing page allocator, avoiding the
> need for every exporter to pass __GFP_ACCOUNT and enabling cross-cgroup
> charge transfer, which is impractical with page-level accounting.
>
> The next patch wires up the charging policy in the dma-heap ioctl.
>
> Signed-off-by: T.J. Mercier <tjmercier@google.com>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261027-v2_20230123_tjmercier_google_com-v3-0-78d2c4cb8647@redhat.com?part=1
next prev parent reply other threads:[~2026-10-28 15:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 15:02 [PATCH v3 0/8] memcg: dma-buf cgroup accounting and charge transfer Albert Esteve
2026-10-27 15:02 ` [PATCH v3 1/8] memcg: Add MEMCG_DMABUF accounting infrastructure Albert Esteve
2026-10-28 15:04 ` sashiko-bot [this message]
2026-10-27 15:02 ` [PATCH v3 2/8] dma-heap: charge dma-buf memory via explicit memcg Albert Esteve
2026-10-28 15:04 ` sashiko-bot
2026-10-27 15:02 ` [PATCH v3 3/8] security: dma-buf: Add dma_buf_charge_task LSM hook Albert Esteve
2026-10-28 15:04 ` sashiko-bot
2026-10-27 15:02 ` [PATCH v3 4/8] security: dma-buf: Add dma_buf_charge_cgroup " Albert Esteve
2026-10-28 15:04 ` sashiko-bot
2026-10-27 15:02 ` [PATCH v3 5/8] selinux: Restrict cross-cgroup dma-buf charging Albert Esteve
2026-10-28 15:04 ` sashiko-bot
2026-10-27 15:02 ` [PATCH v3 6/8] selinux: Restrict dma-buf direct cgroup charging Albert Esteve
2026-10-28 15:04 ` sashiko-bot
2026-10-27 15:02 ` [PATCH v3 7/8] dma-buf: transfer memcg charges via DMA_BUF_IOCTL_XFER_CHARGE Albert Esteve
2026-10-28 9:08 ` Christian König
2026-10-28 16:09 ` Albert Esteve
2026-10-29 8:22 ` Albert Esteve
2026-10-28 15:04 ` sashiko-bot
2026-10-27 15:02 ` [PATCH v3 8/8] selftests/dmabuf-heaps: Add dma-buf memcg accounting tests Albert Esteve
2026-10-28 15:04 ` sashiko-bot
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=sashiko-outbox-188026@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=selinux@vger.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