From df0c75996b512c3d7ee4933a4eb78dfaa6a18321 Mon Sep 17 00:00:00 2001 From: shaocheng Date: Fri, 19 Mar 2004 12:24:18 +0000 Subject: [PATCH] Update from HEAD --- lustre/obdfilter/filter_io.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 7e305f5..773baf4 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -151,7 +151,7 @@ static void filter_grant_incoming(struct obd_export *exp, struct obdo *oa) EXIT; } -#define GRANT_FOR_LLOG 16 +#define GRANT_FOR_LLOG(obd) 16 /* Figure out how much space is available between what we've granted * and what remains in the filesystem. Compensate for ext3 indirect @@ -177,8 +177,8 @@ restat: avail = obd->obd_osfs.os_bavail; left = avail - (avail >> (blockbits - 3)); /* (d)indirect */ - if (left > GRANT_FOR_LLOG) { - left = (left - GRANT_FOR_LLOG) << blockbits; + if (left > GRANT_FOR_LLOG(obd)) { + left = (left - GRANT_FOR_LLOG(obd)) << blockbits; } else { left = 0 /* << blockbits */; } @@ -235,10 +235,13 @@ long filter_grant(struct obd_export *exp, obd_size current_grant, * avoid overgranting in face of multiple RPCs in flight). This * essentially will be able to control the OSC_MAX_RIF for a client. * - * If we do have a large disparity and multiple RPCs in flight we - * might grant "too much" but that's OK because it means we are - * dirtying a lot on the client and will likely use it up quickly. */ + * If we do have a large disparity between what the client thinks it + * has and what we think it has, don't grant very much and let the + * client consume its grant first. Either it just has lots of RPCs + * in flight, or it was evicted and its grants will soon be used up. */ if (current_grant < want) { + if (current_grant > fed->fed_grant + FILTER_GRANT_CHUNK) + want = 65536; grant = min((want >> blockbits) / 2, (fs_space_left >> blockbits) / 8); grant <<= blockbits; -- 1.8.3.1