diff options
author | T.J. Mercier <tjmercier@google.com> | 2024-01-17 18:11:40 +0000 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2024-01-31 19:54:58 +0530 |
commit | 1c1914d6e8c6edbf5b45047419ff51abdb1dce96 (patch) | |
tree | 7a161dd4e8e45dd96224c41176a8223f22ea1ae0 /drivers/gpu | |
parent | 9c64e749cebd9c2d3d55261530a98bcccb83b950 (diff) | |
download | linux-stable-1c1914d6e8c6edbf5b45047419ff51abdb1dce96.tar.gz linux-stable-1c1914d6e8c6edbf5b45047419ff51abdb1dce96.tar.bz2 linux-stable-1c1914d6e8c6edbf5b45047419ff51abdb1dce96.zip |
dma-buf: heaps: Don't track CMA dma-buf pages under RssFile
DMA buffers allocated from the CMA dma-buf heap get counted under
RssFile for processes that map them and trigger page faults. In
addition to the incorrect accounting reported to userspace, reclaim
behavior was influenced by the MM_FILEPAGES counter until linux 6.8, but
this memory is not reclaimable. [1] Change the CMA dma-buf heap to set
VM_PFNMAP on the VMA so MM does not poke at the memory managed by this
dma-buf heap, and use vmf_insert_pfn to correct the RSS accounting.
The system dma-buf heap does not suffer from this issue since
remap_pfn_range is used during the mmap of the buffer, which also sets
VM_PFNMAP on the VMA.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/mm/vmscan.c?id=fb46e22a9e3863e08aef8815df9f17d0f4b9aede
Fixes: b61614ec318a ("dma-buf: heaps: Add CMA heap to dmabuf heaps")
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240117181141.286383-1-tjmercier@google.com
Diffstat (limited to 'drivers/gpu')
0 files changed, 0 insertions, 0 deletions