aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2011-03-19 13:49:14 -0700
committerBrian Behlendorf <behlendorf1@llnl.gov>2011-03-19 14:50:39 -0700
commitcb255ae57278be3206693b5116eff95e612e809a (patch)
treec5c344b1fb84957435807fda42bfed86571ad514 /include
parent181a9b89988a00a3faa06203b94cc155f10fe1e7 (diff)
Remove default GFP_NOFS allocations
As originally described in commit 82b8c8fa64737edfb203156b245b48840139d2c1 this was done to prevent certain deadlocks from occuring in the system. However, as suspected the price for doing this proved to be too high. The VM is having a hard time effectively reclaiming memory thus we are reverting this change. However, we still need to fundamentally handle the issue. Under Solaris the KM_PUSHPAGE mask is used commonly in I/O paths to ensure a memory allocations will succeed. We leverage this fact and redefine KM_PUSHPAGE to include GFP_NOFS. This ensures that in these common I/O path we don't trigger additional reclaim. This minimizes the change to the Solaris code.
Diffstat (limited to 'include')
-rw-r--r--include/sys/kmem.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h
index fd4c52e1e..6b6b95c12 100644
--- a/include/sys/kmem.h
+++ b/include/sys/kmem.h
@@ -41,13 +41,12 @@
/*
* Memory allocation interfaces
*/
-#define KM_SLEEP GFP_NOFS
-#define KM_NOSLEEP GFP_ATOMIC
-#undef KM_PANIC /* No linux analog */
-#define KM_PUSHPAGE (KM_SLEEP | __GFP_HIGH)
-#define KM_VMFLAGS GFP_LEVEL_MASK
-#define KM_FLAGS __GFP_BITS_MASK
-#define KM_NODEBUG __GFP_NOWARN
+#define KM_SLEEP GFP_KERNEL /* Can sleep, never fails */
+#define KM_NOSLEEP GFP_ATOMIC /* Can not sleep, may fail */
+#define KM_PUSHPAGE (GFP_NOFS | __GFP_HIGH) /* Use reserved memory */
+#define KM_NODEBUG __GFP_NOWARN /* Suppress warnings */
+#define KM_FLAGS __GFP_BITS_MASK
+#define KM_VMFLAGS GFP_LEVEL_MASK
/*
* Used internally, the kernel does not need to support this flag