]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Remove default GFP_NOFS allocations
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 19 Mar 2011 20:49:14 +0000 (13:49 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 19 Mar 2011 21:50:39 +0000 (14:50 -0700)
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.

include/sys/kmem.h

index fd4c52e1ece801f90cd0cbbde28268bb560714a4..6b6b95c12e3192439af144aa549b3d8ef8933ca2 100644 (file)
 /*
  * 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