summaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 11d04d453..2140eac53 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -251,7 +251,23 @@ extern inline unsigned long get_free_page(int gfp_mask)
}
/* memory.c & swap.c*/
-extern int free_memory_available(void);
+
+/*
+ * This traverses "nr" memory size lists,
+ * and returns true if there is enough memory.
+ *
+ * For example, we want to keep on waking up
+ * kswapd every once in a while until the highest
+ * memory order has an entry (ie nr == 0), but
+ * we want to do it in the background.
+ *
+ * We want to do it in the foreground only if
+ * none of the three highest lists have enough
+ * memory. Random number.
+ */
+extern int free_memory_available(int nr);
+#define kswapd_continue() (!free_memory_available(3))
+#define kswapd_wakeup() (!free_memory_available(0))
#define free_page(addr) free_pages((addr),0)
extern void FASTCALL(free_pages(unsigned long addr, unsigned long order));