Skip to content

mm: mlock: fix some locked_vm counting issues

[email protected] linux-mm lkml 1 version Applied

Status from this message: [merged] selftests-vm-add-test-for-mlock-when-areas-are-intersected.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesApplied 4/4

Patches in v1 All 4 applied

#Subject and filesSizeRepliesApplied
1/4mm: mlock: check against vma for actual mlock() sizemm/mlock.c+49 -01 replyApplied
2/4mm: mlock: avoid increase mm->locked_vm on mlock() when already mlock2(,MLOCK_ONFAULT)mm/mlock.c+3 -01 replyApplied
3/4selftest: split mlock2_ funcs into separate mlock2.htools/testing/selftests/vm/mlock2-tests.c tools/testing/selftests/vm/mlock2.h+21 -200 repliesApplied
4/4selftests/vm: add test for mlock() when areas are intersected.tools/testing/selftests/vm/.gitignore tools/testing/selftests/vm/Makefile tools/testing/selftests/vm/mlock-intersect-test.c+81 -02 repliesApplied

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchKirill A. Shutemov
1/4
2/4A-b
3/4
4/4

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

Read the v1 thread

Cover letter [PATCH 0/4] mm: mlock: fix some locked_vm counting issues

From: Simon Guo <[email protected]>

This patch set fixes some mlock() misbehavior when mlock()/mlock2() is invoked multiple times on intersect or same address regions.

And add selftest for this case.

Simon Guo (4):
mm: mlock: check against vma for actual mlock() size
mm: mlock: avoid increase mm->locked_vm on mlock() when already
mlock2(,MLOCK_ONFAULT)
selftest: split mlock2_ apis into separate mlock2.h selftests/vm: add test for mlock() when areas are intersected.

 mm/mlock.c                                        | 53 ++++++++++++++++
 tools/testing/selftests/vm/.gitignore             |  1 +
 tools/testing/selftests/vm/Makefile               |  4 ++
 tools/testing/selftests/vm/mlock-intersect-test.c | 76 +++++++++++++++++++++++
 tools/testing/selftests/vm/mlock2-tests.c         | 21 +------
 tools/testing/selftests/vm/mlock2.h               | 21 +++++++
 6 files changed, 156 insertions(+), 20 deletions(-)
 create mode 100644 tools/testing/selftests/vm/mlock-intersect-test.c
 create mode 100644 tools/testing/selftests/vm/mlock2.h
Signature · 7 lines
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>