Whamcloud - gitweb
LU-11672 ldlm: awalys cancel aged locks regardless enabling or disabling lru resize 67/35467/3
authorGu Zheng <gzheng@ddn.com>
Thu, 11 Jul 2019 05:52:38 +0000 (13:52 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Jul 2019 18:39:18 +0000 (18:39 +0000)
commite4c490bac7701435cb08ce444d9b23b8fd1dd839
tree25e05c050a2a78deff0df9454ffb6b9ae49eafcc
parent4c142948d13a21df378062fd55836945db33c667
LU-11672 ldlm: awalys cancel aged locks regardless enabling or disabling lru resize

Currently cancelling aged locks is handled by of ldlm_pool_recalc routine,
and it only works when lru resize is enabled, means if we disabled lru
resize, old aged locks are still cached even though they reach the
ns_max_age.

But theoretically, even lru resize disabled, lru_max_age should behave
same as enabling lru resize. At the end, lru_size is like hard limit of
number of locks, but ns_max_age/lru_max_age is a elimination mechanism,
regardless enabling or disabling lru resize meaning once it gets
lru_max_age, locks need to be cancelled.

So fix it here with changing the lru flags when invoking ldlm_cancel_lru
to do the real cancel work, if lru resize is enabled, set flag to
LDLM_LRU_FLAG_LRUR, otherwise LDLM_LRU_FLAG_AGED.

Change-Id: Ic2df2550af87fd7209fdb31ca3730683d727a74d
Signed-off-by: Gu Zheng <gzheng@ddn.com>
Reviewed-on: https://review.whamcloud.com/35467
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_pool.c
lustre/tests/sanity.sh