From: behlendo Date: Mon, 3 Nov 2008 21:51:33 +0000 (+0000) Subject: Under Solaris KM_SLEEP ensures success (or at least you hang forever). X-Git-Tag: spl-0.4.0~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c22e7a427bfbea456e783c918fad817f3c4f34ce;p=spl Under Solaris KM_SLEEP ensures success (or at least you hang forever). 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 --- diff --git a/include/sys/kmem.h b/include/sys/kmem.h index 8284810..ef401ad 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -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)