Whamcloud - gitweb
LU-16180 ptlrpc: reduce lock contention in ptlrpc_free_committed
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Oct 2022 17:31:51 +0000 (10:31 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 27 Oct 2022 03:18:07 +0000 (03:18 +0000)
commit7cbe9c2125e340d8f62153abd76f85fde13aa8b9
tree6843061c1f6a2108544a41c7065b55a067303066
parent48ee310df80e34a0427f98e52bf7b03a86fe3409
LU-16180 ptlrpc: reduce lock contention in ptlrpc_free_committed

This patch breaks out of the loop in ptlrpc_free_committed()
if need_resched() is true or there are other threads waiting
on the imp_lock. This can avoid the thread holding the
CPU for too long time to free large number of requests. The
remaining requests in the list will be processed the next
time this function is called. That also avoids delaying a
single thread too long if the list is long.

Lustre-change: https://review.whamcloud.com/48629
Lustre-commit: 9a3e111a2ebdfadec4b6efc65899856edc90ad18

Test-Parameters: testlist=sanity clientdistro=el8.6
Test-Parameters: testlist=sanity clientdistro=ubuntu2204 env=SANITY_EXCEPT="130 244a"
Change-Id: I50f56b87844e8b019053e569767b6c949d2a3f55
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48627
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lustre_import.h
lustre/obdclass/genops.c
lustre/ptlrpc/client.c