Whamcloud - gitweb
LU-16180 ptlrpc: reduce lock contention in ptlrpc_free_committed 29/48629/11
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Oct 2022 17:31:51 +0000 (10:31 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 15 Oct 2022 05:57:02 +0000 (05:57 +0000)
commitd3074511f3ee322d841c0c0e7f644422e85a543e
tree26ed37bf133752fabf8864ecb56dca7a991daba5
parentf5ca6853b8d8b918b0228af31fa8249be49d3000
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.

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/fs/lustre-release/+/48629
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_import.h
lustre/obdclass/genops.c
lustre/ptlrpc/client.c