projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fe0ce1
)
sched/rt: Make update_curr_rt() more accurate
author
Wen Yang
<
[email protected]
>
Tue, 6 Feb 2018 01:53:28 +0000
(09:53 +0800)
committer
Ingo Molnar
<
[email protected]
>
Tue, 13 Feb 2018 10:44:41 +0000
(11:44 +0100)
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 <
[email protected]
>
Signed-off-by: Peter Zijlstra (Intel) <
[email protected]
>
Reviewed-by: Jiang Biao <
[email protected]
>
Cc: Linus Torvalds <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Cc:
[email protected]
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Ingo Molnar <
[email protected]
>
kernel/sched/rt.c
patch
|
blob
|
history
diff --git
a/kernel/sched/rt.c
b/kernel/sched/rt.c
index 663b2355a3aa772d8bcc8c90b55a3e0e0e3a6e17..aad49451584e6766d1b9a2f657397da345146c23 100644
(file)
--- 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;