X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Flproc_llite.c;h=060e8fbc56e8ff8ba74d8701fc5be97795ebdc0d;hb=e10bf68d7c3eb71a7e84986089c020aa4c9f98f7;hp=ef8fabf05bc76a468e21c79d782d019d7cc7153e;hpb=0031ab371ddd0ffda157629fb64c101203a3b1e2;p=fs%2Flustre-release.git diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index ef8fabf..060e8fb 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -864,10 +864,10 @@ static ssize_t statahead_max_store(struct kobject *kobj, if (rc) return rc; - if (val > LL_SA_RPC_MAX) { + if (val > LL_SA_REQ_MAX) { CWARN("%s: statahead_max value %lu limited to maximum %d\n", - sbi->ll_fsname, val, LL_SA_RPC_MAX); - val = LL_SA_RPC_MAX; + sbi->ll_fsname, val, LL_SA_REQ_MAX); + val = LL_SA_REQ_MAX; } sbi->ll_sa_max = val; @@ -875,6 +875,72 @@ static ssize_t statahead_max_store(struct kobject *kobj, } LUSTRE_RW_ATTR(statahead_max); +static ssize_t statahead_min_show(struct kobject *kobj, + struct attribute *attr, + char *buf) +{ + struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, + ll_kset.kobj); + + return scnprintf(buf, PAGE_SIZE, "%u\n", sbi->ll_sa_min); +} + +static ssize_t statahead_min_store(struct kobject *kobj, + struct attribute *attr, + const char *buffer, + size_t count) +{ + struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, + ll_kset.kobj); + unsigned long val; + int rc; + + rc = kstrtoul(buffer, 0, &val); + if (rc) + return rc; + + if (val < LL_SA_REQ_MIN) + CERROR("%s: bad statahead_min %lu < min %u\n", + sbi->ll_fsname, val, LL_SA_REQ_MIN); + else if (val > sbi->ll_sa_max) + CERROR("%s: bad statahead_min %lu > max %u\n", + sbi->ll_fsname, val, sbi->ll_sa_max); + else + sbi->ll_sa_min = val; + + return count; +} +LUSTRE_RW_ATTR(statahead_min); + +static ssize_t statahead_timeout_show(struct kobject *kobj, + struct attribute *attr, + char *buf) +{ + struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, + ll_kset.kobj); + + return scnprintf(buf, PAGE_SIZE, "%lu\n", sbi->ll_sa_timeout); +} + +static ssize_t statahead_timeout_store(struct kobject *kobj, + struct attribute *attr, + const char *buffer, + size_t count) +{ + struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, + ll_kset.kobj); + unsigned long val; + int rc; + + rc = kstrtoul(buffer, 0, &val); + if (rc) + return rc; + + sbi->ll_sa_timeout = val; + return count; +} +LUSTRE_RW_ATTR(statahead_timeout); + static ssize_t statahead_agl_show(struct kobject *kobj, struct attribute *attr, char *buf) @@ -917,11 +983,15 @@ static int ll_statahead_stats_seq_show(struct seq_file *m, void *v) seq_printf(m, "statahead total: %u\n" "statahead wrong: %u\n" "agl total: %u\n" + "list_total: %u\n" + "fname_total: %u\n" "hit_total: %u\n" "miss_total: %u\n", atomic_read(&sbi->ll_sa_total), atomic_read(&sbi->ll_sa_wrong), atomic_read(&sbi->ll_agl_total), + atomic_read(&sbi->ll_sa_list_total), + atomic_read(&sbi->ll_sa_fname_total), atomic_read(&sbi->ll_sa_hit_total), atomic_read(&sbi->ll_sa_miss_total)); return 0; @@ -938,6 +1008,8 @@ static ssize_t ll_statahead_stats_seq_write(struct file *file, atomic_set(&sbi->ll_sa_total, 0); atomic_set(&sbi->ll_sa_wrong, 0); atomic_set(&sbi->ll_agl_total, 0); + atomic_set(&sbi->ll_sa_list_total, 0); + atomic_set(&sbi->ll_sa_fname_total, 0); atomic_set(&sbi->ll_sa_hit_total, 0); atomic_set(&sbi->ll_sa_miss_total, 0); @@ -1950,6 +2022,8 @@ static struct attribute *llite_attrs[] = { &lustre_attr_statahead_running_max.attr, &lustre_attr_statahead_batch_max.attr, &lustre_attr_statahead_max.attr, + &lustre_attr_statahead_min.attr, + &lustre_attr_statahead_timeout.attr, &lustre_attr_statahead_agl.attr, &lustre_attr_lazystatfs.attr, &lustre_attr_statfs_max_age.attr,