]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/udmabuf: add a test to pin first before writing to memfd
authorVivek Kasireddy <vivek.kasireddy@intel.com>
Wed, 18 Jun 2025 05:30:55 +0000 (22:30 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:42:15 +0000 (22:42 -0700)
commitcf34cfbf1784be7ce9f22789aa157535eff2195f
tree340a6487071183e8051936020b949c6f2ac9b927
parent717cf9357325055ab6b41c4e0581f4d67601eb58
selftests/udmabuf: add a test to pin first before writing to memfd

Unlike the existing tests, this new test will create a memfd (backed by
hugetlb) and pin the folios in it (a small subset) before writing/
populating it with data.  This is a valid use-case that invokes the
memfd_alloc_folio() kernel API and is expected to work unless there aren't
enough hugetlb folios to satisfy the allocation needs.

Link: https://lkml.kernel.org/r/20250618053415.1036185-4-vivek.kasireddy@intel.com
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Steve Sistare <steven.sistare@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/drivers/dma-buf/udmabuf.c