]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dma-buf: system_heap: account for system heap allocation in memcg
authorEric Chanudet <echanude@redhat.com>
Fri, 16 Jan 2026 20:05:39 +0000 (15:05 -0500)
committerSumit Semwal <sumit.semwal@linaro.org>
Mon, 19 Jan 2026 13:39:52 +0000 (19:09 +0530)
commit3c227be9065902f496a748068e0b2b6bd6f3f0a6
tree9814186b00a0d6862af955e8bbacac36d5312877
parentbb33013bdd238129c8f8f29ed2e9bbdfa8caa643
dma-buf: system_heap: account for system heap allocation in memcg

The system dma-buf heap lets userspace allocate buffers from the page
allocator. However, these allocations are not accounted for in memcg,
allowing processes to escape limits that may be configured.

Pass __GFP_ACCOUNT for system heap allocations, based on the
dma_heap.mem_accounting parameter, to use memcg and account for them.

Signed-off-by: Eric Chanudet <echanude@redhat.com>
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patch.msgid.link/20260116-dmabuf-heap-system-memcg-v3-2-ecc6b62cc446@redhat.com
drivers/dma-buf/heaps/system_heap.c