Whamcloud - gitweb
LU-16180 ptlrpc: reduce lock contention in ptlrpc_free_committed 29/48629/10
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Oct 2022 17:31:51 +0000 (10:31 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 8 Oct 2022 01:40:34 +0000 (01:40 +0000)
commit9a3e111a2ebdfadec4b6efc65899856edc90ad18
tree77a322cad645fdc1cf8a98b9e356965e388b258b
parentd13cca56a5ae2ad44d8083025e37263e408b8f62
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>
lustre/include/lustre_import.h
lustre/obdclass/genops.c
lustre/ptlrpc/client.c