Whamcloud - gitweb
LU-12538 lod: Add missed qos_rr_init 90/35490/4
authorPatrick Farrell <pfarrell@whamcloud.com>
Fri, 12 Jul 2019 19:24:30 +0000 (15:24 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 17 Jul 2019 06:21:19 +0000 (06:21 +0000)
The new lmv space hash code uses the lu_qos_rr struct, but
forgot to init it fully.  Specifically, the spin lock isn't
inited, causing failures.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Id410a8dc61980b880eab7e151b85c417a8439fd5
Reviewed-on: https://review.whamcloud.com/35490
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lu_object.h
lustre/lmv/lmv_obd.c
lustre/lod/lod_internal.h
lustre/lod/lod_lov.c
lustre/lod/lod_pool.c
lustre/lod/lod_qos.c
lustre/obdclass/lu_qos.c

index 13720c1..4a7df97 100644 (file)
@@ -1468,6 +1468,7 @@ struct lu_qos {
                                 lq_reset:1;     /* zero current penalties */
 };
 
                                 lq_reset:1;     /* zero current penalties */
 };
 
+void lu_qos_rr_init(struct lu_qos_rr *lqr);
 int lqos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
 int lqos_del_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
 u64 lu_prandom_u64_max(u64 ep_ro);
 int lqos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
 int lqos_del_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
 u64 lu_prandom_u64_max(u64 ep_ro);
index 83e82ca..4cd844f 100644 (file)
@@ -1311,13 +1311,14 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        INIT_LIST_HEAD(&lmv->lmv_qos.lq_svr_list);
        init_rwsem(&lmv->lmv_qos.lq_rw_sem);
        lmv->lmv_qos.lq_dirty = 1;
        INIT_LIST_HEAD(&lmv->lmv_qos.lq_svr_list);
        init_rwsem(&lmv->lmv_qos.lq_rw_sem);
        lmv->lmv_qos.lq_dirty = 1;
-       lmv->lmv_qos.lq_rr.lqr_dirty = 1;
        lmv->lmv_qos.lq_reset = 1;
        /* Default priority is toward free space balance */
        lmv->lmv_qos.lq_prio_free = 232;
        /* Default threshold for rr (roughly 17%) */
        lmv->lmv_qos.lq_threshold_rr = 43;
 
        lmv->lmv_qos.lq_reset = 1;
        /* Default priority is toward free space balance */
        lmv->lmv_qos.lq_prio_free = 232;
        /* Default threshold for rr (roughly 17%) */
        lmv->lmv_qos.lq_threshold_rr = 43;
 
+       lu_qos_rr_init(&lmv->lmv_qos.lq_rr);
+
        /*
         * initialize rr_index to lower 32bit of netid, so that client
         * can distribute subdirs evenly from the beginning.
        /*
         * initialize rr_index to lower 32bit of netid, so that client
         * can distribute subdirs evenly from the beginning.
index e30be97..fcd9bfc 100644 (file)
@@ -692,7 +692,6 @@ struct lod_obj_stripe_cb_data {
 int lod_prepare_create(const struct lu_env *env, struct lod_object *lo,
                       struct lu_attr *attr, const struct lu_buf *buf,
                       struct thandle *th);
 int lod_prepare_create(const struct lu_env *env, struct lod_object *lo,
                       struct lu_attr *attr, const struct lu_buf *buf,
                       struct thandle *th);
-void lod_qos_rr_init(struct lu_qos_rr *lqr);
 int lod_use_defined_striping(const struct lu_env *, struct lod_object *,
                             const struct lu_buf *);
 int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
 int lod_use_defined_striping(const struct lu_env *, struct lod_object *,
                             const struct lu_buf *);
 int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
index b37bdcf..bb8e3cf 100644 (file)
@@ -2199,13 +2199,14 @@ int lod_pools_init(struct lod_device *lod, struct lustre_cfg *lcfg)
        INIT_LIST_HEAD(&lod->lod_qos.lq_svr_list);
        init_rwsem(&lod->lod_qos.lq_rw_sem);
        lod->lod_qos.lq_dirty = 1;
        INIT_LIST_HEAD(&lod->lod_qos.lq_svr_list);
        init_rwsem(&lod->lod_qos.lq_rw_sem);
        lod->lod_qos.lq_dirty = 1;
-       lod->lod_qos.lq_rr.lqr_dirty = 1;
        lod->lod_qos.lq_reset = 1;
        /* Default priority is toward free space balance */
        lod->lod_qos.lq_prio_free = 232;
        /* Default threshold for rr (roughly 17%) */
        lod->lod_qos.lq_threshold_rr = 43;
 
        lod->lod_qos.lq_reset = 1;
        /* Default priority is toward free space balance */
        lod->lod_qos.lq_prio_free = 232;
        /* Default threshold for rr (roughly 17%) */
        lod->lod_qos.lq_threshold_rr = 43;
 
