sched/rt: Add a check for calling update_curr_rt()
PATCH 1/1 sched/rt: Add a check for calling update_curr_rt()
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 <[email protected]>
--- kernel/sched/rt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
kernel/sched/rt.c +4 -3
@@ -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)
Signature · 1 line
2.17.1