From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE00F36073E for ; Thu, 2 Apr 2026 04:23:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775103815; cv=none; b=b27E2JUnbnDGAehDLOyFdrR8qCCI8ddpAfBlU1nQF+1ol4q+rEujFAX4B6cc5OhbMoP5wd8r6WiVwyWG6oFJwycuXQoZLr0OlAtCiEa/eP/z/+cwuGX33wZ5HehLZFYwPE1+YaC5GIbiZHFTU52rC7FNImG9W6XVph5qwiAUCGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775103815; c=relaxed/simple; bh=7RDNklNepeA6zcP2EnQKqLAPJyYGV04/ZdVw3vIaryU=; h=Date:To:From:Subject:Message-Id; b=GuzymRm5NCtqM27BRgI2cxEMvt2ugbuZ2q3JJynKaHZpE8RlMNezd658z9F4nhwC5bJtjUCuqtdSDC09WeNDLkBzzQ9R+gXybD6WWubOTpliXpY/9sQO+r+rC4F1eKDOSzcNSFawR92s7DOQpY51t4/En8GGuK1C6LfUoNS9l+0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=oaImqbT5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="oaImqbT5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BC93C19423; Thu, 2 Apr 2026 04:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1775103815; bh=7RDNklNepeA6zcP2EnQKqLAPJyYGV04/ZdVw3vIaryU=; h=Date:To:From:Subject:From; b=oaImqbT5QT7YBvhdxkoxv7Ec8qtIERFwMPWRPms5MDJNyaLvGKnlUCW5+YddtNTbI hrIYi40/ntfleM8ggaaS97PNs/wnPEqYSrgoYy1QIgaH3PDvl38oTuPmTHT87H3ouU aGDrSjb51nuzTZabhNA/1O0mqAckFlHvAaSkG0lY= Date: Wed, 01 Apr 2026 21:23:34 -0700 To: mm-commits@vger.kernel.org,rppt@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: [to-be-updated] userfaultfd-move-vma_can_userfault-out-of-line.patch removed from -mm tree Message-Id: <20260402042335.6BC93C19423@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: userfaultfd: move vma_can_userfault out of line has been removed from the -mm tree. Its filename was userfaultfd-move-vma_can_userfault-out-of-line.patch This patch was dropped because an updated version will be issued ------------------------------------------------------ From: "Mike Rapoport (Microsoft)" Subject: userfaultfd: move vma_can_userfault out of line Date: Mon, 30 Mar 2026 13:11:07 +0300 vma_can_userfault() has grown pretty big and it's not called on performance critical path. Move it out of line. No functional changes. Link: https://lkml.kernel.org/r/20260330101116.1117699-7-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: David Hildenbrand (Red Hat) Reviewed-by: Liam R. Howlett Cc: Andrea Arcangeli Cc: Andrei Vagin Cc: Axel Rasmussen Cc: Baolin Wang Cc: Harry Yoo Cc: Hugh Dickins Cc: James Houghton Cc: Lorenzo Stoakes (Oracle) Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Muchun Song Cc: Nikita Kalyazin Cc: Oscar Salvador Cc: Paolo Bonzini Cc: Peter Xu Cc: Sean Christopherson Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- include/linux/userfaultfd_k.h | 35 +------------------------------- mm/userfaultfd.c | 33 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 33 deletions(-) --- a/include/linux/userfaultfd_k.h~userfaultfd-move-vma_can_userfault-out-of-line +++ a/include/linux/userfaultfd_k.h @@ -211,39 +211,8 @@ static inline bool userfaultfd_armed(str return vma->vm_flags & __VM_UFFD_FLAGS; } -static inline bool vma_can_userfault(struct vm_area_struct *vma, - vm_flags_t vm_flags, - bool wp_async) -{ - vm_flags &= __VM_UFFD_FLAGS; - - if (vma->vm_flags & VM_DROPPABLE) - return false; - - if ((vm_flags & VM_UFFD_MINOR) && - (!is_vm_hugetlb_page(vma) && !vma_is_shmem(vma))) - return false; - - /* - * If wp async enabled, and WP is the only mode enabled, allow any - * memory type. - */ - if (wp_async && (vm_flags == VM_UFFD_WP)) - return true; - - /* - * If user requested uffd-wp but not enabled pte markers for - * uffd-wp, then shmem & hugetlbfs are not supported but only - * anonymous. - */ - if (!uffd_supports_wp_marker() && (vm_flags & VM_UFFD_WP) && - !vma_is_anonymous(vma)) - return false; - - /* By default, allow any of anon|shmem|hugetlb */ - return vma_is_anonymous(vma) || is_vm_hugetlb_page(vma) || - vma_is_shmem(vma); -} +bool vma_can_userfault(struct vm_area_struct *vma, vm_flags_t vm_flags, + bool wp_async); static inline bool vma_has_uffd_without_event_remap(struct vm_area_struct *vma) { --- a/mm/userfaultfd.c~userfaultfd-move-vma_can_userfault-out-of-line +++ a/mm/userfaultfd.c @@ -2018,6 +2018,39 @@ out: return moved ? moved : err; } +bool vma_can_userfault(struct vm_area_struct *vma, vm_flags_t vm_flags, + bool wp_async) +{ + vm_flags &= __VM_UFFD_FLAGS; + + if (vma->vm_flags & VM_DROPPABLE) + return false; + + if ((vm_flags & VM_UFFD_MINOR) && + (!is_vm_hugetlb_page(vma) && !vma_is_shmem(vma))) + return false; + + /* + * If wp async enabled, and WP is the only mode enabled, allow any + * memory type. + */ + if (wp_async && (vm_flags == VM_UFFD_WP)) + return true; + + /* + * If user requested uffd-wp but not enabled pte markers for + * uffd-wp, then shmem & hugetlbfs are not supported but only + * anonymous. + */ + if (!uffd_supports_wp_marker() && (vm_flags & VM_UFFD_WP) && + !vma_is_anonymous(vma)) + return false; + + /* By default, allow any of anon|shmem|hugetlb */ + return vma_is_anonymous(vma) || is_vm_hugetlb_page(vma) || + vma_is_shmem(vma); +} + static void userfaultfd_set_vm_flags(struct vm_area_struct *vma, vm_flags_t vm_flags) { _ Patches currently in -mm which might be from rppt@kernel.org are userfaultfd-introduce-vm_uffd_ops.patch shmem-userfaultfd-use-a-vma-callback-to-handle-uffdio_continue.patch userfaultfd-introduce-vm_uffd_ops-alloc_folio.patch shmem-userfaultfd-implement-shmem-uffd-operations-using-vm_uffd_ops.patch userfaultfd-mfill_atomic-remove-retry-logic.patch