Whamcloud - gitweb
LU-17197 obdclass: preserve fairness when waiting for rpc slot
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 18 Oct 2023 03:54:59 +0000 (22:54 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 9 Nov 2023 08:42:52 +0000 (08:42 +0000)
commit93afea3074cac75464bd0a113a777728c8903207
treedb7aad4ea8a052a4cf3624f7b1da35ee6eff4c19
parentc39bdce94fcf910857c1d52f98ef329df07bb84c
LU-17197 obdclass: preserve fairness when waiting for rpc slot

When obd_get_mod_rpc_slot() waits for an available slot it places the
waiting thread at the HEAD of the queue, so it will be woken before
anything else that is already queued.  This is clearly unfair and can
hurt performance.

So change to always add to the tail to ensure a FIFO ordering (except
that CLOSE might sometimes be woken a bit early).

This regression was introduced in a rewrite that was supposed to make
waiting more fair - by avoiding a broadcast wakeup for "close"
requests.

Also fix some stale comments and expose __add_wait_queue_entry_tail

Running mdtest with the patch applied shows about a 3% improvement:

                             master            patched
  mdtest-easy-write      350.585906 kIOPS   353.783545 kIOPS
   mdtest-easy-stat     1320.329353 kIOPS  1408.320419 kIOPS
 mdtest-easy-delete      285.084103 kIOPS   289.625900 kIOPS
            [SCORE]      509.115803 kiops   524.516113 kiops

Lustre-change: https://review.whamcloud.com/52738
Lustre-commit: TBD (from 7e28964085a4d98111b926fe125abc7f815e70be)

Fixes: 5243630b09d2 ("LU-15947 obdclass: improve precision of wakeups for mod_rpcs")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: If767c4299bcbab71589b0f3c01e85bf461686ca5
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52886
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
libcfs/include/libcfs/linux/linux-wait.h
libcfs/libcfs/linux/linux-wait.c
lustre/obdclass/genops.c