Revert "rhashtable: Use __vmalloc with GFP_ATOMIC for table allocation"
authorDavid S. Miller <davem@davemloft.net>
Sun, 6 Dec 2015 03:47:11 +0000 (22:47 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 6 Dec 2015 03:47:11 +0000 (22:47 -0500)
This reverts commit d3716f18a7d841565c930efde30737a3557eee69.

vmalloc cannot be used in BH disabled contexts, even
with GFP_ATOMIC.  And we certainly want to support
rhashtable users inserting entries with software
interrupts disabled.

Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c

index 1c624db90e884ec46a912b4695f5f5f65c8ee1d5..2ff7ed91663ae4fd105c24ad98454a51c329cf86 100644 (file)
@@ -120,9 +120,8 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht,
        if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER) ||
            gfp != GFP_KERNEL)
                tbl = kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY);
-       if (tbl == NULL)
-               tbl = __vmalloc(size, gfp | __GFP_HIGHMEM | __GFP_ZERO,
-                               PAGE_KERNEL);
+       if (tbl == NULL && gfp == GFP_KERNEL)
+               tbl = vzalloc(size);
        if (tbl == NULL)
                return NULL;