lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/8] sched/core: Skip wakeup when task is already running.
On Tue, Apr 15, 2014 at 09:32:53PM +0900, Dongsheng Yang wrote:
> From: Dongsheng <yangds.fnst@cn.fujitsu.com>
>
> It is pointless to wake up a running task. Currently, we can
> see it in perf sched latency.
>
> Signed-off-by: Dongsheng <yangds.fnst@cn.fujitsu.com>
> ---
> kernel/sched/core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 268a45e..fc6b644 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1416,6 +1416,9 @@ static void ttwu_activate(struct rq *rq, struct task_struct *p, int en_flags)
> static void
> ttwu_do_wakeup(struct rq *rq, struct task_struct *p, int wake_flags)
> {
> + if (p->state == TASK_RUNNING)
> + return;
> +
> check_preempt_curr(rq, p, wake_flags);
> trace_sched_wakeup(p, true);
>


How can you get there with ->state == RUNNING? try_to_wake_up*() bail
when !(->state & state).


\
 
 \ /
  Last update: 2014-04-15 16:41    [W:0.111 / U:21.388 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site