summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
diff options
context:
space:
mode:
authorNiu Yawei <yawei.niu@intel.com>2016-10-02 22:28:30 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-16 10:24:38 +0200
commit0154672fbecd8d79ffefa659b4e67f59006e0831 (patch)
tree1028a9e4408f84caa4d62f46802b4ada02b6a317 /drivers/staging/lustre/lustre/ldlm/ldlm_request.c
parentf648eed6f32410189f024c73fd86f3c6846c4b6a (diff)
downloadop-kernel-dev-0154672fbecd8d79ffefa659b4e67f59006e0831.zip
op-kernel-dev-0154672fbecd8d79ffefa659b4e67f59006e0831.tar.gz
staging: lustre: ldlm: cancel aged locks for LRUR
It doesn't make sense to keep the very aged lock even with the LRUR policy. This patch decreased the default ns_max_age from 10 hours to 65 minutes and changed LRUR policy to cancel very aged locks. Signed-off-by: Niu Yawei <yawei.niu@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6529 Reviewed-on: http://review.whamcloud.com/14856 Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_request.c')
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_request.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 98730a3..ac1927c 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -1182,6 +1182,14 @@ static enum ldlm_policy_res ldlm_cancel_lrur_policy(struct ldlm_namespace *ns,
if (count && added >= count)
return LDLM_POLICY_KEEP_LOCK;
+ /*
+ * Despite of the LV, It doesn't make sense to keep the lock which
+ * is unused for ns_max_age time.
+ */
+ if (cfs_time_after(cfs_time_current(),
+ cfs_time_add(lock->l_last_used, ns->ns_max_age)))
+ return LDLM_POLICY_CANCEL_LOCK;
+
slv = ldlm_pool_get_slv(pl);
lvf = ldlm_pool_get_lvf(pl);
la = cfs_duration_sec(cfs_time_sub(cur, lock->l_last_used));
OpenPOWER on IntegriCloud