aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-12 13:14:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-12 13:14:22 -0400
commit9404ef02974a5411687b6c1b8ef3984305620e02 (patch)
tree9ffc2c51a06ad36d5c2c58b50c590e2ac8dceac0 /include/linux/sched.h
parent2b753a1599a28612851a2908abdbf86802c989c5 (diff)
Fix up 'need_resched()' definition
We should not go through the task pointer to get at the thread info, since it's usually cheaper to just access the thread info directly. So don't make the code look up 'current', when we can just use the thread info accessor functions directly. This generally avoids one level of indirection and tends to work better together with code that also looks at other thread flags (eg preempt_count). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4ab9f32f9238..5a63f2d72af6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2027,7 +2027,7 @@ static inline int fatal_signal_pending(struct task_struct *p)
2027 2027
2028static inline int need_resched(void) 2028static inline int need_resched(void)
2029{ 2029{
2030 return unlikely(test_tsk_need_resched(current)); 2030 return unlikely(test_thread_flag(TIF_NEED_RESCHED));
2031} 2031}
2032 2032
2033/* 2033/*