Thread (15 messages) read the whole thread 15 messages, 3 authors, 2018-06-04

Re: [PATCH 2/5] lib/rhashtable: guarantee initial hashtable allocation

From: Michal Hocko <mhocko@kernel.org>
Date: 2018-06-04 11:46:33
Also in: lkml

On Fri 01-06-18 09:01:22, Davidlohr Bueso wrote:
[...]
quoted hunk ↗ jump to hunk
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 05a4b1b8b8ce..ae17da6f0c75 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -175,7 +175,7 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht,
 	int i;
 
 	size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]);
-	if (gfp != GFP_KERNEL)
+	if ((gfp & ~__GFP_NOFAIL) != GFP_KERNEL)
 		tbl = kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY);
 	else
 		tbl = kvzalloc(size, gfp);
Just a heads up. This is not longer needed after
http://lkml.kernel.org/r/20180601115329.27807-1-mhocko@kernel.org
is applied. Moreover it will conflict at that spot.

-- 
Michal Hocko
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help