Such name means if the rate of auto detected inconsistent
OI mappings exceeds the specified threshold, then trigger
OI scrub to scan the whole device. To avoid confusion,
rename it as full_scrub_threshold_rate.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I331fcd60c01828f5b689f4d1dc4601f38c3e9cf4
Reviewed-on: http://review.whamcloud.com/12958
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
o->od_is_ost = 1;
o->od_full_scrub_ratio = OFSR_DEFAULT;
o->od_is_ost = 1;
o->od_full_scrub_ratio = OFSR_DEFAULT;
- o->od_full_scrub_speed = FULL_SCRUB_SPEED_DEFULT;
+ o->od_full_scrub_threshold_rate = FULL_SCRUB_THRESHOLD_RATE_DEFAULT;
rc = osd_mount(env, o, cfg);
if (rc != 0)
GOTO(out_capa, rc);
rc = osd_mount(env, o, cfg);
if (rc != 0)
GOTO(out_capa, rc);
* OI scrub to scan the whole the device. */
__u64 od_full_scrub_ratio;
/* If the speed of found bad OI mappings (per minute)
* OI scrub to scan the whole the device. */
__u64 od_full_scrub_ratio;
/* If the speed of found bad OI mappings (per minute)
- * exceeds the osd_device::od_full_scrub_speed, then
- * trigger OI scrub to scan the whole the device. */
- __u64 od_full_scrub_speed;
+ * exceeds the osd_device::od_full_scrub_threshold_rate,
+ * then trigger OI scrub to scan the whole device. */
+ __u64 od_full_scrub_threshold_rate;
};
enum osd_full_scrub_ratio {
};
enum osd_full_scrub_ratio {
-#define FULL_SCRUB_SPEED_DEFULT 60
+#define FULL_SCRUB_THRESHOLD_RATE_DEFAULT 60
/* There are at most 10 uid/gids are affected in a transaction, and
* that's rename case:
/* There are at most 10 uid/gids are affected in a transaction, and
* that's rename case:
}
LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_ratio);
}
LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_ratio);
-static int ldiskfs_osd_full_scrub_speed_seq_show(struct seq_file *m, void *data)
+static int ldiskfs_osd_full_scrub_threshold_rate_seq_show(struct seq_file *m,
+ void *data)
{
struct osd_device *dev = osd_dt_dev((struct dt_device *)m->private);
{
struct osd_device *dev = osd_dt_dev((struct dt_device *)m->private);
return -EINPROGRESS;
return seq_printf(m, LPU64" (bad OI mappings/minute)\n",
return -EINPROGRESS;
return seq_printf(m, LPU64" (bad OI mappings/minute)\n",
- dev->od_full_scrub_speed);
+ dev->od_full_scrub_threshold_rate);
-ldiskfs_osd_full_scrub_speed_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+ldiskfs_osd_full_scrub_threshold_rate_seq_write(struct file *file,
+ const char *buffer,
+ size_t count, loff_t *off)
{
struct seq_file *m = file->private_data;
struct dt_device *dt = m->private;
{
struct seq_file *m = file->private_data;
struct dt_device *dt = m->private;
if (val < 0)
return -EINVAL;
if (val < 0)
return -EINVAL;
- dev->od_full_scrub_speed = val;
+ dev->od_full_scrub_threshold_rate = val;
-LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_speed);
+LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_threshold_rate);
static int
ldiskfs_osd_track_declares_assert_seq_show(struct seq_file *m, void *data)
static int
ldiskfs_osd_track_declares_assert_seq_show(struct seq_file *m, void *data)
.fops = &ldiskfs_osd_auto_scrub_fops },
{ .name = "full_scrub_ratio",
.fops = &ldiskfs_osd_full_scrub_ratio_fops },
.fops = &ldiskfs_osd_auto_scrub_fops },
{ .name = "full_scrub_ratio",
.fops = &ldiskfs_osd_full_scrub_ratio_fops },
- { .name = "full_scrub_speed",
- .fops = &ldiskfs_osd_full_scrub_speed_fops },
+ { .name = "full_scrub_threshold_rate",
+ .fops = &ldiskfs_osd_full_scrub_threshold_rate_fops },
{ .name = "oi_scrub",
.fops = &ldiskfs_osd_oi_scrub_fops },
{ .name = "read_cache_enable",
{ .name = "oi_scrub",
.fops = &ldiskfs_osd_oi_scrub_fops },
{ .name = "read_cache_enable",
}
scrub->os_bad_oimap_time = now;
}
scrub->os_bad_oimap_time = now;
- if (++scrub->os_bad_oimap_count > dev->od_full_scrub_speed)
+ if (++scrub->os_bad_oimap_count >
+ dev->od_full_scrub_threshold_rate)
scrub->os_full_scrub = 1;
}
scrub->os_full_scrub = 1;
}
- local n
-
- for n in $(seq $MDSCOUNT); do
- do_facet mds$n $LCTL set_param -n \
- osd-ldiskfs.$(facet_svc mds$n).auto_scrub 1
- done
+ do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param -n \
+ osd-ldiskfs.*.auto_scrub=1
- for n in $(seq $MDSCOUNT); do
- do_facet mds$n $LCTL set_param -n \
- osd-ldiskfs.$(facet_svc mds$n).full_scrub_ratio $ratio
- done
+ do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param -n \
+ osd-ldiskfs.*.full_scrub_ratio=$ratio
-full_scrub_speed() {
- local speed=$1
- local n
+full_scrub_threshold_rate() {
+ [[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.6.50) ]] &&
+ return
- for n in $(seq $MDSCOUNT); do
- do_facet mds$n $LCTL set_param -n \
- osd-ldiskfs.$(facet_svc mds$n).full_scrub_speed $speed
- done
+ local rate=$1
+
+ do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param -n \
+ osd-ldiskfs.*.full_scrub_threshold_rate=$rate
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
full_scrub_ratio 10
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
full_scrub_ratio 10
+ full_scrub_threshold_rate 10000
scrub_check_data 6
sleep 3
scrub_check_data 6
sleep 3
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
full_scrub_ratio 2
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
full_scrub_ratio 2
+ full_scrub_threshold_rate 20
scrub_check_data 6
sleep 3
scrub_check_data 6
sleep 3