Skip to content

mm/ksm: fix ksm exec support for prctl

Jinjiang Tu linux-mm 3 versions – Applied

Status from this message: [merged mm-stable] selftest-mm-ksm_functional_tests-extend-test-case-for-ksm-fork-exec.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 2 repliesApplied 3/3
  2. v3 posting 2/23 patches 2 repliesSuperseded
  3. v3 posting 1/21 patch 6 repliesSuperseded

Changes in v4 from the cover letter

- collect Review-by tag.
- refactor selftests.

Patches in v4 All 3 applied

#Subject and filesSizeRepliesApplied
1/3mm/ksm: fix ksm exec support for prctlfs/exec.c include/linux/ksm.h+24 -00 repliesApplied
2/3selftest/mm: ksm_functional_tests: refactor mmap_and_merge_range()tools/testing/selftests/mm/ksm_functional_tests.c+61 -251 replyApplied
3/3selftest/mm: ksm_functional_tests: extend test case for ksm fork/exectools/testing/selftests/mm/ksm_functional_tests.c+38 -111 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDavid Hildenbrand
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] mm/ksm: fix ksm exec support for prctl

commit 3c6f33b7273a ("mm/ksm: support fork/exec for prctl") inherits MMF_VM_MERGE_ANY flag when a task calls execve(). However, it doesn't create the mm_slot, so ksmd will not try to scan this task. The first patch fixes the issue.

The second patch refactors to prepare for the third patch. The third patch extends the selftests of ksm to verfity the deduplication really happens after fork/exec inherits ths KSM setting.

Changelog since v3:
- collect Review-by tag.
- refactor selftests.

Changelog since v2:
- fix uninitialized warning reported by kernel test robot.
- refactor selftests.

Changelog since v1:
- Add ksm cleanup in __bprm_mm_init() when error occurs.
- Add some comment.
- Extend the selftests of ksm fork/exec.

Jinjiang Tu (3):
mm/ksm: fix ksm exec support for prctl
selftest/mm: ksm_functional_tests: refactor mmap_and_merge_range() selftest/mm: ksm_functional_tests: extend test case for ksm fork/exec

 fs/exec.c                                     |  11 ++
 include/linux/ksm.h                           |  13 ++
 .../selftests/mm/ksm_functional_tests.c       | 135 +++++++++++++-----
 3 files changed, 123 insertions(+), 36 deletions(-)
Signature · 1 line
2.25.1