Skip to content

Commit

Permalink
mm: always print RLIMIT_DATA warning
Browse files Browse the repository at this point in the history
The documentation for ignore_rlimit_data says that it will print a
warning at first misuse.  Yet it doesn't seem to do that.

Fix the code to print the warning even when we allow the process to
continue.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Woodhouse <[email protected]>
Acked-by: Konstantin Khlebnikov <[email protected]>
Cc: Cyrill Gorcunov <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dwmw2 authored and torvalds committed Apr 6, 2018
1 parent c01f0b5 commit 57a7702
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3191,13 +3191,15 @@ bool may_expand_vm(struct mm_struct *mm, vm_flags_t flags, unsigned long npages)
if (rlimit(RLIMIT_DATA) == 0 &&
mm->data_vm + npages <= rlimit_max(RLIMIT_DATA) >> PAGE_SHIFT)
return true;
if (!ignore_rlimit_data) {
pr_warn_once("%s (%d): VmData %lu exceed data ulimit %lu. Update limits or use boot option ignore_rlimit_data.\n",
current->comm, current->pid,
(mm->data_vm + npages) << PAGE_SHIFT,
rlimit(RLIMIT_DATA));

pr_warn_once("%s (%d): VmData %lu exceed data ulimit %lu. Update limits%s.\n",
current->comm, current->pid,
(mm->data_vm + npages) << PAGE_SHIFT,
rlimit(RLIMIT_DATA),
ignore_rlimit_data ? "" : " or use boot option ignore_rlimit_data");

if (!ignore_rlimit_data)
return false;
}
}

return true;
Expand Down

0 comments on commit 57a7702

Please sign in to comment.