Whamcloud - gitweb
LU-14976 nrs: change nrs policies at run time 23/48523/14
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Mon, 12 Sep 2022 11:13:13 +0000 (13:13 +0200)
committerOleg Drokin <green@whamcloud.com>
Sat, 22 Apr 2023 17:27:48 +0000 (17:27 +0000)
commitc098c09564a125dd44ffe0c135cd1cb6359229e7
treeceab2590fbb0b8d6a48faf3b8d669d9052f79fb3
parent13557aa86904376e48a5e43256d5c1ab32c1c2d6
LU-14976 nrs: change nrs policies at run time

This patch take extra references on policy to avoid stop a NRS policy
with pending/queued request in it.

It uses a new refcount_t "pol_start_ref" for this purpose to keep
track of policy usage in started state. It enables to safely stop a
policy without "nrs_lock" and avoids to sleep in the spinlock.

It adds a wait queue field "pol_wq" in "struct ptlrpc_nrs_policy" to
wait all queued request in a stopping policy to be drained when
restarting policy with a different argument.

Add test sanityn 77r for this use case.

Test-Parameters: testlist=sanityn env=ONLY=77r,ONLY_REPEAT=20
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I1425f52324f755f1b76ea8210de52647c072a592
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48523
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Feng Lei <flei@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_nrs.h
lustre/ptlrpc/nrs.c
lustre/tests/sanityn.sh