Whamcloud - gitweb
LU-8272 ldlm: Use interval tree to update kms
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.
This can be avoided by using the interval trees which store
the extents of granted locks. For PW/write locks, the lock
with the highest start must be the lock with the highest
end as well, so we can walk the interval tree in reverse to
almost immediately find the new 'highest end'.
Since the tree is sorted by 'start' and PR locks can
overlap, we cannot easily use the tree to find the PR lock
with the 'highest end'. So we cannot optimize this case,
but many PR locks with different extents should be rare, so
this is OK (and it is no worse than what we do now).
Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I9efa4733e691cb2299049ba917325b939be52069
Reviewed-on: https://review.whamcloud.com/20779
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>