Thread (49 messages) 49 messages, 9 authors, 2026-08-30

Re: [PATCH 5/6] userfaultfd: decouple fault reason from VMA flags

flat view

From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-08-25 11:08:43
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

quoted
quoted
@@ -2793,14 +2793,14 @@ static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx,
 	 * If VMA has UFFD WP faults enabled and WP fault, wait for userspace to
 	 * resolve the fault.
 	 */
-	if (!pte_write(ptent) && (reason & VM_UFFD_WP))
+	if (!pte_write(ptent) && (reason & USERFAULT_WP))
I wonder if you could actually

You do this quite a lot and they read a bit horribly with the && and & on the
same sight-line. With the changes to the enum proposed above you could do:

	if (!pte_write(ptent) && test_bit(reason, USERFAULT_WP_BIT))
I find && and & perfectly readable and adding _BIT defines looks really
excessive to me.
Yeah, that looks alright to me as well.

-- 
Cheers,

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help