]> git.proxmox.com Git - mirror_spl.git/commitdiff
Modify KM_PUSHPAGE to use GFP_NOIO instead of GFP_NOFS
authorRichard Yao <ryao@cs.stonybrook.edu>
Tue, 1 May 2012 13:34:39 +0000 (09:34 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 7 May 2012 19:05:27 +0000 (12:05 -0700)
The resolution of issue #31 made KM_PUSHPAGE imply GFP_NOFS.  This
was done to prevent situations where filesystem operations which are
holding locks enter direct reclaim and attempt to reaquire those
same locks.  This clearly will result in a deadlock.

This works for datasets which are implemented in terms for filesystem
operations.  But unfortunately, swapping to a zvol will encounter
many of the same deadlocks and GFP_NOFS will not prevent this.  As
such, it is appropriate to extend KM_PUSHPAGE to use the broader
GFP_NOIO mask to handle these non-filesystem cases.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#342
Closes #105

include/sys/kmem.h

index aa5a454766c525fb1e246d94d48e87c392be76cb..eda4eee8d3abbf6cfc210d003789fdb6ef145b02 100644 (file)
@@ -43,7 +43,7 @@
  */
 #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_PUSHPAGE    (GFP_NOIO | __GFP_HIGH) /* Use reserved memory */
 #define KM_NODEBUG     __GFP_NOWARN    /* Suppress warnings */
 #define KM_FLAGS       __GFP_BITS_MASK
 #define KM_VMFLAGS     GFP_LEVEL_MASK