Whamcloud - gitweb
LU-13312 ldlm: fix to stop iterating tree early in ldlm_kms_shift_cb() 62/37762/5
authorWang Shilong <wshilong@ddn.com>
Sat, 29 Feb 2020 14:02:55 +0000 (22:02 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 24 Mar 2020 05:20:39 +0000 (05:20 +0000)
commitb28b3bd9094ee7be8e3c11a531383246a71d5dec
tree5d434a9041d75f7d058ce0852737698243fa6ccc
parentf8aa86dd1622804d81020a7dbb1116f276b340f3
LU-13312 ldlm: fix to stop iterating tree early in ldlm_kms_shift_cb()

It is very possible that old_kms is equal (last extent end + 1),
and if we fail last one check, we will have to iterate all PR extent locks
in tree which is O(N).

This is very likely to happen in IO500 hard mode, because firstly
we try to write which generates a lot of PW locks, after that read
is triggered which need cancel all PW locks to PR locks.

Be careful to avoid overflow, as @l_extent.end could be OBD_OBJECT_EOF,
if that is case, it just means we could stop iterating.

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ie142fb738482a8abcc7d0c9d67d6e6eb520459db
Reviewed-on: https://review.whamcloud.com/37762
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
lustre/ldlm/ldlm_extent.c