Whamcloud - gitweb
LU-2049 grant: Fix grant interop with pre-GRANT_PARAM clients 53/25853/14
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Tue, 7 Mar 2017 13:37:46 +0000 (08:37 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 24 May 2017 07:33:32 +0000 (07:33 +0000)
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 <nathaniel.l.clark@intel.com>
Change-Id: I63fd5b91b499936b74d2dd21c1215e0b006af085
Reviewed-on: https://review.whamcloud.com/25853
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/target/tgt_grant.c

index 8a513ed..2dbb2c2 100644 (file)
@@ -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) */