Skip to contentSkip to conversation

userfaultfd-shmem-introduce-vma_is_shmem.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 23, 2017

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: userfaultfd: shmem: introduce vma_is_shmem
has been removed from the -mm tree. Its filename was
userfaultfd-shmem-introduce-vma_is_shmem.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Mike Rapoport <[email protected]>
Subject: userfaultfd: shmem: introduce vma_is_shmem

Currently userfault relies on vma_is_anonymous and vma_is_hugetlb to ensure compatibility of a VMA with userfault. Introduction of vma_is_shmem allows detection if tmpfs backed VMAs, so that they may be used with userfaultfd. Current implementation presumes usage of vma_is_shmem only by slow path routines in userfaultfd, therefore the vma_is_shmem is not made inline to leave the few remaining free bits in vm_flags.

---

 include/linux/mm.h |   10 ++++++++++
 mm/shmem.c         |    5 +++++
 2 files changed, 15 insertions(+)
include/linux/mm.h renamed from include/linux/mm.h~userfaultfd-shmem-introduce-vma_is_shmem +10 -0
diff -puN include/linux/mm.h~userfaultfd-shmem-introduce-vma_is_shmem include/linux/mm.h
@@ -1383,6 +1383,16 @@ static inline bool vma_is_anonymous(stru
 	return !vma->vm_ops;
 }
 
+#ifdef CONFIG_SHMEM
+/*
+ * The vma_is_shmem is not inline because it is used only by slow
+ * paths in userfault.
+ */
+bool vma_is_shmem(struct vm_area_struct *vma);
+#else
+static inline bool vma_is_shmem(struct vm_area_struct *vma) { return false; }
+#endif
+
 static inline int stack_guard_page_start(struct vm_area_struct *vma,
 					     unsigned long addr)
 {
mm/shmem.c renamed from mm/shmem.c~userfaultfd-shmem-introduce-vma_is_shmem +5 -0
diff -puN mm/shmem.c~userfaultfd-shmem-introduce-vma_is_shmem mm/shmem.c
@@ -191,6 +191,11 @@ static const struct inode_operations shm
 static const struct vm_operations_struct shmem_vm_ops;
 static struct file_system_type shmem_fs_type;
 
+bool vma_is_shmem(struct vm_area_struct *vma)
+{
+	return vma->vm_ops == &shmem_vm_ops;
+}
+
 static LIST_HEAD(shmem_swaplist);
 static DEFINE_MUTEX(shmem_swaplist_mutex);
 

_

Patches currently in -mm which might be from [email protected] are

userfaultfd-non-cooperative-rename-event_madvdontneed-to-event_remove.patch userfaultfd-non-cooperative-add-madvise-event-for-madv_remove-request.patch userfaultfd-non-cooperative-selftest-enable-remove-event-test-for-shmem.patch mm-call-vm_munmap-in-munmap-syscall-instead-of-using-open-coded-version.patch userfaultfd-non-cooperative-add-event-for-memory-unmaps.patch userfaultfd-non-cooperative-add-event-for-exit-notification.patch userfaultfd-non-cooperative-add-event-for-exit-notification-fix.patch userfaultfd-mcopy_atomic-return-enoent-when-no-compatible-vma-found.patch userfaultfd-mcopy_atomic-return-enoent-when-no-compatible-vma-found-fix.patch userfaultfd_copy-return-enospc-in-case-mm-has-gone.patch userfaultfd-documentation-update.patch