]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - lib/rhashtable.c
rhashtable: Add immediate rehash during insertion
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 23 Mar 2015 13:50:28 +0000 (00:50 +1100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2015 02:07:52 +0000 (22:07 -0400)
commitccd57b1bd32460d27bbb9c599e795628a3c66983
tree320a409508ea1e83a335804bf3d1a840227cb7b7
parentb9ecfdaa1090b5988422eaf5348ea1954d2d7219
rhashtable: Add immediate rehash during insertion

This patch reintroduces immediate rehash during insertion.  If
we find during insertion that the table is full or the chain
length exceeds a set limit (currently 16 but may be disabled
with insecure_elasticity) then we will force an immediate rehash.
The rehash will contain an expansion if the table utilisation
exceeds 75%.

If this rehash fails then the insertion will fail.  Otherwise the
insertion will be reattempted in the new hash table.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c