Whamcloud - gitweb
LU-11085 ldlm: optimise extent locks with identical extent 87/54587/17
authorMr NeilBrown <neilb@suse.de>
Thu, 28 Mar 2024 23:15:55 +0000 (19:15 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 5 Jun 2024 04:50:33 +0000 (04:50 +0000)
commit0cf356c4e4277d20324463b0cfcd4f414b7c5df9
tree501d96f575146fd10bc6467c3ee1082f0a149d10
parent1777472025a13331221b9270bf3111f9220f2875
LU-11085 ldlm: optimise extent locks with identical extent

Many locks with identical extent is (apparently) common.  Rather than
putting all of these locks in the extent tree, possibly making it much
bigger than needed, link them all together with only one in the extent
tree.

When removing the one in the extent tree, if there are others, one
of those must be placed in the tree where the original was.
extent_replace() does this. It could be in generic code.

A new extent_insert_unique() is added.  Ideally this would be provided
by the standard interval_tree code.

As extent_insert() is now not used, INTERVAL_TREE_DEFINE is told to
make all functions 'static inline' so we don't get warnings about the
unused function.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9f8433514f8451abc80bbb6050499599e0f93520
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54587
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_lock.c