Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
staging: lustre: remove locking from lu_context_exit()
Recent patches suggest that the locking in lu_context_exit() hurts performance as the changes that make are to improve performance. Let's go all the way and remove the locking completely. The race of interest is between lu_context_exit() finalizing a value with ->lct_exit, and lu_context_key_quiesce() freeing the value with key_fini(). If lu_context_key_quiesce() has started, there is no need to finalize the value - it can just be freed. So lu_context_exit() is changed to skip the call to ->lcu_exit if LCT_QUIESCENT it set. If lc_context_exit() has started, lu_context_key_quiesce() must wait for it to complete - it cannot just skip the freeing. To allow this we introduce a new lc_state, LCS_LEAVING. This indicates that ->lcu_exit might be called. Before calling key_fini() on a context, lu_context_key_quiesce() waits (spinning) for lc_state to move on from LCS_LEAVING. Signed-off-by: NeilBrown <neilb@suse.com>
- Loading branch information