From 03f24e6f786459b3dd8a37ced7fb3842b864613d Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Tue, 7 Mar 2017 08:37:46 -0500 Subject: [PATCH] LU-2049 grant: Fix grant interop with pre-GRANT_PARAM clients Fix a performance regression with pre-GRANT_PARAM clients. This patch brings the grant allocation logic back into line with how servers prior to GRANT_PARAM support allocated grant space. Test-Parameters: clientdistro=el6.6 clientjob=lustre-b2_7 clientbuildno=29 testlist=sanity-quota mdscount=1 mdtcount=1 ostcount=2 envdefinitions=SANITY_QUOTA_EXCEPT="36" Signed-off-by: Nathaniel Clark Change-Id: I63fd5b91b499936b74d2dd21c1215e0b006af085 Reviewed-on: https://review.whamcloud.com/25853 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- lustre/target/tgt_grant.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lustre/target/tgt_grant.c b/lustre/target/tgt_grant.c index 8a513ed..2dbb2c2 100644 --- a/lustre/target/tgt_grant.c +++ b/lustre/target/tgt_grant.c @@ -90,9 +90,7 @@ static inline u64 tgt_grant_inflate(struct tg_grants_data *tgd, u64 val) * is thus inflated. We already significantly overestimate * overhead, no need to add the extent tax in this case */ return val << (tgd->tgd_blockbits - COMPAT_BSIZE_SHIFT); - /* client can deal with the block size, but does not support per-extent - * grant accounting, inflate grant by 100% for such clients */ - return val << 1; + return val; } /* Companion of tgt_grant_inflate() */ @@ -100,7 +98,7 @@ static inline u64 tgt_grant_deflate(struct tg_grants_data *tgd, u64 val) { if (tgd->tgd_blockbits > COMPAT_BSIZE_SHIFT) return val >> (tgd->tgd_blockbits - COMPAT_BSIZE_SHIFT); - return val >> 1; + return val; } /* Grant chunk is used as a unit for grant allocation. It should be inflated @@ -121,8 +119,8 @@ static inline u64 tgt_grant_chunk(struct obd_export *exp, if ((data == NULL && !(exp_grant_param_supp(exp))) || (data != NULL && !OCD_HAS_FLAG(data, GRANT_PARAM))) - /* Try to grant enough space to send a full-size RPC */ - return tgt_grant_inflate(tgd, chunk); + /* Try to grant enough space to send 2 full-size RPCs */ + return tgt_grant_inflate(tgd, chunk) << 1; /* Try to return enough to send two full-size RPCs * = 2 * (BRW_size + #extents_in_BRW * grant_tax) */ -- 1.8.3.1