Konstantin Khlebnikov f4fcd55841 mm: enable RLIMIT_DATA by default with workaround for valgrind
Since commit 84638335900f ("mm: rework virtual memory accounting")
RLIMIT_DATA limits both brk() and private mmap() but this's disabled by
default because of incompatibility with older versions of valgrind.

Valgrind always set limit to zero and fails if RLIMIT_DATA is enabled.
Fortunately it changes only rlim_cur and keeps rlim_max for reverting
limit back when needed.

This patch checks current usage also against rlim_max if rlim_cur is
zero.  This is safe because task anyway can increase rlim_cur up to
rlim_max.  Size of brk is still checked against rlim_cur, so this part
is completely compatible - zero rlim_cur forbids brk() but allows
private mmap().

Link: http://lkml.kernel.org/r/56A28613.5070104@de.ibm.com
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-20 17:58:30 -07:00
..
2015-11-05 19:34:48 -08:00
2015-06-24 17:49:45 -07:00
2011-07-26 16:49:47 -07:00
2016-03-17 15:09:34 -07:00
2016-03-25 16:37:42 -07:00
2015-09-08 15:35:28 -07:00
2016-01-21 17:20:51 -08:00
2016-03-17 15:09:34 -07:00
2015-11-05 19:34:48 -08:00
2016-03-17 15:09:34 -07:00
2016-03-25 16:37:42 -07:00
2016-05-19 19:12:14 -07:00
2016-05-20 17:58:30 -07:00
2016-05-05 17:38:53 -07:00