Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1318451

Re: [PATCH v3] mm: warn about VmData over RLIMIT_DATA

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3] mm: warn about VmData over RLIMIT_DATA
Date 2016-01-26 23:50 +0100
Message-ID <qVkAW-2yI-21@gated-at.bofh.it> (permalink)
References <qUdrP-8sv-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, 23 Jan 2016 23:52:29 +0300 Konstantin Khlebnikov <koct9i@gmail.com> wrote:

> This patch fixes 84638335900f ("mm: rework virtual memory accounting")

uh, I think I'll rewrite this to

: This patch provides a way of working around a slight regression introduced
: by 84638335900f ("mm: rework virtual memory accounting").

> Before that commit RLIMIT_DATA have control only over size of the brk region.
> But that change have caused problems with all existing versions of valgrind,
> because it set RLIMIT_DATA to zero.
> 
> This patch fixes rlimit check (limit actually in bytes, not pages)
> and by default turns it into warning which prints at first VmData misuse:
> "mmap: top (795): VmData 516096 exceed data ulimit 512000. Will be forbidden soon."
> 
> Behavior is controlled by boot param ignore_rlimit_data=y/n and by sysfs
> /sys/module/kernel/parameters/ignore_rlimit_data. For now it set to "y".
> 
> 
> ...
>
> +static inline bool is_data_mapping(vm_flags_t flags)
> +{
> +	return (flags & ((VM_STACK_FLAGS & (VM_GROWSUP | VM_GROWSDOWN)) |
> +					VM_WRITE | VM_SHARED)) == VM_WRITE;
> +}

This (copied from existing code) hurts my brain.  We're saying "if it
isn't stack and it's unshared and writable, it's data", yes?

hm.  I guess that's because with a shared mapping we don't know who to
blame for the memory consumption so we blame nobody.  But what about
non-shared read-only mappings?

Can we please have a comment here fully explaining the thinking?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] mm: warn about VmData over RLIMIT_DATA Konstantin Khlebnikov <koct9i@gmail.com> - 2016-01-23 22:00 +0100
  Re: [PATCH v3] mm: warn about VmData over RLIMIT_DATA Andrew Morton <akpm@linux-foundation.org> - 2016-01-26 23:50 +0100
    Re: [PATCH v3] mm: warn about VmData over RLIMIT_DATA Konstantin Khlebnikov <koct9i@gmail.com> - 2016-01-27 10:10 +0100

csiph-web