@@ -749,6 +749,8 @@ struct ll_sb_info {
* count
*/
atomic_t ll_agl_total; /* AGL thread started count */
+ atomic_t ll_sa_hit_total; /* total hit count */
+ atomic_t ll_sa_miss_total; /* total miss count */
dev_t ll_sdev_orig; /* save s_dev before assign for
* clustered nfs
@@ -168,6 +168,8 @@ static struct ll_sb_info *ll_init_sbi(void)
atomic_set(&sbi->ll_sa_wrong, 0);
atomic_set(&sbi->ll_sa_running, 0);
atomic_set(&sbi->ll_agl_total, 0);
+ atomic_set(&sbi->ll_sa_hit_total, 0);
+ atomic_set(&sbi->ll_sa_miss_total, 0);
set_bit(LL_SBI_AGL_ENABLED, sbi->ll_flags);
set_bit(LL_SBI_FAST_READ, sbi->ll_flags);
set_bit(LL_SBI_TINY_WRITE, sbi->ll_flags);
@@ -843,14 +843,34 @@ 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",
+ "agl 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_agl_total),
+ atomic_read(&sbi->ll_sa_hit_total),
+ atomic_read(&sbi->ll_sa_miss_total));
return 0;
}
-LDEBUGFS_SEQ_FOPS_RO(ll_statahead_stats);
+static ssize_t ll_statahead_stats_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
+{
+ struct seq_file *m = file->private_data;
+ struct super_block *sb = m->private;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+
+ 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_hit_total, 0);
+ atomic_set(&sbi->ll_sa_miss_total, 0);
+
+ return count;
+}
+LDEBUGFS_SEQ_FOPS(ll_statahead_stats);
static ssize_t lazystatfs_show(struct kobject *kobj,
struct attribute *attr,
@@ -1224,6 +1224,9 @@ static int ll_statahead_thread(void *arg)
spin_unlock(&lli->lli_sa_lock);
wake_up(&sai->sai_waitq);
+ atomic_add(sai->sai_hit, &sbi->ll_sa_hit_total);
+ atomic_add(sai->sai_miss, &sbi->ll_sa_miss_total);
+
ll_sai_put(sai);
return rc;