Skip to content
Snippets Groups Projects
Commit 5621b9f7 authored by Oleg Drokin's avatar Oleg Drokin
Browse files

b=14748

r=adilger,jay

When traversing extent wating list queue for PR lock and meeting same or wider
lock without AST_SENT, we are guaranteed there is no other one like this down
the line, so we can return immediatelly
parent 2517c4f6
No related merge requests found
...@@ -761,6 +761,16 @@ Description: SNMP support enhancement ...@@ -761,6 +761,16 @@ Description: SNMP support enhancement
Details : Adding total number of sampled request for an MDS node in snmp Details : Adding total number of sampled request for an MDS node in snmp
support. support.
Severity : enhancement
Bugzilla : 14748
Description: Optimize ldlm waiting list processing for PR extent locks
Details : When processing waiting list for read extent lock and meeting
read
lock that is same or wider to it that is not contended, skip
processing rest of the list and immediatelly return current
status of conflictness, since we are guaranteed there are no
conflicting locks in the rest of the list.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com> 2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com>
......
...@@ -251,6 +251,34 @@ ldlm_extent_compat_queue(struct list_head *queue, struct ldlm_lock *req, ...@@ -251,6 +251,34 @@ ldlm_extent_compat_queue(struct list_head *queue, struct ldlm_lock *req,
/* locks are compatible, overlap doesn't matter */ /* locks are compatible, overlap doesn't matter */
if (lockmode_compat(lock->l_req_mode, req_mode)) { if (lockmode_compat(lock->l_req_mode, req_mode)) {
if (req_mode == LCK_PR &&
((lock->l_policy_data.l_extent.start <=
req->l_policy_data.l_extent.start) &&
(lock->l_policy_data.l_extent.end >=
req->l_policy_data.l_extent.end))) {
/* If we met a PR lock just like us or wider,
and nobody down the list conflicted with
it, that means we can skip processing of
the rest of the list and safely place
ourselves at the end of the list, or grant
(dependent if we met an conflicting locks
before in the list).
In case of 1st enqueue only we continue
traversing if there is something conflicting
down the list because we need to make sure
that something is marked as AST_SENT as well,
in cse of empy worklist we would exit on
first conflict met. */
/* There IS a case where such flag is
not set for a lock, yet it blocks
something. Luckily for us this is
only during destroy, so lock is
exclusive. So here we are safe */
if (!(lock->l_flags & LDLM_FL_AST_SENT)) {
RETURN(compat);
}
}
/* non-group locks are compatible, overlap doesn't /* non-group locks are compatible, overlap doesn't
matter */ matter */
if (likely(req_mode != LCK_GROUP)) if (likely(req_mode != LCK_GROUP))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment