在 2024/3/18 17:59, David Hildenbrand 写道:
On 18.03.24 10:04, Jinjiang Tu wrote:
commit 3c6f33b7273a ("mm/ksm: support fork/exec for prctl") inherits
MMF_VM_MERGE_ANY flag when a task calls execve(). Howerver, it doesn't
create the mm_slot, so ksmd will not try to scan this task.
To fix it, allocate and add the mm_slot to ksm_mm_head in
__bprm_mm_init()
when the mm has MMF_VM_MERGE_ANY flag.
Fixes: 3c6f33b7273a ("mm/ksm: support fork/exec for prctl")
Signed-off-by: Jinjiang Tu <tujinjiang@xxxxxxxxxx>
---
Can we also please extend the KSM selftest?
tools/testing/selftests/mm/ksm_functional_tests.c
We do have test_prctl_fork_exec(), but in ksm_fork_exec_child() we
only test if the flag is set, not if de-duplication using the ksm
daemon actually works.
OK, I will try to extend the selftest.