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: b61614ec ("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
-
mentioned in commit cd227937
-
mentioned in commit efda96a3
-
mentioned in commit 8ccaede7
-
mentioned in commit 9b6fc2bc
-
mentioned in commit 0ed5daa7
-
mentioned in commit 55fd072a
-
mentioned in commit b39bede9
-
mentioned in commit 93d7ac63
-
mentioned in commit 7e6427a0
-
mentioned in commit ffb95009
-
mentioned in commit 8434c92b
-
mentioned in commit 8a2060bf
-
mentioned in commit 28959046
-
mentioned in commit 0bf42be7
-
mentioned in commit d5b332d0
-
mentioned in commit 1c775377
-
mentioned in commit 31a4a67b
-
mentioned in commit c4cd0bca
-
mentioned in commit f124355e
-
mentioned in commit fd48f580
-
mentioned in commit 001d613e
-
mentioned in commit 3c0def32
-
mentioned in commit 48c8cec6
-
mentioned in commit 534fb7b0
-
mentioned in commit 5ab6ca61
-
mentioned in commit 35fae635
-
mentioned in commit fc735645
-
mentioned in commit db208de4
-
mentioned in commit 8962b1cc
-
mentioned in commit 5cca89bb
-
mentioned in commit bb26f73c
-
mentioned in commit 45b55744
-
mentioned in commit ecfdf980
-
mentioned in commit 27acbcf7