summaryrefslogtreecommitdiffstats
path: root/lib/crc-ccitt.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-15 05:30:47 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-17 00:08:26 +0200
commit07ee0722bf941960fb3888f9c9b5839473372fd1 (patch)
treed80ad157b570da14e08e25bb32c5d58af5d969c3 /lib/crc-ccitt.c
parentnet: phy: Make sure PHY_RESUMING state change is always processed (diff)
downloadlinux-07ee0722bf941960fb3888f9c9b5839473372fd1.tar.xz
linux-07ee0722bf941960fb3888f9c9b5839473372fd1.zip
rhashtable: Add cap on number of elements in hash table
We currently have no limit on the number of elements in a hash table. This is a problem because some users (tipc) set a ceiling on the maximum table size and when that is reached the hash table may degenerate. Others may encounter OOM when growing and if we allow insertions when that happens the hash table perofrmance may also suffer. This patch adds a new paramater insecure_max_entries which becomes the cap on the table. If unset it defaults to max_size * 2. If it is also zero it means that there is no cap on the number of elements in the table. However, the table will grow whenever the utilisation hits 100% and if that growth fails, you will get ENOMEM on insertion. As allowing oversubscription is potentially dangerous, the name contains the word insecure. Note that the cap is not a hard limit. This is done for performance reasons as enforcing a hard limit will result in use of atomic ops that are heavier than the ones we currently use. The reasoning is that we're only guarding against a gross over- subscription of the table, rather than a small breach of the limit. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/crc-ccitt.c')
0 files changed, 0 insertions, 0 deletions