[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <159308600404.16989.11999538573248060370.tip-bot2@tip-bot2>
Date: Thu, 25 Jun 2020 11:53:24 -0000
From: "tip-bot2 for Peng Wang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Peng Wang <rocking@...ux.alibaba.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: sched/core] sched/fair: Optimize dequeue_task_fair()
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 423d02e1463b21109106f52d94f7396b63731f3b
Gitweb: https://git.kernel.org/tip/423d02e1463b21109106f52d94f7396b63731f3b
Author: Peng Wang <rocking@...ux.alibaba.com>
AuthorDate: Tue, 16 Jun 2020 14:04:07 +08:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Thu, 25 Jun 2020 13:45:44 +02:00
sched/fair: Optimize dequeue_task_fair()
While looking at enqueue_task_fair and dequeue_task_fair, it occurred
to me that dequeue_task_fair can also be optimized as Vincent described
in commit 7d148be69e3a ("sched/fair: Optimize enqueue_task_fair()").
When encountering throttled cfs_rq, dequeue_throttle label can ensure
se not to be NULL, and rq->nr_running remains unchanged, so we can also
skip the early balance check.
Signed-off-by: Peng Wang <rocking@...ux.alibaba.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>
Link: https://lkml.kernel.org/r/701eef9a40de93dcf5fe7063fd607bca5db38e05.1592287263.git.rocking@linux.alibaba.com
---
kernel/sched/fair.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a63f400..b9b9f19 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5624,14 +5624,14 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
}
-dequeue_throttle:
- if (!se)
- sub_nr_running(rq, 1);
+ /* At this point se is NULL and we are at root level*/
+ sub_nr_running(rq, 1);
/* balance early to pull high priority tasks */
if (unlikely(!was_sched_idle && sched_idle_rq(rq)))
rq->next_balance = jiffies;
+dequeue_throttle:
util_est_dequeue(&rq->cfs, p, task_sleep);
hrtick_update(rq);
}
Powered by blists - more mailing lists