Whamcloud - gitweb
b=3896
authoralex <alex>
Tue, 20 Jul 2004 18:01:05 +0000 (18:01 +0000)
committeralex <alex>
Tue, 20 Jul 2004 18:01:05 +0000 (18:01 +0000)
oscc_internal_create() increase pre-creation window smoothly

lustre/include/linux/lustre_export.h
lustre/osc/osc_create.c
lustre/osc/osc_request.c

index 664f936..b4b2fc9 100644 (file)
@@ -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;
index 22d2a54..3cd2175 100644 (file)
@@ -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;
index 3c5cf7e..49a4cbd 100644 (file)
@@ -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);
         }