sched/stop_task: Do not account zero delta_exec in put_prev_task_stop
PATCH 1/1 sched/stop_task: Do not account zero delta_exec in put_prev_task_stop
Simple return
--- kernel/sched/stop_task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/stop_task.c +2 -2
@@ -58,8 +58,8 @@ static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)u64 delta_exec; delta_exec = rq->clock_task - curr->se.exec_start; -if (unlikely ((s64 )delta_exec <0 )) - delta_exec =0 ; +if (unlikely ((s64 )delta_exec <=0 )) +return ;schedstat_set (curr->se.statistics.exec_max,max (curr->se.statistics.exec_max, delta_exec));
Hi Kirill,
Quoted 15 lines · Kirill Tkhai
Simple return
Signed-off-by Kirill V Tkhai <[email protected]>CC Steven Rostedt <[email protected]>CC Ingo Molnar <[email protected]>CC Peter Zijlstra <[email protected]>CC linux-rt-users <[email protected]>--- kernel/sched/stop_task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/sched/stop_task.c +0
-0
kernel/sched/stop_task.c static void put_prev_task_stop(struct rq *rq, struct task_struct *prev) · line 62
Quoted 7 lines
kernel/sched/stop_task.c +2
-2@@ -58,8 +58,8 @@ static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)u64 delta_exec; delta_exec = rq->clock_task - curr->se.exec_start; -if (unlikely ((s64 )delta_exec <0 )) - delta_exec =0 ; +if (unlikely ((s64 )delta_exec <=0 )) +return ;
It seems it needs to update curr->se.exec_start then.
Thanks,
Namhyung
Quoted 7 lines
kernel/sched/stop_task.c +0
-1schedstat_set (curr->se.statistics.exec_max,max (curr->se.statistics.exec_max, delta_exec)); --To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Steven Rostedt
reviewerQuoted 10 lines · Namhyung Kim
---
Quoted 9 lines
kernel/sched/stop_task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/sched/stop_task.c +0
-0@@ -58,8 +58,8 @@ static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)u64 delta_exec;
Quoted 8 lines
kernel/sched/stop_task.c static void put_prev_task_stop(struct rq *rq, struct task_struct *prev) · line 62
Quoted 5 lines
kernel/sched/stop_task.c +2
-2delta_exec = rq->clock_task - curr->se.exec_start; -if (unlikely ((s64 )delta_exec <0 )) - delta_exec =0 ; +if (unlikely ((s64 )delta_exec <=0 )) +return ;It seems it needs to update
curr->se.exec_startthen.
Ah, if it's less than zero, it does.
A better patch would be:
if (unlikely((s64)delta_exec <= 0)) {
curr->se.exec_start = rq->clock_task;
return;
}Thanks!
-- Steve
Steven Rostedt
reviewerQuoted 2 lines · Kirill Tkhai
Simple return
I'll ack the patch, but I nack the change log. Please write something up that's a little more descriptive.
Thanks,
-- Steve
Quoted 23 lines
Signed-off-by Kirill V Tkhai <[email protected]>CC Steven Rostedt <[email protected]>CC Ingo Molnar <[email protected]>CC Peter Zijlstra <[email protected]>CC linux-rt-users <[email protected]>--- kernel/sched/stop_task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/sched/stop_task.c +2
-2@@ -58,8 +58,8 @@ static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)u64 delta_exec; delta_exec = rq->clock_task - curr->se.exec_start; -if (unlikely ((s64 )delta_exec <0 )) - delta_exec =0 ; +if (unlikely ((s64 )delta_exec <=0 )) +return ;schedstat_set (curr->se.statistics.exec_max,max (curr->se.statistics.exec_max, delta_exec));