[PATCH] mm: always fallback to PTE mappings for shared write faults
From: Pedro Falcato
Date: Thu Aug 20 2026 - 08:07:20 EST
Signed-off-by: Pedro Falcato <pfalcato@xxxxxxx>
---
mm/memory.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mm/memory.c b/mm/memory.c
index b4be57b590ce..d37f8a0f8355 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -5778,6 +5778,16 @@ vm_fault_t finish_fault(struct vm_fault *vmf)
*/
needs_fallback = !shmem_mapping(mapping) &&
file_end < folio_next_index(folio);
+
+ if (vma->vm_flags & VM_SHARED && vma->vm_ops->page_mkwrite &&
+ vmf->flags & FAULT_FLAG_WRITE) {
+ /*
+ * Filesystems that want write notification want as
+ * much granular of a mapping as possible. Don't
+ * install writable THPs for those.
+ */
+ needs_fallback = true;
+ }
}
if (pmd_none(*vmf->pmd)) {
--
2.55.0
--xqewysoglul6w752--