Whamcloud - gitweb
LU-248 increase LOV reseed to mitigate OST allocation inconsitence
[fs/lustre-release.git] / lustre / lov / lov_qos.c
index 2262c50..c1f8c96 100644 (file)
@@ -461,7 +461,7 @@ void qos_shrink_lsm(struct lov_request_set *set)
                 oti_alloc_cookies(set->set_oti, set->set_count);
                 if (set->set_oti->oti_logcookies) {
                         memcpy(set->set_oti->oti_logcookies, cookies, newsize);
-                        OBD_FREE(cookies, oldsize);
+                        OBD_FREE_LARGE(cookies, oldsize);
                         set->set_cookies = set->set_oti->oti_logcookies;
                 } else {
                         CWARN("'leaking' %d bytes\n", oldsize - newsize);
@@ -473,7 +473,7 @@ void qos_shrink_lsm(struct lov_request_set *set)
         LASSERT(lsm->lsm_stripe_count >= set->set_count);
 
         newsize = lov_stripe_md_size(set->set_count);
-        OBD_ALLOC(lsm_new, newsize);
+        OBD_ALLOC_LARGE(lsm_new, newsize);
         if (lsm_new != NULL) {
                 int i;
                 memcpy(lsm_new, lsm, sizeof(*lsm));
@@ -486,8 +486,8 @@ void qos_shrink_lsm(struct lov_request_set *set)
                                       sizeof(struct lov_oinfo));
                 }
                 lsm_new->lsm_stripe_count = set->set_count;
-                OBD_FREE(lsm, sizeof(struct lov_stripe_md) +
-                         lsm->lsm_stripe_count * sizeof(struct lov_oinfo *));
+                OBD_FREE_LARGE(lsm, sizeof(struct lov_stripe_md) +
+                               lsm->lsm_stripe_count*sizeof(struct lov_oinfo*));
                 set->set_oi->oi_md = lsm_new;
         } else {
                 CWARN("'leaking' few bytes\n");
@@ -577,8 +577,8 @@ static int min_stripe_count(int stripe_cnt, int flags)
                 stripe_cnt - (stripe_cnt / 4) : stripe_cnt);
 }
 
-#define LOV_CREATE_RESEED_MULT 4
-#define LOV_CREATE_RESEED_MIN  1000
+#define LOV_CREATE_RESEED_MULT 30
+#define LOV_CREATE_RESEED_MIN  2000
 /* Allocate objects on osts with round-robin algorithm */
 static int alloc_rr(struct lov_obd *lov, int *idx_arr, int *stripe_cnt,
                     char *poolname, int flags)
@@ -609,7 +609,7 @@ static int alloc_rr(struct lov_obd *lov, int *idx_arr, int *stripe_cnt,
                 GOTO(out, rc);
 
         if (--lqr->lqr_start_count <= 0) {
-                lqr->lqr_start_idx = ll_rand() % osts->op_count;
+                lqr->lqr_start_idx = cfs_rand() % osts->op_count;
                 lqr->lqr_start_count =
                         (LOV_CREATE_RESEED_MIN / max(osts->op_count, 1U) +
                          LOV_CREATE_RESEED_MULT) * max(osts->op_count, 1U);
@@ -880,23 +880,23 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt,
 
                 if (total_weight) {
 #if BITS_PER_LONG == 32
-                        rand = ll_rand() % (unsigned)total_weight;
+                        rand = cfs_rand() % (unsigned)total_weight;
                         /* If total_weight > 32-bit, first generate the high
                          * 32 bits of the random number, then add in the low
                          * 32 bits (truncated to the upper limit, if needed) */
                         if (total_weight > 0xffffffffULL)
-                                rand = (__u64)(ll_rand() %
+                                rand = (__u64)(cfs_rand() %
                                           (unsigned)(total_weight >> 32)) << 32;
                         else
                                 rand = 0;
 
                         if (rand == (total_weight & 0xffffffff00000000ULL))
-                                rand |= ll_rand() % (unsigned)total_weight;
+                                rand |= cfs_rand() % (unsigned)total_weight;
                         else
-                                rand |= ll_rand();
+                                rand |= cfs_rand();
 
 #else
-                        rand = ((__u64)ll_rand() << 32 | ll_rand()) %
+                        rand = ((__u64)cfs_rand() << 32 | cfs_rand()) %
                                 total_weight;
 #endif
                 } else {
@@ -1074,7 +1074,7 @@ int qos_prep_create(struct obd_export *exp, struct lov_request_set *set)
                 lov_set_add_req(req, set);
 
                 req->rq_buflen = sizeof(*req->rq_oi.oi_md);
-                OBD_ALLOC(req->rq_oi.oi_md, req->rq_buflen);
+                OBD_ALLOC_LARGE(req->rq_oi.oi_md, req->rq_buflen);
                 if (req->rq_oi.oi_md == NULL)
                         GOTO(out_err, rc = -ENOMEM);