Re: [PATCH] sched: fix need_resched() when checking peempt

From: Steven Rostedt
Date: Tue May 24 2011 - 09:39:49 EST


On Tue, 2011-05-24 at 21:27 +0800, Hillf Danton wrote:
> When checking if current task could be preempted by a newly woken task,
> further check could be bypassed if the current thread is different from
> the current task of run-queue, and it is corrected accordingly.

Ug, that change log is an obfuscated mess. But looking at the actual
patch, I figured what you wanted to say. How about this:

----
The RT preempt check tests the wrong task if NEED_RESCHED is set. It
currently checks the local CPU task. It is suppose to check the task
that is running on the run queue we are about to wake another task on.
----


>
> Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>

With a new change log:

Acked-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

-- Steve

> ---
>
> --- tip-git/kernel/sched_rt.c Sun May 22 20:12:01 2011
> +++ sched_rt.c Tue May 24 20:31:27 2011
> @@ -1074,7 +1074,7 @@ static void check_preempt_curr_rt(struct
> * to move current somewhere else, making room for our non-migratable
> * task.
> */
> - if (p->prio == rq->curr->prio && !need_resched())
> + if (p->prio == rq->curr->prio && !test_tsk_need_resched(rq->curr))
> check_preempt_equal_prio(rq, p);
> #endif
> }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/