@@ -3011,21 +3011,6 @@ static void ioc_pd_offline(struct blkg_policy_data *pd)
iocg_lock(iocg, true, &flags);
iocg->online = false;
- iocg_unlock(iocg, true, &flags);
-
- hrtimer_cancel(&iocg->waitq_timer);
- __wake_up(&iocg->waitq, TASK_NORMAL, 0, &ctx);
- }
-}
-
-static void ioc_pd_free(struct blkg_policy_data *pd)
-{
- struct ioc_gq *iocg = pd_to_iocg(pd);
- struct ioc *ioc = iocg->ioc;
- unsigned long flags;
-
- if (ioc) {
- spin_lock_irqsave(&ioc->lock, flags);
if (!list_empty(&iocg->active_list)) {
struct ioc_now now;
@@ -3038,8 +3023,17 @@ static void ioc_pd_free(struct blkg_policy_data *pd)
WARN_ON_ONCE(!list_empty(&iocg->walk_list));
WARN_ON_ONCE(!list_empty(&iocg->surplus_list));
- spin_unlock_irqrestore(&ioc->lock, flags);
+ iocg_unlock(iocg, true, &flags);
+
+ hrtimer_cancel(&iocg->waitq_timer);
+ __wake_up(&iocg->waitq, TASK_NORMAL, 0, &ctx);
}
+}
+
+static void ioc_pd_free(struct blkg_policy_data *pd)
+{
+ struct ioc_gq *iocg = pd_to_iocg(pd);
+
free_percpu(iocg->pcpu_stat);
kfree(iocg);
}