[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181106155731.32528-1-smuchun@gmail.com>
Date: Tue, 6 Nov 2018 23:57:31 +0800
From: Muchun Song <smuchun@...il.com>
To: mingo@...nel.org, peterz@...radead.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <smuchun@...il.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
Powered by blists - more mailing lists