Skip to content

Commit 5e6a30c

Browse files
paf0186Oleg Drokin
authored andcommitted
LU-12538 lod: Add missed qos_rr_init
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 <[email protected]> Change-Id: Id410a8dc61980b880eab7e151b85c417a8439fd5 Reviewed-on: https://review.whamcloud.com/35490 Reviewed-by: Andreas Dilger <[email protected]> Tested-by: jenkins <[email protected]> Reviewed-by: Lai Siyao <[email protected]> Tested-by: Maloo <[email protected]>
1 parent e4679a3 commit 5e6a30c

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

lustre/include/lu_object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,7 @@ struct lu_qos {
14681468
lq_reset:1; /* zero current penalties */
14691469
};
14701470

1471+
void lu_qos_rr_init(struct lu_qos_rr *lqr);
14711472
int lqos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
14721473
int lqos_del_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
14731474
u64 lu_prandom_u64_max(u64 ep_ro);

lustre/lmv/lmv_obd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,13 +1311,14 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
13111311
INIT_LIST_HEAD(&lmv->lmv_qos.lq_svr_list);
13121312
init_rwsem(&lmv->lmv_qos.lq_rw_sem);
13131313
lmv->lmv_qos.lq_dirty = 1;
1314-
lmv->lmv_qos.lq_rr.lqr_dirty = 1;
13151314
lmv->lmv_qos.lq_reset = 1;
13161315
/* Default priority is toward free space balance */
13171316
lmv->lmv_qos.lq_prio_free = 232;
13181317
/* Default threshold for rr (roughly 17%) */
13191318
lmv->lmv_qos.lq_threshold_rr = 43;
13201319

1320+
lu_qos_rr_init(&lmv->lmv_qos.lq_rr);
1321+
13211322
/*
13221323
* initialize rr_index to lower 32bit of netid, so that client
13231324
* can distribute subdirs evenly from the beginning.

lustre/lod/lod_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ struct lod_obj_stripe_cb_data {
692692
int lod_prepare_create(const struct lu_env *env, struct lod_object *lo,
693693
struct lu_attr *attr, const struct lu_buf *buf,
694694
struct thandle *th);
695-
void lod_qos_rr_init(struct lu_qos_rr *lqr);
696695
int lod_use_defined_striping(const struct lu_env *, struct lod_object *,
697696
const struct lu_buf *);
698697
int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,

lustre/lod/lod_lov.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,13 +2199,14 @@ int lod_pools_init(struct lod_device *lod, struct lustre_cfg *lcfg)
21992199
INIT_LIST_HEAD(&lod->lod_qos.lq_svr_list);
22002200
init_rwsem(&lod->lod_qos.lq_rw_sem);
22012201
lod->lod_qos.lq_dirty = 1;
2202-
lod->lod_qos.lq_rr.lqr_dirty = 1;
22032202
lod->lod_qos.lq_reset = 1;
22042203
/* Default priority is toward free space balance */
22052204
lod->lod_qos.lq_prio_free = 232;
22062205
/* Default threshold for rr (roughly 17%) */
22072206
lod->lod_qos.lq_threshold_rr = 43;
22082207

2208+
lu_qos_rr_init(&lod->lod_qos.lq_rr);
2209+
22092210
/* Set up OST pool environment */
22102211
lod->lod_pools_hash_body = cfs_hash_create("POOLS", HASH_POOLS_CUR_BITS,
22112212
HASH_POOLS_MAX_BITS,
@@ -2222,7 +2223,6 @@ int lod_pools_init(struct lod_device *lod, struct lustre_cfg *lcfg)
22222223
rc = lod_ost_pool_init(&lod->lod_pool_info, 0);
22232224
if (rc)
22242225
GOTO(out_hash, rc);
2225-
lod_qos_rr_init(&lod->lod_qos.lq_rr);
22262226
rc = lod_ost_pool_init(&lod->lod_qos.lq_rr.lqr_pool, 0);
22272227
if (rc)
22282228
GOTO(out_pool_info, rc);

lustre/lod/lod_pool.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,8 @@ int lod_pool_new(struct obd_device *obd, char *poolname)
661661
if (rc)
662662
GOTO(out_err, rc);
663663

664-
lod_qos_rr_init(&new_pool->pool_rr);
664+
lu_qos_rr_init(&new_pool->pool_rr);
665+
665666
rc = lod_ost_pool_init(&new_pool->pool_rr.lqr_pool, 0);
666667
if (rc)
667668
GOTO(out_free_pool_obds, rc);

lustre/lod/lod_qos.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,6 @@ static int lod_qos_used(struct lod_device *lod, struct ost_pool *osts,
435435
RETURN(0);
436436
}
437437

438-
void lod_qos_rr_init(struct lu_qos_rr *lqr)
439-
{
440-
spin_lock_init(&lqr->lqr_alloc);
441-
lqr->lqr_dirty = 1;
442-
}
443-
444438
#define LOV_QOS_EMPTY ((__u32)-1)
445439

446440
/**

lustre/obdclass/lu_qos.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
#include <lustre_fid.h>
4545
#include <lu_object.h>
4646

47+
void lu_qos_rr_init(struct lu_qos_rr *lqr)
48+
{
49+
spin_lock_init(&lqr->lqr_alloc);
50+
lqr->lqr_dirty = 1;
51+
}
52+
EXPORT_SYMBOL(lu_qos_rr_init);
53+
4754
/**
4855
* Add a new target to Quality of Service (QoS) target table.
4956
*

0 commit comments

Comments
 (0)