CHROMIUM: fix low-memory notification patch (change Iec1eb499)
authorLuigi Semenzato <semenzato@chromium.org>
Tue, 14 Feb 2012 19:52:10 +0000 (11:52 -0800)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:14:38 +0000 (15:14 -0700)
Somehow the low-memory notification patch had a couple of errors,
which couldn't get noticed because the config option was off.
This goes with https://gerrit.chromium.org/gerrit/#change,14635.

BUG=chromium-os:20086
TEST=no test for this change

Change-Id: Ib07af40d87c9ad3889990db9652d173fcd24d5f9
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15833
Reviewed-by: Olof Johansson <olofj@chromium.org>
include/linux/low-mem-notify.h
mm/low-mem-notify.c

index c696c0a..27978a3 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef _LINUX_LOW_MEM_NOTIFY_H
 #define _LINUX_LOW_MEM_NOTIFY_H
 
+#include <linux/stddef.h>
+#include <linux/mm.h>
+
 extern unsigned low_mem_margin_percent;
 extern unsigned long low_mem_minfree;
 void low_mem_notify(void);
index cf708f6..985e7ed 100644 (file)
@@ -33,7 +33,7 @@
 static DECLARE_WAIT_QUEUE_HEAD(low_mem_wait);
 static atomic_t low_mem_state = ATOMIC_INIT(0);
 unsigned low_mem_margin_percent = 10;
-unsigned long low_mem_threshold;
+unsigned long low_mem_minfree;
 
 struct low_mem_notify_file_info {
        unsigned long unused;
@@ -121,9 +121,7 @@ static ssize_t low_mem_margin_store(struct kobject *kobj,
        low_mem_margin_percent = (unsigned int) margin;
        /* Precompute as much as possible outside the allocator fast path. */
        low_mem_minfree = low_mem_margin_to_minfree(low_mem_margin_percent);
-       printk(KERN_INFO "low_mem: setting threshold to %lu\n",
-              low_mem_threshold);
-
+       printk(KERN_INFO "low_mem: setting minfree to %lu\n", low_mem_minfree);
        return count;
 }
 LOW_MEM_ATTR(margin);