aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGregory Haskins <ghaskins@novell.com>2008-04-23 07:13:29 -0400
committerIngo Molnar <mingo@elte.hu>2008-05-05 17:56:18 -0400
commit8ae121ac8666b0421aa20fd80d4597ec66fa54bc (patch)
tree1db411965b1b12029d501ea10ab90fbc8aa4ec62 /include
parent983ed7a66bcec9dc307d89dc7af47cdf209e56af (diff)
sched: fix RT task-wakeup logic
Dmitry Adamushko pointed out a logic error in task_wake_up_rt() where we will always evaluate to "true". You can find the thread here: http://lkml.org/lkml/2008/4/22/296 In reality, we only want to try to push tasks away when a wake up request is not going to preempt the current task. So lets fix it. Note: We introduce test_tsk_need_resched() instead of open-coding the flag check so that the merge-conflict with -rt should help remind us that we may need to support NEEDS_RESCHED_DELAYED in the future, too. Signed-off-by: Gregory Haskins <ghaskins@novell.com> CC: Dmitry Adamushko <dmitry.adamushko@gmail.com> CC: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h7
1 files changed, 6 insertions, 1 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/*