提交 3fcd5793 编写于 作者: Y Yu Kuai 提交者: Li Nan

blk-iocost: track whether iocg is still online

hulk inclusion
category: bugfix
bugzilla: 188107, https://gitee.com/openeuler/kernel/issues/I665S2
CVE: NA

--------------------------------

blkcg_gq->online can't be used in iocost because it get cleared only after
all policies are offlined. This patch add a new field 'online' in iocg.
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Signed-off-by: NLi Nan <linan122@huawei.com>
上级 4c2d16fb
......@@ -486,6 +486,7 @@ struct ioc_gq {
u32 inuse;
u32 last_inuse;
bool online;
s64 saved_margin;
sector_t cursor; /* to detect randio */
......@@ -2932,6 +2933,7 @@ static void ioc_pd_init(struct blkg_policy_data *pd)
ioc_now(ioc, &now);
iocg->ioc = ioc;
iocg->online = true;
atomic64_set(&iocg->vtime, now.vnow);
atomic64_set(&iocg->done_vtime, now.vnow);
atomic64_set(&iocg->active_period, atomic64_read(&ioc->cur_period));
......@@ -2966,6 +2968,8 @@ static void ioc_pd_offline(struct blkg_policy_data *pd)
if (ioc) {
spin_lock_irqsave(&ioc->lock, flags);
iocg->online = false;
if (!list_empty(&iocg->active_list)) {
struct ioc_now now;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册