The 'lqrr' field in 'struct lu_qos' is not used on the client (lmv).
So make it server-only for use in lod.
- move 'struct lu_qos_rr' into lu_target.h
- protect lq_rr with HAVE_SERVER_SUPPORT
- make lu_qos_rr_init() a static-inline in lu_target,
and call it explicitly from lod instead of from lu_tgt_descs_init()
- protect setting of LQ_DIRTY to in lu_tgt_descs.c with
HAVE_SERVER_SUPPORT
Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I019cac560d68688042a02a53bd96b605909acdcd
Reviewed-on: https://review.whamcloud.com/41950
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LQ_RESET, /* zero current penalties */
};
LQ_RESET, /* zero current penalties */
};
+#ifdef HAVE_SERVER_SUPPORT
/* round-robin QoS data for LOD/LMV */
struct lu_qos_rr {
spinlock_t lqr_alloc; /* protect allocation index */
/* round-robin QoS data for LOD/LMV */
struct lu_qos_rr {
spinlock_t lqr_alloc; /* protect allocation index */
unsigned long lqr_flags;
};
unsigned long lqr_flags;
};
+static inline void lu_qos_rr_init(struct lu_qos_rr *lqr)
+{
+ spin_lock_init(&lqr->lqr_alloc);
+ set_bit(LQ_DIRTY, &lqr->lqr_flags);
+}
+
+#endif /* HAVE_SERVER_SUPPORT */
+
/* QoS data per MDS/OSS */
struct lu_svr_qos {
struct obd_uuid lsq_uuid; /* ptlrpc's c_remote_uuid */
/* QoS data per MDS/OSS */
struct lu_svr_qos {
struct obd_uuid lsq_uuid; /* ptlrpc's c_remote_uuid */
__u32 lq_active_svr_count;
unsigned int lq_prio_free; /* priority for free space */
unsigned int lq_threshold_rr;/* priority for rr */
__u32 lq_active_svr_count;
unsigned int lq_prio_free; /* priority for free space */
unsigned int lq_threshold_rr;/* priority for rr */
+#ifdef HAVE_SERVER_SUPPORT
struct lu_qos_rr lq_rr; /* round robin qos data */
struct lu_qos_rr lq_rr; /* round robin qos data */
unsigned long lq_flags;
#if 0
unsigned long lq_dirty:1, /* recalc qos data */
unsigned long lq_flags;
#if 0
unsigned long lq_dirty:1, /* recalc qos data */
ldi_tgt[(index) % TGT_PTRS_PER_BLOCK]
u64 lu_prandom_u64_max(u64 ep_ro);
ldi_tgt[(index) % TGT_PTRS_PER_BLOCK]
u64 lu_prandom_u64_max(u64 ep_ro);
-void lu_qos_rr_init(struct lu_qos_rr *lqr);
int lu_qos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
void lu_tgt_qos_weight_calc(struct lu_tgt_desc *tgt);
int lu_qos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
void lu_tgt_qos_weight_calc(struct lu_tgt_desc *tgt);
spin_lock_init(&lod->lod_connects_lock);
lu_tgt_descs_init(&lod->lod_mdt_descs, true);
lu_tgt_descs_init(&lod->lod_ost_descs, false);
spin_lock_init(&lod->lod_connects_lock);
lu_tgt_descs_init(&lod->lod_mdt_descs, true);
lu_tgt_descs_init(&lod->lod_ost_descs, false);
+ lu_qos_rr_init(&lod->lod_mdt_descs.ltd_qos.lq_rr);
+ lu_qos_rr_init(&lod->lod_ost_descs.ltd_qos.lq_rr);
}
EXPORT_SYMBOL(lu_prandom_u64_max);
}
EXPORT_SYMBOL(lu_prandom_u64_max);
-void lu_qos_rr_init(struct lu_qos_rr *lqr)
-{
- spin_lock_init(&lqr->lqr_alloc);
- set_bit(LQ_DIRTY, &lqr->lqr_flags);
-}
-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.
*
list_add_tail(&svr->lsq_svr_list, &tempsvr->lsq_svr_list);
set_bit(LQ_DIRTY, &qos->lq_flags);
list_add_tail(&svr->lsq_svr_list, &tempsvr->lsq_svr_list);
set_bit(LQ_DIRTY, &qos->lq_flags);
+#ifdef HAVE_SERVER_SUPPORT
set_bit(LQ_DIRTY, &qos->lq_rr.lqr_flags);
set_bit(LQ_DIRTY, &qos->lq_rr.lqr_flags);
out:
up_write(&qos->lq_rw_sem);
RETURN(rc);
out:
up_write(&qos->lq_rw_sem);
RETURN(rc);
}
set_bit(LQ_DIRTY, &qos->lq_flags);
}
set_bit(LQ_DIRTY, &qos->lq_flags);
+#ifdef HAVE_SERVER_SUPPORT
set_bit(LQ_DIRTY, &qos->lq_rr.lqr_flags);
set_bit(LQ_DIRTY, &qos->lq_rr.lqr_flags);
out:
up_write(&qos->lq_rw_sem);
RETURN(rc);
out:
up_write(&qos->lq_rw_sem);
RETURN(rc);
if (is_mdt)
ltd->ltd_lmv_desc.ld_pattern = LMV_HASH_TYPE_DEFAULT;
if (is_mdt)
ltd->ltd_lmv_desc.ld_pattern = LMV_HASH_TYPE_DEFAULT;
- lu_qos_rr_init(<d->ltd_qos.lq_rr);
-
return 0;
}
EXPORT_SYMBOL(lu_tgt_descs_init);
return 0;
}
EXPORT_SYMBOL(lu_tgt_descs_init);