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.
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
{
unsigned long free, allowed, reserve;
+#ifdef CONFIG_DEBUG_VM
+ WARN_ONCE(percpu_counter_read(&vm_committed_as) <
+ -(s64)vm_committed_as_batch * num_online_cpus(),
+ "memory commitment underflow");
+#endif
+
vm_acct_memory(pages);
/*