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

From: Linus Torvalds
Date: Sat Jan 23 2016 - 13:51:29 EST


On Sat, Jan 23, 2016 at 2:00 AM, Konstantin Khlebnikov <koct9i@xxxxxxxxx> wrote:
> + if ((flags & (VM_WRITE | VM_SHARED |
> + (VM_STACK_FLAGS & (VM_GROWSUP | VM_GROWSDOWN)))) == VM_WRITE &&
> + mm->data_vm + npages > rlimit(RLIMIT_DATA) >> PAGE_SHIFT &&
> + !WARN_ONCE(ignore_rlimit_data, "VmData %lu exceeds RLIMIT_DATA %lu",
> + (mm->data_vm + npages)<<PAGE_SHIFT, rlimit(RLIMIT_DATA)))
> + return false;

This needs to be rewritten as an inline helper function or made
readable some other way.

It looks like line noise (or perl). That kind of code should not exist.

Linus