rhashtable: use cond_resched()
authorEric Dumazet <edumazet@google.com>
Thu, 26 Feb 2015 15:20:34 +0000 (07:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Feb 2015 22:55:14 +0000 (17:55 -0500)
commit5beb5c90c1f54d745da040aa05634a5830ba4a4c
tree4626f1033a05b15b4cd046d066de1011c7a7f67d
parent061c1a6e367855a9ed1110ba059bc2e7634fd429
rhashtable: use cond_resched()

If a hash table has 128 slots and 16384 elems, expand to 256 slots
takes more than one second. For larger sets, a soft lockup is detected.

Holding cpu for that long, even in a work queue is a show stopper
for non preemptable kernels.

cond_resched() at strategic points to allow process scheduler
to reschedule us.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c