+LUSTRE_ATTR(checksum_pages, 0644, checksums_show, checksums_store);
+
+static ssize_t ll_rd_track_id(struct kobject *kobj, char *buf,
+ enum stats_track_type type)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+
+ if (sbi->ll_stats_track_type == type)
+ return sprintf(buf, "%d\n", sbi->ll_stats_track_id);
+ else if (sbi->ll_stats_track_type == STATS_TRACK_ALL)
+ return sprintf(buf, "0 (all)\n");
+
+ return sprintf(buf, "untracked\n");
+}
+
+static ssize_t ll_wr_track_id(struct kobject *kobj, const char *buffer,
+ size_t count, enum stats_track_type type)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+ unsigned long pid;
+ int rc;
+
+ rc = kstrtoul(buffer, 10, &pid);
+ if (rc)
+ return rc;
+
+ sbi->ll_stats_track_id = pid;
+ if (pid == 0)
+ sbi->ll_stats_track_type = STATS_TRACK_ALL;
+ else
+ sbi->ll_stats_track_type = type;
+ lprocfs_clear_stats(sbi->ll_stats);
+ return count;
+}
+
+static ssize_t stats_track_pid_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ return ll_rd_track_id(kobj, buf, STATS_TRACK_PID);
+}
+
+static ssize_t stats_track_pid_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ return ll_wr_track_id(kobj, buffer, count, STATS_TRACK_PID);
+}
+LUSTRE_RW_ATTR(stats_track_pid);
+
+static ssize_t stats_track_ppid_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ return ll_rd_track_id(kobj, buf, STATS_TRACK_PPID);
+}
+
+static ssize_t stats_track_ppid_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ return ll_wr_track_id(kobj, buffer, count, STATS_TRACK_PPID);
+}
+LUSTRE_RW_ATTR(stats_track_ppid);
+
+static ssize_t stats_track_gid_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ return ll_rd_track_id(kobj, buf, STATS_TRACK_GID);
+}
+
+static ssize_t stats_track_gid_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ return ll_wr_track_id(kobj, buffer, count, STATS_TRACK_GID);
+}
+LUSTRE_RW_ATTR(stats_track_gid);
+
+static ssize_t statahead_running_max_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 snprintf(buf, 16, "%u\n", sbi->ll_sa_running_max);
+}
+
+static ssize_t statahead_running_max_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_RUNNING_MAX) {
+ sbi->ll_sa_running_max = val;
+ return count;
+ }
+
+ CERROR("Bad statahead_running_max value %lu. Valid values "
+ "are in the range [0, %d]\n", val, LL_SA_RUNNING_MAX);
+
+ return -ERANGE;
+}
+LUSTRE_RW_ATTR(statahead_running_max);
+
+static ssize_t statahead_max_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 sprintf(buf, "%u\n", sbi->ll_sa_max);
+}
+
+static ssize_t statahead_max_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_RPC_MAX)
+ sbi->ll_sa_max = val;
+ else
+ CERROR("Bad statahead_max value %lu. Valid values are in the range [0, %d]\n",
+ val, LL_SA_RPC_MAX);
+
+ return count;
+}
+LUSTRE_RW_ATTR(statahead_max);
+
+static ssize_t statahead_agl_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 sprintf(buf, "%u\n", sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
+}
+
+static ssize_t statahead_agl_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);
+ bool val;
+ int rc;
+
+ rc = kstrtobool(buffer, &val);
+ if (rc)
+ return rc;
+
+ if (val)
+ sbi->ll_flags |= LL_SBI_AGL_ENABLED;
+ else
+ sbi->ll_flags &= ~LL_SBI_AGL_ENABLED;
+
+ return count;
+}
+LUSTRE_RW_ATTR(statahead_agl);
+
+static int ll_statahead_stats_seq_show(struct seq_file *m, void *v)