From: Yu Kuai yukuai3@huawei.com
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: Yu Kuai yukuai3@huawei.com Signed-off-by: Li Nan linan122@huawei.com --- block/blk-iocost.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 9b9b7cce21d4..004440f9a9f3 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -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;