The patch titled Subject: userfaultfd: shmem: introduce vma_is_shmem has been added to the -mm tree. Its filename is userfaultfd-shmem-introduce-vma_is_shmem.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/userfaultfd-shmem-introduce-vma_is_shmem.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/userfaultfd-shmem-introduce-vma_is_shmem.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx> 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. Link: http://lkml.kernel.org/r/20161216144821.5183-30-aarcange@xxxxxxxxxx Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx> Cc: Hillf Danton <hillf.zj@xxxxxxxxxxxxxxx> Cc: Michael Rapoport <RAPOPORT@xxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Pavel Emelyanov <xemul@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/mm.h | 10 ++++++++++ mm/shmem.c | 5 +++++ 2 files changed, 15 insertions(+) diff -puN include/linux/mm.h~userfaultfd-shmem-introduce-vma_is_shmem include/linux/mm.h --- a/include/linux/mm.h~userfaultfd-shmem-introduce-vma_is_shmem +++ a/include/linux/mm.h @@ -1355,6 +1355,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) { diff -puN mm/shmem.c~userfaultfd-shmem-introduce-vma_is_shmem mm/shmem.c --- a/mm/shmem.c~userfaultfd-shmem-introduce-vma_is_shmem +++ a/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 rppt@xxxxxxxxxxxxxxxxxx are userfaultfd-non-cooperative-dup_userfaultfd-use-mm_count-instead-of-mm_users.patch userfaultfd-introduce-vma_can_userfault.patch userfaultfd-shmem-add-shmem_mcopy_atomic_pte-for-userfaultfd-support.patch userfaultfd-shmem-introduce-vma_is_shmem.patch userfaultfd-shmem-use-shmem_mcopy_atomic_pte-for-shared-memory.patch userfaultfd-shmem-add-userfaultfd-hook-for-shared-memory-faults.patch userfaultfd-shmem-allow-registration-of-shared-memory-ranges.patch userfaultfd-shmem-add-userfaultfd_shmem-test.patch userfaultfd-non-cooperative-selftest-introduce-userfaultfd_open.patch userfaultfd-non-cooperative-selftest-add-ufd-parameter-to-copy_page.patch userfaultfd-non-cooperative-selftest-add-test-for-fork-madvdontneed-and-remap-events.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html