[lustre-devel] [PATCH 18/49] lustre: osc: fix performance regression in osc_extent_merge()

James Simmons jsimmons at infradead.org
Wed Apr 14 21:02:10 PDT 2021


From: Mr NeilBrown <neilb at suse.de>

The following IOR performance regression was reported at LU-14424:

Client Version		NP	Write(MB/s)	Read(MB/s)
Lustre-2.13.0		1	803		3293
Lustre-2.14.0-RC1	1	529	 	3092
Lustre-2.13.0		16	6962		12021
Lustre-2.14.0-RC1	16	5127		11951

This was tracked down to commit 85ebb57ddc5b. Restore the original
performance with fix in this patch.

Fixes: 85ebb57ddc5b ("lustre: osc: simplify osc_extent_find()")
WC-bug-id: https://jira.whamcloud.com/browse/LU-9679
WC-bug-id: https://jira.whamcloud.com/browse/LU-14424
Lustre-commit: 3e6b7a785cab514a ("LU-9679 osc: simplify osc_extent_find()")
Signed-off-by: Mr NeilBrown <neilb at suse.de>
Reviewed-on: https://review.whamcloud.com/41691
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/osc/osc_cache.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/lustre/osc/osc_cache.c b/fs/lustre/osc/osc_cache.c
index 4abe8ba..e85f320 100644
--- a/fs/lustre/osc/osc_cache.c
+++ b/fs/lustre/osc/osc_cache.c
@@ -568,7 +568,8 @@ static int osc_extent_merge(const struct lu_env *env, struct osc_extent *cur,
 	if (!victim)
 		return -EINVAL;
 
-	if (victim->oe_state != OES_CACHE || victim->oe_fsync_wait)
+	if (victim->oe_state != OES_INV &&
+	    (victim->oe_state != OES_CACHE || victim->oe_fsync_wait))
 		return -EBUSY;
 
 	if (cur->oe_max_end != victim->oe_max_end)
@@ -809,7 +810,6 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
 		if (osc_extent_merge(env, ext, cur) == 0) {
 			LASSERT(*grants >= chunksize);
 			*grants -= chunksize;
-			found = osc_extent_hold(ext);
 
 			/*
 			 * Try to merge with the next one too because we
@@ -819,6 +819,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
 				/* we can save extent tax from next extent */
 				*grants += cli->cl_grant_extent_tax;
 
+			found = osc_extent_hold(ext);
 			break;
 		}
 	}
-- 
1.8.3.1



More information about the lustre-devel mailing list