]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: kill ht->shift atomic operations
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 12 Mar 2015 14:28:40 +0000 (15:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Mar 2015 03:02:30 +0000 (23:02 -0400)
commit9aff26dd60c964e3d6ee69f28aa7e10a7268de05
tree6b068157f7e2efb5d71978d3a63d14754bcd6a7c
parentd16d6a68f44a03142a8b6d0ef0b7fa4dee9caa6c
rhashtable: kill ht->shift atomic operations

Commit 4765b1160fc2 ("rhashtable: avoid unnecessary wakeup for worker
queue") changed ht->shift to be atomic, which is actually unnecessary.

Instead of leaving the current shift in the core rhashtable structure,
it can be cached inside the individual bucket tables.

There, it will only be initialized once during a new table allocation
in the shrink/expansion slow path, and from then onward it stays immutable
for the rest of the bucket table liftime.

That allows shift to be non-atomic. The patch also moves hash_rnd
management into the table setup. The rhashtable structure now consumes
3 instead of 4 cachelines.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ying Xue <ying.xue@windriver.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c