public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: mingo@elte.hu
Cc: efault@gmx.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] From: Mike Galbraith <efault@gmx.de>
Date: Tue, 16 Dec 2008 08:54:02 +0100	[thread overview]
Message-ID: <1229414042.14605.49.camel@twins> (raw)
In-Reply-To: <20081216074636.002108651@chello.nl>

I suck!

Subject: sched: fix wakeup preemption clock

On Tue, 2008-12-16 at 08:45 +0100, Peter Zijlstra wrote:
> plain text document attachment (sched-fix-wakeup-clock.patch)
> From: Mike Galbraith <efault@gmx.de>
> 
> It was possible to do the preemption check against an old time stamp.
> 
> Signed-off-by: Mike Galbraith <efault@gmx.de>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
>  kernel/sched.c      |    2 +-
>  kernel/sched_fair.c |    7 +++----
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/sched.c b/kernel/sched.c
> index ce55b6a..efe5c6d 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -2259,6 +2259,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
>  
>  	smp_wmb();
>  	rq = task_rq_lock(p, &flags);
> +	update_rq_clock(rq);
>  	old_state = p->state;
>  	if (!(old_state & state))
>  		goto out;
> @@ -2316,7 +2317,6 @@ out_activate:
>  		schedstat_inc(p, se.nr_wakeups_local);
>  	else
>  		schedstat_inc(p, se.nr_wakeups_remote);
> -	update_rq_clock(rq);
>  	activate_task(rq, p, 1);
>  	success = 1;
>  
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 08ffffd..6ae5115 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -1343,12 +1343,11 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)
>  {
>  	struct task_struct *curr = rq->curr;
>  	struct sched_entity *se = &curr->se, *pse = &p->se;
> +	struct cfs_rq *cfs_rq = task_cfs_rq(curr);
>  
> -	if (unlikely(rt_prio(p->prio))) {
> -		struct cfs_rq *cfs_rq = task_cfs_rq(curr);
> +	update_curr(cfs_rq);
>  
> -		update_rq_clock(rq);
> -		update_curr(cfs_rq);
> +	if (unlikely(rt_prio(p->prio))) {
>  		resched_task(curr);
>  		return;
>  	}
> 


  reply	other threads:[~2008-12-16  7:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16  7:45 [PATCH 0/3] scheduler patches Peter Zijlstra
2008-12-16  7:45 ` [PATCH 1/3] From: Mike Galbraith <efault@gmx.de> Peter Zijlstra
2008-12-16  7:54   ` Peter Zijlstra [this message]
2008-12-16  7:45 ` [PATCH 2/3] sched: optimize update_curr() Peter Zijlstra
2008-12-16  7:45 ` [PATCH 3/3] sched: prefer wakers Peter Zijlstra
2008-12-16  9:05   ` Mike Galbraith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229414042.14605.49.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox