aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h7
-rw-r--r--kernel/sched_rt.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 03c238088aee..698b5a4d25a7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1977,6 +1977,11 @@ static inline void clear_tsk_need_resched(struct task_struct *tsk)
1977 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); 1977 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
1978} 1978}
1979 1979
1980static inline int test_tsk_need_resched(struct task_struct *tsk)
1981{
1982 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
1983}
1984
1980static inline int signal_pending(struct task_struct *p) 1985static inline int signal_pending(struct task_struct *p)
1981{ 1986{
1982 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); 1987 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));
@@ -1991,7 +1996,7 @@ static inline int fatal_signal_pending(struct task_struct *p)
1991 1996
1992static inline int need_resched(void) 1997static inline int need_resched(void)
1993{ 1998{
1994 return unlikely(test_thread_flag(TIF_NEED_RESCHED)); 1999 return unlikely(test_tsk_need_resched(current));
1995} 2000}
1996 2001
1997/* 2002/*
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index dcd649588593..060e87b0cb1c 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1098,11 +1098,14 @@ static void post_schedule_rt(struct rq *rq)
1098 } 1098 }
1099} 1099}
1100 1100
1101 1101/*
1102 * If we are not running and we are not going to reschedule soon, we should
1103 * try to push tasks away now
1104 */
1102static void task_wake_up_rt(struct rq *rq, struct task_struct *p) 1105static void task_wake_up_rt(struct rq *rq, struct task_struct *p)
1103{ 1106{
1104 if (!task_running(rq, p) && 1107 if (!task_running(rq, p) &&
1105 (p->prio >= rq->rt.highest_prio) && 1108 !test_tsk_need_resched(rq->curr) &&
1106 rq->rt.overloaded) 1109 rq->rt.overloaded)
1107 push_rt_tasks(rq); 1110 push_rt_tasks(rq);
1108} 1111}