ssize_t grant_check_threshold_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer, size_t count);
+ssize_t eviction_count_show(struct kobject *kobj, struct attribute *attr,
+ char *buf);
#endif
struct adaptive_timeout;
extern int lprocfs_at_hist_helper(struct seq_file *m,
atomic_t obd_evict_inprogress;
wait_queue_head_t obd_evict_inprogress_waitq;
struct list_head obd_evict_list; /* protected with pet_lock */
+ atomic_t obd_eviction_count;
/**
* LDLM pool part. Save last calculated SLV and Limit.
LUSTRE_RO_ATTR(num_exports);
LUSTRE_RW_ATTR(grant_check_threshold);
+LUSTRE_RO_ATTR(eviction_count);
static struct attribute *mdt_attrs[] = {
&lustre_attr_tot_dirty.attr,
&lustre_attr_ir_factor.attr,
&lustre_attr_num_exports.attr,
&lustre_attr_grant_check_threshold.attr,
+ &lustre_attr_eviction_count.attr,
&lustre_attr_identity_expire.attr,
&lustre_attr_identity_acquire_expire.attr,
&lustre_attr_identity_upcall.attr,
};
LUSTRE_RO_ATTR(num_exports);
+LUSTRE_RO_ATTR(eviction_count);
static ssize_t fstype_show(struct kobject *kobj, struct attribute *attr,
char *buf)
static struct attribute *mgs_attrs[] = {
&lustre_attr_fstype.attr,
&lustre_attr_mntdev.attr,
+ &lustre_attr_eviction_count.attr,
&lustre_attr_num_exports.attr,
NULL,
};
continue;
}
exp->exp_failed = 1;
+ atomic_inc(&exp->exp_obd->obd_eviction_count);
spin_unlock(&exp->exp_lock);
list_move(&exp->exp_obd_chain, &work_list);
return;
}
+ atomic_inc(&exp->exp_obd->obd_eviction_count);
+
CDEBUG(D_HA, "disconnecting export %p/%s\n",
exp, exp->exp_client_uuid.uuid);
#undef BUFLEN
+ssize_t eviction_count_show(struct kobject *kobj, struct attribute *attr,
+ char *buf)
+{
+ struct obd_device *obd = container_of(kobj, struct obd_device,
+ obd_kset.kobj);
+
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ atomic_read(&obd->obd_eviction_count));
+}
+EXPORT_SYMBOL(eviction_count_show);
+
ssize_t num_exports_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
LUSTRE_RO_ATTR(num_exports);
LUSTRE_RW_ATTR(grant_check_threshold);
+LUSTRE_RO_ATTR(eviction_count);
struct lprocfs_vars lprocfs_ofd_obd_vars[] = {
{ .name = "last_id",
&lustre_attr_ir_factor.attr,
&lustre_attr_num_exports.attr,
&lustre_attr_grant_check_threshold.attr,
+ &lustre_attr_eviction_count.attr,
&lustre_attr_seqs_allocated.attr,
&lustre_attr_grant_precreate.attr,
&lustre_attr_precreate_batch.attr,
}
run_test 145 "connect mdtlovs and process update logs after recovery expire"
+test_146() {
+ local prev_count=$(do_facet $SINGLEMDS \
+ $LCTL get_param -n "mdt.${mds1_svc}.eviction_count")
+
+ mds_evict_client
+
+ client_reconnect
+
+ local next_count=$(do_facet $SINGLEMDS \
+ $LCTL get_param -n "mdt.${mds1_svc}.eviction_count")
+
+ [ "$prev_count" -lt "$next_count" ] ||
+ error "wrong eviction count ($prev_count >= $next_count)"
+}
+run_test 146 "test eviction is counted properly"
+
test_147() {
local obd_timeout=200
local old=$($LCTL get_param -n timeout)