From f90096c9056b5d3c653c53181a64f5ea6794163f Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 1 May 2012 09:34:39 -0400 Subject: [PATCH] Modify KM_PUSHPAGE to use GFP_NOIO instead of GFP_NOFS 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 Issue zfsonlinux/zfs#342 Closes #105 --- include/sys/kmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/kmem.h b/include/sys/kmem.h index aa5a454766..eda4eee8d3 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -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