]> granicus.if.org Git - zfs/commitdiff
Under Solaris KM_SLEEP ensures success (or at least you hang forever).
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 3 Nov 2008 21:51:33 +0000 (21:51 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 3 Nov 2008 21:51:33 +0000 (21:51 +0000)
That said when working with a finite resource like memory failure really
is always a possibility.  It would be far better longer term if the ZFS
code could be weened off this assumption and properly handle the cases
where an allocation fails.  Still I've applied the patch to spl-0.3.4
since this layer is supposed to emulate Solaris as closely as possible.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@164 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

include/sys/kmem.h

index 82848107058b1293cb5f233c9e8ccb88a8d85874..ef401ade4e3df924dd713e26efad3fc76e95a10c 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
 /*
  * Memory allocation interfaces
  */
-#define KM_SLEEP                        GFP_KERNEL
+#define KM_SLEEP                        (GFP_KERNEL | __GFP_NOFAIL)
 #define KM_NOSLEEP                      GFP_ATOMIC
 #undef  KM_PANIC                        /* No linux analog */
 #define KM_PUSHPAGE                     (KM_SLEEP | __GFP_HIGH)