[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210706083820.41358-1-zhangqiao22@huawei.com>
Date: Tue, 6 Jul 2021 16:38:20 +0800
From: Zhang Qiao <zhangqiao22@...wei.com>
To: <mingo@...hat.com>, <peterz@...radead.org>,
<juri.lelli@...hat.com>, <vincent.guittot@...aro.org>
CC: <pjt@...gle.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] sched: Dec __cfs_bandwith_used in destroy_cfs_bandwidth()
__cfs_bandwith_uesd is a static_key to control cfs bandwidth
feature. When adding a cfs_bandwidth group, we need increase
the key, and decrease it when removing. But currently when we
remove a cfs_bandwidth group, we don't decrease the key and
this switch will always be on even if there is no cfs bandwidth
group in the system.
Therefore, when removing a cfs bandwidth group, we decrease
__cfs_bandwith_used by calling cfs_bandwidth_usage_dec().
Fixes: 56f570e512ee ("sched: use jump labels to reduce overhead when bandwidth control is inactive")
Signed-off-by: Zhang Qiao <zhangqiao22@...wei.com>
---
kernel/sched/fair.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 103e31e53e2b..857e8908b7f7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5344,6 +5344,9 @@ static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
if (!cfs_b->throttled_cfs_rq.next)
return;
+ if (cfs_b->quota != RUNTIME_INF)
+ cfs_bandwidth_usage_dec();
+
hrtimer_cancel(&cfs_b->period_timer);
hrtimer_cancel(&cfs_b->slack_timer);
}
--
2.18.0.huawei.25
Powered by blists - more mailing lists