[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1229414042.14605.49.camel@twins>
Date: Tue, 16 Dec 2008 08:54:02 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: mingo@...e.hu
Cc: efault@....de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] From: Mike Galbraith <efault@....de>
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@....de>
>
> It was possible to do the preemption check against an old time stamp.
>
> Signed-off-by: Mike Galbraith <efault@....de>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.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;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists