[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-a7711602c7b79950ea437178f601b52ab08ef659@git.kernel.org>
Date: Tue, 13 Feb 2018 03:28:45 -0800
From: tip-bot for Wen Yang <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jiang.biao2@....com.cn, hpa@...or.com, wen.yang99@....com.cn,
tglx@...utronix.de, torvalds@...ux-foundation.org,
peterz@...radead.org, mingo@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip:sched/urgent] sched/rt: Make update_curr_rt() more accurate
Commit-ID: a7711602c7b79950ea437178f601b52ab08ef659
Gitweb: https://git.kernel.org/tip/a7711602c7b79950ea437178f601b52ab08ef659
Author: Wen Yang <wen.yang99@....com.cn>
AuthorDate: Tue, 6 Feb 2018 09:53:28 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 13 Feb 2018 11:44:41 +0100
sched/rt: Make update_curr_rt() more accurate
rq->clock_task may be updated between the two calls of
rq_clock_task() in update_curr_rt(). Calling rq_clock_task() only
once makes it more accurate and efficient, taking update_curr() as
reference.
Signed-off-by: Wen Yang <wen.yang99@....com.cn>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Jiang Biao <jiang.biao2@....com.cn>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: zhong.weidong@....com.cn
Link: http://lkml.kernel.org/r/1517882008-44552-1-git-send-email-wen.yang99@zte.com.cn
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/rt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 663b235..aad49451 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -950,12 +950,13 @@ static void update_curr_rt(struct rq *rq)
{
struct task_struct *curr = rq->curr;
struct sched_rt_entity *rt_se = &curr->rt;
- u64 now = rq_clock_task(rq);
u64 delta_exec;
+ u64 now;
if (curr->sched_class != &rt_sched_class)
return;
+ now = rq_clock_task(rq);
delta_exec = now - curr->se.exec_start;
if (unlikely((s64)delta_exec <= 0))
return;
Powered by blists - more mailing lists