[LU-16741] defer & parallelize parts of ptlrpc_free_committed Created: 15/Apr/23  Updated: 11/Jan/24

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Patrick Farrell Assignee: Patrick Farrell
Resolution: Unresolved Votes: 0
Labels: None

Rank (Obsolete): 9223372036854775807

 Description   

ptlrpc_free_committed can be extremely time consuming if there are many async requests outstanding, such as with small async DIO as potentially created by LU-13805, or in other unusual circumstances.

The biggest problem is that we do all the work in a single threaded manner while holding the imp_lock.  A recent patch ( https://review.whamcloud.com/c/fs/lustre-release/+/48629 ) changed it so the thread will release the lock and 'hand off' to a waiter if it's running too long (and there is a waiter), but the process is still serial, so this avoids stalls, but there's no improvement in overall efficiency.

Most of the work (in terms of time consumed) in ptlrpc_free_committed can be deferred and moved out from under the imp_lock.  If we do this, we can also use our ability to know there is a waiter to 'batch' sets of requests, where we find a certain number, then hand off to the waiter.  This has the effect of parallelizing this work and should speed it up significantly.



 Comments   
Comment by Gerrit Updater [ 15/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50645
Subject: LU-16741 ptlrpc: defer & parallelize free_committed
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 0428f2ccc7653c4d07183719c2b13826a8154bed

Comment by Gerrit Updater [ 18/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50677
Subject: LU-16741 ptlrpc: rename ptlrpc_req_finished
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 5d918d81eeddb1b8f6513bed6703bf5ab50d4f71

Comment by Gerrit Updater [ 18/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50678
Subject: LU-16741 ptlrpc: refactor __ptlrpc_req_put
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f4458ce35e8762ab6c0361bb1af57564a108dec4

Comment by Gerrit Updater [ 18/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50679
Subject: LU-16741 ptlrpc: rename __ functions
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f632118835661d46f5cc399f4e4dbbe0d48edc33

Comment by Gerrit Updater [ 18/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50680
Subject: LU-16741 ptlrpc: rename ptlrpc_free_request
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: faf9bb4fb7006e71f13702fe2a6987d6de29b374

Comment by Gerrit Updater [ 18/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50681
Subject: LU-16741 ptlrpc: remove unnecessary asserts
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 5e721beefb0178f68bc6e79fb2e965e657563c8a

Comment by Gerrit Updater [ 19/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50691
Subject: LU-16741 tests: Test locking around deferred work
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 08467d0b677c54bc81e5499161a4d33e99c03550

Comment by Gerrit Updater [ 19/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50692
Subject: LU-16741 tests: Test to confirm replay-dual hits
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 531c7a3b0a5fdb9214c236c3ce5dc74ea2c0b552

Comment by Gerrit Updater [ 19/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50693
Subject: LU-16741 tests: Test locking around commit_cb
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 30332de6d9c4daeaa21c55a158c0b1fce0bfd27f

Comment by Gerrit Updater [ 19/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50694
Subject: LU-16741 ptlrpc: add 'locked' to rq_commit_cb
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c45eadc0856af236200f54c2180112364a40023e

Comment by Gerrit Updater [ 19/Apr/23 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50695
Subject: LU-16741 ptlrpc: check logic in osp_request_commit_cb
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: d0bf7f11ddb5d5a93bb753f3369c5b8a9602fac8

Comment by Gerrit Updater [ 11/Jan/24 ]

"Arshad Hussain <arshad.hussain@aeoncomputing.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53648
Subject: LU-16741 ptlrpc: ptlrpc: rename ptlrpc_req_finished
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1dda91562cfebbc91785258205e5cc1af88ef49d

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