On Fri, Aug 26, 2016 at 10:00 AM, Cong Wang <[email protected]> wrote: > On Fri, Aug 26, 2016 at 8:41 AM, Eric Dumazet <[email protected]> wrote: >> >> There is a trivial bug in alloc_bucket_locks() >> I will send a patch. > > > Yeah, the 'else' branch looks so suspicious. ;)
It was correct until... commit 4cf0b354d92ee2c642532ee39e330f8f580fd985 Author: Florian Westphal <[email protected]> Date: Fri Aug 12 12:03:52 2016 +0200 rhashtable: avoid large lock-array allocations which is: @@ -83,6 +83,9 @@ static int alloc_bucket_locks(struct rhashtable *ht, struct bucket_table *tbl, tbl->locks = vmalloc(size * sizeof(spinlock_t)); else #endif + if (gfp != GFP_KERNEL) + gfp |= __GFP_NOWARN | __GFP_NORETRY; + tbl->locks = kmalloc_array(size, sizeof(spinlock_t), gfp);
