aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/compaction-times.py
diff options
context:
space:
mode:
authorDavid Rientjes <[email protected]>2017-02-24 14:58:47 -0800
committerLinus Torvalds <[email protected]>2017-02-24 17:46:55 -0800
commitdef5efe0376501ef7bd6b53ed061512c142e59aa (patch)
tree46c957c37989924f2a970f09e15fc90d757999bf /tools/perf/scripts/python/compaction-times.py
parent712c604dcdf8186295e2af694adf52c6842ad100 (diff)
mm, madvise: fail with ENOMEM when splitting vma will hit max_map_count
If madvise(2) advice will result in the underlying vma being split and the number of areas mapped by the process will exceed /proc/sys/vm/max_map_count as a result, return ENOMEM instead of EAGAIN. EAGAIN is returned by madvise(2) when a kernel resource, such as slab, is temporarily unavailable. It indicates that userspace should retry the advice in the near future. This is important for advice such as MADV_DONTNEED which is often used by malloc implementations to free memory back to the system: we really do want to free memory back when madvise(2) returns EAGAIN because slab allocations (for vmas, anon_vmas, or mempolicies) cannot be allocated. Encountering /proc/sys/vm/max_map_count is not a temporary failure, however, so return ENOMEM to indicate this is a more serious issue. A followup patch to the man page will specify this behavior. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: David Rientjes <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Jerome Marchand <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Anshuman Khandual <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions