mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-08 18:43:21 +01:00
mm: catch memory commitment underflow
Print a warning (if CONFIG_DEBUG_VM=y) when memory commitment becomes too negative. This shouldn't happen any more - the previous two patches fixed the committed_as underflow issues. [[email protected]: use VM_WARN_ONCE, per Dave] Signed-off-by: Konstantin Khlebnikov <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Dave Hansen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
7714251799
commit
82f71ae4a2
1 file changed
+5
@@ -31,6 +31,7 @@
|
||||
#include <linux/mempolicy.h>
|
||||
#include <linux/rmap.h>
|
||||
#include <linux/mmu_notifier.h>
|
||||
#include <linux/mmdebug.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/audit.h>
|
||||
#include <linux/khugepaged.h>
|
||||
@@ -134,6 +135,10 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
|
||||
{
|
||||
unsigned long free, allowed, reserve;
|
||||
|
||||
VM_WARN_ONCE(percpu_counter_read(&vm_committed_as) <
|
||||
-(s64)vm_committed_as_batch * num_online_cpus(),
|
||||
"memory commitment underflow");
|
||||
|
||||
vm_acct_memory(pages);
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user