[LU-14357] Simplify locking in fid_request Created: 22/Jan/21  Updated: 05/May/21  Resolved: 05/May/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Improvement Priority: Minor
Reporter: Neil Brown Assignee: Neil Brown
Resolution: Fixed Votes: 0
Labels: None

Rank (Obsolete): 9223372036854775807

 Description   

The lu_client_seq contains a mutex, lcs_mutex, which is used for serialising updates to the fid, in fid_request.

It also contains waitq and flag, lcs_waitq and lcs_update, which effectively provide a second mutex. This appear to add no value.  The second mutex is held while and rpc to the server to get a new fid is pending.

Originally there was just the one mutex, but in Commit 23e2a370c8a3 ("b=24255 move seq_client_alloc_seq out of lcs_sem") the second was added.  The apparent reason was that "in a case of recovery the recovery thread takes  [lcs_murex] too and deadlocks.

This presumably refers to seq_client_flush as that seems to be the only relevant place which takes lcs_mutex but doesn't take the new open-coded mutex.  However this was changed in Commit d1feb5c774d4 ("LU-662 fix conflict between seq_client_flush and seq_client_alloc_fid") when it was noticed that there was a new race.

As this doesn't appear to have brought back the deadlock that was originally a concern, we must assume that the deadlock possibility has disappeared for other reasons.

So this open-coded mutex can be removed and the code simplified.

 



 Comments   
Comment by Gerrit Updater [ 22/Jan/21 ]

Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/41299
Subject: LU-14357 fid: simplify locking for fid updates
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 61f1d7062368bb8ac1bd330c24d26d6432b485fa

Comment by Gerrit Updater [ 05/May/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41299/
Subject: LU-14357 fid: simplify locking for fid updates
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: aba940fa10195579eac0701846922547c6ad0dae

Comment by Peter Jones [ 05/May/21 ]

Landed for 2.15

Generated at Sat Feb 10 03:09:02 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.