From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org, selinux@vger.kernel.org
Subject: Re: [PATCH v5 3/8] dma-buf: transfer objcg charges via DMA_BUF_IOCTL_XFER_CHARGE
Date: Wed, 18 Nov 2026 08:41:01 +0000 [thread overview]
Message-ID: <sashiko-outbox-220469@kernel.org> (raw)
In-Reply-To: <20261117-v2_20230123_tjmercier_google_com-v5-3-1ce975f2a9ad@redhat.com>
> dma-heap already supports charging a specific cgroup at allocation
> time via charge_fd in DMA_HEAP_IOCTL_ALLOC. However, dma-bufs can
> originate from any exporter (DRM, V4L2, etc.), and the allocator may
> not know the final owner at allocation time.
>
> Add DMA_BUF_IOCTL_XFER_CHARGE to transfer a dma-buf's objcg charge
> to a different cgroup after allocation. The target is identified by
> charge_fd, which may be a cgroupfd or a pidfd.
>
> The transfer charges the new cgroup before uncharging the old one,
> preserving the original charge on failure. Concurrent transfers are
> serialized by the dma-buf reservation lock, so lockdep covers the
> locking order of the charge path early. The transfer implementation
> is generic (obj_cgroup_transfer_charge) and not dma-buf specific, so
> it can be reused by other subsystems.
> [ ... ]
> /* charge now on app1's cgroup */
> close(cg_fd);
>
> Reviewed-by: Christian König <christian.koenig@amd.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/20261117-v2_20230123_tjmercier_google_com-v5-0-1ce975f2a9ad@redhat.com?part=3
next prev parent reply other threads:[~2026-11-18 8:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 8:39 [PATCH v5 0/8] memcg: dma-buf cgroup accounting and charge transfer Albert Esteve
2026-11-17 8:39 ` [PATCH v5 1/8] memcg: Add MEMCG_DMABUF accounting infrastructure Albert Esteve
2026-11-18 8:40 ` sashiko-bot
2026-11-17 8:39 ` [PATCH v5 2/8] dma-heap: charge dma-buf memory via explicit memcg Albert Esteve
2026-11-18 8:40 ` sashiko-bot
2026-11-17 8:39 ` [PATCH v5 3/8] dma-buf: transfer objcg charges via DMA_BUF_IOCTL_XFER_CHARGE Albert Esteve
2026-11-18 8:41 ` sashiko-bot [this message]
2026-11-17 8:39 ` [PATCH v5 4/8] lsm: Add memcg_charge_task LSM hook Albert Esteve
2026-11-17 22:54 ` Paul Moore
2026-11-18 8:41 ` sashiko-bot
2026-11-17 8:39 ` [PATCH v5 5/8] lsm: Add memcg_charge_cgroup " Albert Esteve
2026-11-18 8:41 ` sashiko-bot
2026-11-17 8:39 ` [PATCH v5 6/8] selinux: Restrict cross-cgroup memcg charging Albert Esteve
2026-11-18 8:41 ` sashiko-bot
2026-11-17 8:39 ` [PATCH v5 7/8] selinux: Restrict memcg charging to a cgroupfd target Albert Esteve
2026-11-18 8:41 ` sashiko-bot
2026-11-17 8:39 ` [PATCH v5 8/8] selftests/dmabuf-heaps: Add dma-buf memcg accounting tests Albert Esteve
2026-11-18 8:41 ` sashiko-bot
2026-11-17 22:54 ` [PATCH v5 0/8] memcg: dma-buf cgroup accounting and charge transfer Paul Moore
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-220469@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