From 7f8143cf85b7e658976aa6526689628a81ed6a32 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 25 Sep 2018 10:19:27 -0500 Subject: [PATCH] LU-11423 osc: Do not walk full extent list It is only possible to merge with the extent immediately before or immediately after the one we are trying to add, so do not continue to walk the extent list after passing that extent. This has a significant impact when writing large sparse files, where most writes create a new extent, and many extents are too distant to be merged with their neighbors. Writing 2 GiB of data randomly 4K at a time, we see an improvement of about 15% with this patch. mpirun -n 1 $IOR -w -t 4K -b 2G -o ./file -z w/o patch: write 285.86 MiB/s w/patch: write 324.03 MiB/s Cray-bug-id: LUS-6523 Signed-off-by: Patrick Farrell Change-Id: I3da224762638aa71714cfc6dd1f0abac42e1f358 Reviewed-on: https://review.whamcloud.com/33227 Reviewed-by: Jinshan Xiong Reviewed-by: Bobi Jam Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/osc/osc_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index b9112ef..7524899 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -699,7 +699,7 @@ restart: pgoff_t ext_chk_end = ext->oe_end >> ppc_bits; LASSERT(sanity_check_nolock(ext) == 0); - if (chunk > ext_chk_end + 1) + if (chunk > ext_chk_end + 1 || chunk < ext_chk_start) break; /* if covering by different locks, no chance to match */ -- 1.8.3.1