From: alex Date: Tue, 20 Jul 2004 18:01:05 +0000 (+0000) Subject: b=3896 X-Git-Tag: 1.3.4~572 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=e42ff0d18b3568d5e149024a09064c81c9e8f09e;p=fs%2Flustre-release.git b=3896 oscc_internal_create() increase pre-creation window smoothly --- diff --git a/lustre/include/linux/lustre_export.h b/lustre/include/linux/lustre_export.h index 664f936..b4b2fc9 100644 --- a/lustre/include/linux/lustre_export.h +++ b/lustre/include/linux/lustre_export.h @@ -30,8 +30,8 @@ struct osc_creator { obd_id oscc_last_id;//last available pre-created object obd_id oscc_next_id;// what object id to give out next obd_id oscc_gr; - int oscc_initial_create_count; int oscc_grow_count; + int oscc_max_grow_count; int oscc_kick_barrier; struct osc_created *oscc_osccd; struct obdo oscc_oa; diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index 22d2a54..3cd2175 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -124,6 +124,12 @@ static int oscc_internal_create(struct osc_creator *oscc) spin_lock(&oscc->oscc_lock); body->oa.o_id = oscc->oscc_last_id + oscc->oscc_grow_count; + /* probably we should take frequence of request into account? -bzzz */ + if (oscc->oscc_grow_count < oscc->oscc_max_grow_count) { + oscc->oscc_grow_count *= 2; + if (oscc->oscc_grow_count > oscc->oscc_max_grow_count) + oscc->oscc_grow_count = oscc->oscc_max_grow_count; + } body->oa.o_gr = oscc->oscc_gr; LASSERT(body->oa.o_gr > 0); body->oa.o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP; @@ -345,8 +351,8 @@ void oscc_init(struct obd_device *obd) spin_lock_init(&oscc->oscc_lock); oscc->oscc_obd = obd; oscc->oscc_kick_barrier = 100; - oscc->oscc_grow_count = 2000; - oscc->oscc_initial_create_count = 2000; + oscc->oscc_grow_count = 36; + oscc->oscc_max_grow_count = 2000; oscc->oscc_next_id = 2; oscc->oscc_last_id = 1; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 3c5cf7e..49a4cbd 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -712,7 +712,6 @@ static int osc_brw_prep_request(int cmd, struct obd_import *imp,struct obdo *oa, struct ost_body *body; struct obd_ioobj *ioobj; struct niobuf_remote *niobuf; - unsigned long flags; int niocount; int size[3]; int i; @@ -2768,7 +2767,7 @@ static int osc_set_info(struct obd_export *exp, obd_count keylen, memcmp(key, "growth_count", strlen("growth_count")) == 0) { if (vallen != sizeof(int)) RETURN(-EINVAL); - obd->u.cli.cl_oscc.oscc_grow_count = *((int*)val); + obd->u.cli.cl_oscc.oscc_max_grow_count = *((int*)val); RETURN(0); }