提交 86068d0f 编写于 作者: J Jiufei Xue 提交者: Joseph Qi

iocost: add ioc_gq stat

Add a stat file to monitor the ioc_gq stat.
Signed-off-by: NJiufei Xue <jiufei.xue@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 6a2b7b88
......@@ -2492,6 +2492,36 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,
return ret;
}
static u64 ioc_stat_prfill(struct seq_file *sf, struct blkg_policy_data *pd,
int off)
{
struct blkcg_gq *blkg = pd->blkg;
const char *dname = blkg_dev_name(blkg);
struct ioc_gq *iocg = blkg_to_iocg(blkg);
struct ioc *ioc = iocg->ioc;
if (!dname)
return 0;
seq_printf(sf, "%s is_active=%d active=%u inuse=%u " \
"hweight_active=%u hweight_inuse=%u vrate=%llu\n",
dname, !list_empty(&iocg->active_list),
iocg->active, iocg->inuse,
iocg->hweight_active, iocg->hweight_inuse,
atomic64_read(&ioc->vtime_rate));
return 0;
}
static int ioc_cost_print_stat(struct seq_file *sf, void *v)
{
struct blkcg *blkcg = css_to_blkcg(seq_css(sf));
blkcg_print_blkgs(sf, blkcg, ioc_stat_prfill,
&blkcg_policy_iocost, seq_cft(sf)->private, false);
return 0;
}
static struct cftype ioc_files[] = {
{
.name = "weight",
......@@ -2533,6 +2563,11 @@ static struct cftype ioc_legacy_files[] = {
.seq_show = ioc_cost_model_show,
.write = ioc_cost_model_write,
},
{
.name = "cost.stat",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = ioc_cost_print_stat,
},
{}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册