|
@@ -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);
|
|
|
|
|
|
/*
|