[PATCH 0/2] make VM_SOFTDIRTY a sticky VMA flag

From: Lorenzo Stoakes

Date: Fri Nov 14 2025 - 12:53:41 EST


Currently we set VM_SOFTDIRTY when a new mapping is set up (whether by
establishing a new VMA, or via merge) as implemented in __mmap_complete()
and do_brk_flags().

However, when performing a merge of existing mappings such as when
performing mprotect(), we may lose the VM_SOFTDIRTY flag.


Lorenzo Stoakes (2):
mm: propagate VM_SOFTDIRTY on merge
testing/selftests/mm: add soft-dirty merge self-test

include/linux/mm.h | 23 ++++++-----
tools/testing/selftests/mm/soft-dirty.c | 51 ++++++++++++++++++++++++-
tools/testing/vma/vma_internal.h | 23 ++++++-----
3 files changed, 72 insertions(+), 25 deletions(-)

--
2.51.0