From ffe00dd105aeb3cd8c5410405fdc6f1b43b4e6b8 Mon Sep 17 00:00:00 2001 From: Gregory Haskins Date: Wed, 23 Apr 2008 07:13:29 -0400 Subject: [PATCH] --- yaml --- r: 96038 b: refs/heads/master c: 8ae121ac8666b0421aa20fd80d4597ec66fa54bc h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/sched.h | 7 ++++++- trunk/kernel/sched_rt.c | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 6ea9cf2911ef..615f13913a4c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 983ed7a66bcec9dc307d89dc7af47cdf209e56af +refs/heads/master: 8ae121ac8666b0421aa20fd80d4597ec66fa54bc diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 03c238088aee..698b5a4d25a7 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -1977,6 +1977,11 @@ static inline void clear_tsk_need_resched(struct task_struct *tsk) clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); } +static inline int test_tsk_need_resched(struct task_struct *tsk) +{ + return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); +} + static inline int signal_pending(struct task_struct *p) { return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); @@ -1991,7 +1996,7 @@ static inline int fatal_signal_pending(struct task_struct *p) static inline int need_resched(void) { - return unlikely(test_thread_flag(TIF_NEED_RESCHED)); + return unlikely(test_tsk_need_resched(current)); } /* diff --git a/trunk/kernel/sched_rt.c b/trunk/kernel/sched_rt.c index dcd649588593..060e87b0cb1c 100644 --- a/trunk/kernel/sched_rt.c +++ b/trunk/kernel/sched_rt.c @@ -1098,11 +1098,14 @@ static void post_schedule_rt(struct rq *rq) } } - +/* + * If we are not running and we are not going to reschedule soon, we should + * try to push tasks away now + */ static void task_wake_up_rt(struct rq *rq, struct task_struct *p) { if (!task_running(rq, p) && - (p->prio >= rq->rt.highest_prio) && + !test_tsk_need_resched(rq->curr) && rq->rt.overloaded) push_rt_tasks(rq); }