* [PATCH] sched: Remove broken check for skip clock update
@ 2013-01-08 1:07 Frederic Weisbecker
2013-01-08 1:49 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Frederic Weisbecker @ 2013-01-08 1:07 UTC (permalink / raw)
To: Ingo Molnar; +Cc: LKML, Frederic Weisbecker, Peter Zijlstra, Steven Rostedt
rq->skip_clock_update shouldn't be negative. Thus the check
in put_prev_task() is useless.
It was probably intended to do the following check:
if (prev->on_rq && !rq->skip_clock_update)
We only want to update the clock if the current task is
not voluntarily sleeping: otherwise deactivate_task()
already did the rq clock update in schedule(). But we want
to ignore that update if a ttwu did it for us, in which case
rq->skip_clock_update is 1.
But update_rq_clock() already takes care of that so we
can just remove the broken condition.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
kernel/sched/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 15ba35e..8dfc461 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2886,7 +2886,7 @@ static inline void schedule_debug(struct task_struct *prev)
static void put_prev_task(struct rq *rq, struct task_struct *prev)
{
- if (prev->on_rq || rq->skip_clock_update < 0)
+ if (prev->on_rq)
update_rq_clock(rq);
prev->sched_class->put_prev_task(rq, prev);
}
--
1.7.5.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sched: Remove broken check for skip clock update
2013-01-08 1:07 [PATCH] sched: Remove broken check for skip clock update Frederic Weisbecker
@ 2013-01-08 1:49 ` Steven Rostedt
2013-01-08 1:55 ` Frederic Weisbecker
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2013-01-08 1:49 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: Ingo Molnar, LKML, Peter Zijlstra
On Tue, 2013-01-08 at 02:07 +0100, Frederic Weisbecker wrote:
> rq->skip_clock_update shouldn't be negative. Thus the check
> in put_prev_task() is useless.
>
> It was probably intended to do the following check:
>
> if (prev->on_rq && !rq->skip_clock_update)
>
> We only want to update the clock if the current task is
> not voluntarily sleeping: otherwise deactivate_task()
> already did the rq clock update in schedule(). But we want
> to ignore that update if a ttwu did it for us, in which case
> rq->skip_clock_update is 1.
>
> But update_rq_clock() already takes care of that so we
> can just remove the broken condition.
kernel/sched/rt.c:
/*
* Force a clock update if the CPU was idle,
* lest wakeup -> unthrottle time accumulate.
*/
if (rt_rq->rt_nr_running && rq->curr == rq->idle)
rq->skip_clock_update = -1;
-- Steve
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> ---
> kernel/sched/core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 15ba35e..8dfc461 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2886,7 +2886,7 @@ static inline void schedule_debug(struct task_struct *prev)
>
> static void put_prev_task(struct rq *rq, struct task_struct *prev)
> {
> - if (prev->on_rq || rq->skip_clock_update < 0)
> + if (prev->on_rq)
> update_rq_clock(rq);
> prev->sched_class->put_prev_task(rq, prev);
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sched: Remove broken check for skip clock update
2013-01-08 1:49 ` Steven Rostedt
@ 2013-01-08 1:55 ` Frederic Weisbecker
0 siblings, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2013-01-08 1:55 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Ingo Molnar, LKML, Peter Zijlstra
2013/1/8 Steven Rostedt <rostedt@goodmis.org>:
> On Tue, 2013-01-08 at 02:07 +0100, Frederic Weisbecker wrote:
>> rq->skip_clock_update shouldn't be negative. Thus the check
>> in put_prev_task() is useless.
>>
>> It was probably intended to do the following check:
>>
>> if (prev->on_rq && !rq->skip_clock_update)
>>
>> We only want to update the clock if the current task is
>> not voluntarily sleeping: otherwise deactivate_task()
>> already did the rq clock update in schedule(). But we want
>> to ignore that update if a ttwu did it for us, in which case
>> rq->skip_clock_update is 1.
>>
>> But update_rq_clock() already takes care of that so we
>> can just remove the broken condition.
>
> kernel/sched/rt.c:
>
> /*
> * Force a clock update if the CPU was idle,
> * lest wakeup -> unthrottle time accumulate.
> */
> if (rt_rq->rt_nr_running && rq->curr == rq->idle)
> rq->skip_clock_update = -1;
Grr, I knew I was missing something!
Ok let's drop that patch then.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-08 1:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-08 1:07 [PATCH] sched: Remove broken check for skip clock update Frederic Weisbecker
2013-01-08 1:49 ` Steven Rostedt
2013-01-08 1:55 ` Frederic Weisbecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®