linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/rt: Add a check for calling update_curr_rt()
@ 2018-11-06 15:57 Muchun Song
  0 siblings, 0 replies; only message in thread
From: Muchun Song @ 2018-11-06 15:57 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel

We may dequeue prev's rt_rq in put_prev_task() only when RT
bandwidth is enabled. If RT bandwidth is disabled, it is
unnecessary for us to call update_curr_rt(). So we add a check
there.

Signed-off-by: Muchun Song <smuchun@gmail.com>
---
 kernel/sched/rt.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 9aa3287ce301..7761a75d9b87 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1564,10 +1564,11 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
 	}
 
 	/*
-	 * We may dequeue prev's rt_rq in put_prev_task().
-	 * So, we update time before rt_queued check.
+	 * We may dequeue prev's rt_rq in put_prev_task()
+	 * only when RT bandwidth is enabled. So, we
+	 * update time before rt_queued check.
 	 */
-	if (prev->sched_class == &rt_sched_class)
+	if (rt_bandwidth_enabled() && prev->sched_class == &rt_sched_class)
 		update_curr_rt(rq);
 
 	if (!rt_rq->rt_queued)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-06 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 15:57 [PATCH] sched/rt: Add a check for calling update_curr_rt() Muchun Song

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).