From 19be06092c62609d69abec3c140cce23d8805c8e Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 6 Apr 2004 19:10:44 +0000 Subject: [PATCH] Use the highest extent to determine the kms value, not the last one. Try not to grant overlapping locks for the same client, to speed lock cancel. b=2925 r=phil --- lustre/ChangeLog | 1 + lustre/ldlm/ldlm_extent.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 4dce98a..b4b7f47 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -10,6 +10,7 @@ tbd Cluster File Systems, Inc. - mount MDS with errors=remount-ro, like obdfilter (2009) - initialize lock handle to avoid ASSERT on error cleanup (3057) - don't use cancelling-locks' kms values (2947) + - use highest lock extent for kms, not last one (2925) * miscellania - allow default OST striping configuration per directory (1414) diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index 85ba8e6..5cabc13 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -67,7 +67,10 @@ ldlm_extent_internal_policy(struct list_head *queue, struct ldlm_lock *req, continue; /* Locks are compatible, overlap doesn't matter */ - if (lockmode_compat(lock->l_req_mode, req_mode)) + /* Until bug 20 is fixed, try to avoid granting overlapping + * locks on one client (they take a long time to cancel) */ + if (lockmode_compat(lock->l_req_mode, req_mode) && + lock->l_export != req->l_export) continue; /* If this is a high-traffic lock, don't grow downwards at all @@ -276,8 +279,13 @@ __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms) if (lck->l_policy_data.l_extent.end >= old_kms) GOTO(out, kms = old_kms); - kms = lck->l_policy_data.l_extent.end + 1; + + /* This extent _has_ to be smaller than old_kms (checked above) + * so kms can only ever be smaller or the same as old_kms. */ + if (lck->l_policy_data.l_extent.end + 1 > kms) + kms = lck->l_policy_data.l_extent.end + 1; } + LASSERTF(kms <= old_kms, "kms "LPU64" old_kms "LPU64"\n", kms, old_kms); GOTO(out, kms); out: -- 1.8.3.1