[LU-8272] Use granted extent tree to update kms Created: 14/Jun/16  Updated: 17/Dec/16  Resolved: 17/Dec/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.10.0

Type: Improvement Priority: Major
Reporter: Patrick Farrell (Inactive) Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: patch

Rank (Obsolete): 9223372036854775807

 Description   

Currently, ldlm_extent_shift_kms does a linear search of
the list of granted locks on the resource when looking for
the lock to use to update the kms.

When cleaning up all locks on a resource, we end up doing
a linear search of this list for every lock on the object;
so, complexity n^2.

For resources with thousands of locks, this can take
multiple seconds, and scales quickly to tens of seconds per
resource. This can happen in normal usage with a weird I/O
pattern, but it is particularly a problem with lock ahead, which
creates large numbers of locks deliberately.

This can be avoided by using the binary trees which store
the extents of granted locks, reducing the complexity of an
individual search from 'n' to 'log n', and the total
complexity from n^2 to n*log.

Note that there are multiple trees, one for each lock mode.
This necessitates using kms and old_kms, since we check
every tree, even though we check the kms against only one
lock per tree.



 Comments   
Comment by Gerrit Updater [ 14/Jun/16 ]

Patrick Farrell (paf@cray.com) uploaded a new patch: http://review.whamcloud.com/20779
Subject: LU-8272 ldlm: Use interval tree to update kms
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e18c528398d1ceaccc76fed9f54f04ffe523d668

Comment by Gerrit Updater [ 17/Dec/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/20779/
Subject: LU-8272 ldlm: Use interval tree to update kms
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e7cf1b060ba37896147337a31b17870bec2d046b

Comment by Peter Jones [ 17/Dec/16 ]

Landed for 2.10

Generated at Sat Feb 10 02:16:06 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.