+       lu_qos_rr_init(&lod->lod_qos.lq_rr);
+
        /* Set up OST pool environment */
        lod->lod_pools_hash_body = cfs_hash_create("POOLS", HASH_POOLS_CUR_BITS,
                                                   HASH_POOLS_MAX_BITS,
        /* Set up OST pool environment */
        lod->lod_pools_hash_body = cfs_hash_create("POOLS", HASH_POOLS_CUR_BITS,
                                                   HASH_POOLS_MAX_BITS,
@@ -2222,7 +2223,6 @@ int lod_pools_init(struct lod_device *lod, struct lustre_cfg *lcfg)
        rc = lod_ost_pool_init(&lod->lod_pool_info, 0);
        if (rc)
                GOTO(out_hash, rc);
        rc = lod_ost_pool_init(&lod->lod_pool_info, 0);
        if (rc)
                GOTO(out_hash, rc);
-       lod_qos_rr_init(&lod->lod_qos.lq_rr);
        rc = lod_ost_pool_init(&lod->lod_qos.lq_rr.lqr_pool, 0);
        if (rc)
                GOTO(out_pool_info, rc);
        rc = lod_ost_pool_init(&lod->lod_qos.lq_rr.lqr_pool, 0);
        if (rc)
                GOTO(out_pool_info, rc);
index 032d094..c1426f3 100644 (file)
@@ -661,7 +661,8 @@ int lod_pool_new(struct obd_device *obd, char *poolname)
        if (rc)
                GOTO(out_err, rc);
 
        if (rc)
                GOTO(out_err, rc);
 
-       lod_qos_rr_init(&new_pool->pool_rr);
+       lu_qos_rr_init(&new_pool->pool_rr);
+
        rc = lod_ost_pool_init(&new_pool->pool_rr.lqr_pool, 0);
        if (rc)
                GOTO(out_free_pool_obds, rc);
        rc = lod_ost_pool_init(&new_pool->pool_rr.lqr_pool, 0);
        if (rc)
                GOTO(out_free_pool_obds, rc);
index 5015310..7d738f3 100644 (file)
@@ -435,12 +435,6 @@ static int lod_qos_used(struct lod_device *lod, struct ost_pool *osts,
        RETURN(0);
 }
 
        RETURN(0);
 }
 
-void lod_qos_rr_init(struct lu_qos_rr *lqr)
-{
-       spin_lock_init(&lqr->lqr_alloc);
-       lqr->lqr_dirty = 1;
-}
-
 #define LOV_QOS_EMPTY ((__u32)-1)
 
 /**
 #define LOV_QOS_EMPTY ((__u32)-1)
 
 /**
index ade9c1f..f84954c 100644 (file)
 #include <lustre_fid.h>
 #include <lu_object.h>
 
 #include <lustre_fid.h>
 #include <lu_object.h>
 
+void lu_qos_rr_init(struct lu_qos_rr *lqr)
+{
+       spin_lock_init(&lqr->lqr_alloc);
+       lqr->lqr_dirty = 1;
+}
+EXPORT_SYMBOL(lu_qos_rr_init);
+
 /**
  * Add a new target to Quality of Service (QoS) target table.
  *
 /**
  * Add a new target to Quality of Service (QoS) target table.
  *