Thread (17 messages) flat view 17 messages, 3 authors, 2015-03-24

Re: [v1 PATCH 9/10] rhashtable: Allow GFP_ATOMIC bucket table allocation

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2015-03-22 08:02:29

On Sun, Mar 22, 2015 at 06:53:52PM +1100, Herbert Xu wrote:
.
 	size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]);
-	if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER))
-		tbl = kzalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
+	if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER) ||
+	    gfp != GFP_KERNEL)
+		tbl = kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY);
 	if (tbl == NULL)
 		tbl = vzalloc(size);
Oops, this will still attempt vzalloc.  I will send a v2.
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help