lkml.org 
[lkml]   [2018]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched/rt: Add a check for calling update_curr_rt()
Date
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
\
 
 \ /
  Last update: 2018-11-06 16:58    [W:0.092 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site