]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: better high order allocation attempts
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Feb 2015 23:53:38 +0000 (00:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Feb 2015 22:38:09 +0000 (17:38 -0500)
commit67737d1691bb7d024979288f4f692b75ae0d1915
tree75f3fee2718ab7194dca0153ff765484b412401a
parentb1252ee011d0b25efa0ab81033259d9aabf786e3
rhashtable: better high order allocation attempts

When trying to allocate future tables via bucket_table_alloc(), it seems
overkill on large table shifts that we probe for kzalloc() unconditionally
first, as it's likely to fail.

Only probe with kzalloc() for more reasonable table sizes and use vzalloc()
either as a fallback on failure or directly in case of large table sizes.

Fixes: 91a81ec0aa97 ("lib: Resizable, Scalable, Concurrent Hash Table")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c