From: NeilBrown Date: Fri, 24 Jan 2020 15:26:34 +0000 (-0500) Subject: LU-8130 lov: convert lo[v|d]_pool to use rhashtable X-Git-Tag: 2.13.53~249 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2124e07ddde7789ebf0e8ec5600f2aff31788123;hp=2124e07ddde7789ebf0e8ec5600f2aff31788123;p=fs%2Flustre-release.git LU-8130 lov: convert lo[v|d]_pool to use rhashtable The pools hashtable can be implemented using the rhashtable implementation in lib. This has the benefit that lookups are lock-free. We need to use kfree_rcu() to free a pool so that a lookup racing with a deletion will not access freed memory. rhashtable has no combined lookup-and-delete interface, but as the lookup is lockless and the chains are short, this brings little cost. Even if a lookup finds a pool, we must be prepared for the delete to fail to find it, as we might race with another thread doing a delete. We use atomic_inc_not_zero() after finding a pool in the hash table and if that fails, we must have raced with a deletion, so we treat the lookup as a failure. Use hashlen_string() rather than a hand-crafted hash function. Note that the pool_name, and the search key, are guaranteed to be nul terminated. Based on Linux-commit: 055ed193b190edac539f37a66699b02eae3a19a9 with the port of server side pool handling to rhashtables. Change-Id: Ia5b4cbbd17515ea43a473e91719b3665f46b0d0a Signed-off-by: NeilBrown Reviewed-on: https://review.whamcloud.com/32662 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin ---