[RFC v1 0/3] udmabuf: Replace pages when there is FALLOC_FL_PUNCH_HOLE in memfd

Vivek Kasireddy vivek.kasireddy at intel.com
Tue Jul 18 08:28:55 UTC 2023


This patch series attempts to solve the coherency problem seen when
a hole is punched in the region(s) of the mapping (associated with
the memfd) that overlaps with pages registered with a udmabuf fd.

The first patch introduces a new mmu notifier to let drivers know
when a new page is faulted into a mapping (backed by shmem or
hugetlbfs). The second patch updates the udmabuf driver to
register a handler for receiving mapping updates in order to
update its list with new pages. The last patch adds two new tests
to the udmabuf selftest to test the huge page support and also
FALLOC_FL_PUNCH_HOLE.

Cc: David Hildenbrand <david at redhat.com>
Cc: Mike Kravetz <mike.kravetz at oracle.com>
Cc: Hugh Dickins <hughd at google.com>
Cc: Peter Xu <peterx at redhat.com>
Cc: Jason Gunthorpe <jgg at nvidia.com>
Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: Dongwon Kim <dongwon.kim at intel.com>
Cc: Junxiao Chang <junxiao.chang at intel.com>

Vivek Kasireddy (3):
  mm/mmu_notifier: Add a new notifier for mapping updates (new pages)
  udmabuf: Replace pages when there is FALLOC_FL_PUNCH_HOLE in memfd
  selftests/dma-buf/udmabuf: Add tests for huge pages and
    FALLOC_FL_PUNCH_HOLE

 drivers/dma-buf/udmabuf.c                     | 172 ++++++++++++++++++
 include/linux/mmu_notifier.h                  |  27 +++
 mm/hugetlb.c                                  |   9 +-
 mm/mmu_notifier.c                             |  17 ++
 mm/shmem.c                                    |   7 +-
 .../selftests/drivers/dma-buf/udmabuf.c       | 165 ++++++++++++++++-
 6 files changed, 391 insertions(+), 6 deletions(-)

-- 
2.39.2



More information about the dri-devel mailing list