diff options
| author | Simon Guo <[email protected]> | 2016-10-07 16:59:36 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2016-10-07 18:46:28 -0700 |
| commit | 0cf2f6f6dc605e587d2c1120f295934c77e810e8 (patch) | |
| tree | 9c8bdb773bf8edafab427f42f4c649b41048a9f7 /tools/perf/scripts/python | |
| parent | 9254990fb9f0f15f25605748da20cfbeced7c816 (diff) | |
mm: mlock: check against vma for actual mlock() size
In do_mlock(), the check against locked memory limitation has a hole
which will fail following cases at step 3):
1) User has a memory chunk from addressA with 50k, and user mem lock
rlimit is 64k.
2) mlock(addressA, 30k)
3) mlock(addressA, 40k)
The 3rd step should have been allowed since the 40k request is
intersected with the previous 30k at step 2), and the 3rd step is
actually for mlock on the extra 10k memory.
This patch checks vma to caculate the actual "new" mlock size, if
necessary, and ajust the logic to fix this issue.
[[email protected]: clean up comment layout]
[[email protected]: correct a typo in count_mm_mlocked_page_nr()]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Simon Guo <[email protected]>
Cc: Alexey Klimov <[email protected]>
Cc: Eric B Munson <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Simon Guo <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions