2 --- a/compat/lib-rhashtable.c
3 +++ b/compat/lib-rhashtable.c
4 @@ -175,10 +175,11 @@ static struct bucket_table *bucket_table
7 size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]);
8 - if (gfp != GFP_KERNEL)
9 + if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER) ||
11 tbl = kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY);
13 - tbl = kvzalloc(size, gfp);
14 + if (tbl == NULL && gfp == GFP_KERNEL)
15 + tbl = vzalloc(size);