struct rw_semaphore lq_rw_sem;
__u32 lq_active_oss_count;
unsigned int lq_prio_free; /* priority for free space */
+ unsigned int lq_threshold_rr;/* priority for rr */
struct lov_qos_rr lq_rr; /* round robin qos data */
unsigned long lq_dirty:1, /* recalc qos data */
lq_same_space:1,/* the ost's all have approx.
lov->lov_qos.lq_reset = 1;
/* Default priority is toward free space balance */
lov->lov_qos.lq_prio_free = 232;
+ /* Default threshold for rr (roughly 17%) */
+ lov->lov_qos.lq_threshold_rr = 43;
lov->lov_pools_hash_body = lustre_hash_init("POOLS", 7, 7,
&pool_hash_operations, 0);
/* If each ost has almost same free space,
* do rr allocation for better creation performance */
lov->lov_qos.lq_same_space = 0;
- temp = ba_max - ba_min;
- ba_min = (ba_min * 51) >> 8; /* 51/256 = .20 */
- if (temp < ba_min) {
- /* Difference is less than 20% */
+ if ((ba_max * (256 - lov->lov_qos.lq_threshold_rr)) >> 8 < ba_min) {
lov->lov_qos.lq_same_space = 1;
/* Reset weights for the next time we enter qos mode */
lov->lov_qos.lq_reset = 1;
return count;
}
+static int lov_rd_qos_thresholdrr(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_device *dev = (struct obd_device*) data;
+ struct lov_obd *lov;
+
+ LASSERT(dev != NULL);
+ lov = &dev->u.lov;
+ *eof = 1;
+ return snprintf(page, count, "%d%%\n",
+ (lov->lov_qos.lq_threshold_rr * 100) >> 8);
+}
+
+static int lov_wr_qos_thresholdrr(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct obd_device *dev = (struct obd_device *)data;
+ struct lov_obd *lov;
+ int val, rc;
+ LASSERT(dev != NULL);
+
+ lov = &dev->u.lov;
+ rc = lprocfs_write_helper(buffer, count, &val);
+ if (rc)
+ return rc;
+
+ if (val > 100 || val < 0)
+ return -EINVAL;
+
+ lov->lov_qos.lq_threshold_rr = (val << 8) / 100;
+ lov->lov_qos.lq_dirty = 1;
+ return count;
+}
+
static int lov_rd_qos_maxage(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
{ "kbytesavail", lprocfs_rd_kbytesavail, 0, 0 },
{ "desc_uuid", lov_rd_desc_uuid, 0, 0 },
{ "qos_prio_free",lov_rd_qos_priofree, lov_wr_qos_priofree, 0 },
+ { "qos_threshold_rr", lov_rd_qos_thresholdrr, lov_wr_qos_thresholdrr, 0 },
{ "qos_maxage", lov_rd_qos_maxage, lov_wr_qos_maxage, 0 },
{ 0 }
};