From: NeilBrown Date: Thu, 15 Nov 2018 19:03:01 +0000 (-0500) Subject: LU-11089 obdclass: make key_set_version an atomic_t X-Git-Tag: 2.12.52~53 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=inline;h=e9213217691ae78d15237b0c5ecd3ba0b0416652;hp=e9213217691ae78d15237b0c5ecd3ba0b0416652;p=fs%2Flustre-release.git LU-11089 obdclass: make key_set_version an atomic_t As a first step to simplifying the locking in lu_object.c, change key_set_version to an atomic_t. This will mean we don't need to hold a spinlock when incrementing. It is clear that keys_fill() (and so lu_context_refill()) cannot race with itself as it holds no locks for the main part of the work. So updates to lc_version, and testing of that value cannot need locking either. So remove the locking from keys_fill() and lu_context_refill() as there is no longer anything to protect. The locking around lu_keys_initing_cnt is preserved for now. Also, don't increment when deregistering or quiescing a key. key_set_version is *only* use to avoid filling new key values if there have been no changes to the set of key. Deregistering a key does not mean that we need to try filling any new value, so the increment is pointless. Finally, remove the refill loop in keys_fill(). If a key is registered or revived while keys_fill() is running it must be safe to ignore it just as we would if it was registered immediately after keys_fill() ran. The important thing is that the keys_set_version stored in ctx->lc_version must be sampled *before* those unseen keys were added. So sample keys_set_version early. Linux-commit : 0fbfbc5ad0f892cf4c5e087a4e7e67102b2289af Change-Id: Ic6907561d0bb864b10e1c53fb3e5469d0c60f888 Signed-off-by: NeilBrown Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/32711 Reviewed-by: Gu Zheng Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alexey Lyashkov Reviewed-by: Oleg Drokin ---