linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] sched/fair: avoid burst statistic if it's not set
@ 2021-12-08 14:50 Honglei Wang
  2021-12-09 12:22 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Honglei Wang @ 2021-12-08 14:50 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel
  Cc: Huaixin Chang, Honglei Wang

It's not necessary to do burst associated statistic and calculation for
runtime if the burst feature is not set at all. Just return at the very
start point if so.

Signed-off-by: Honglei Wang <wanghonglei@didichuxing.com>
---
 kernel/sched/fair.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6e476f6d9435..2cd626c22912 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4640,6 +4640,11 @@ void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b)
 	if (unlikely(cfs_b->quota == RUNTIME_INF))
 		return;
 
+	if (cfs_b->burst == 0 && cfs_b->runtime_snap == cfs_b->quota) {
+		cfs_b->runtime = cfs_b->quota;
+		return;
+	}
+
 	cfs_b->runtime += cfs_b->quota;
 	runtime = cfs_b->runtime_snap - cfs_b->runtime;
 	if (runtime > 0) {
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-09 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 14:50 [PATCH v2 1/3] sched/fair: avoid burst statistic if it's not set Honglei Wang
2021-12-09 12:22 ` Peter Zijlstra
2021-12-09 15:24   ` Honglei Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).