From: Linus Torvalds Date: Mon, 12 May 2008 17:14:22 +0000 (-0700) Subject: Fix up 'need_resched()' definition X-Git-Tag: v2.6.26-rc3~129 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9404ef02974a5411687b6c1b8ef3984305620e02;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/include/linux/sched.h b/include/linux/sched.h index 4ab9f32f923..5a63f2d72af 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) static inline int need_resched(void) { - return unlikely(test_tsk_need_resched(current)); + return unlikely(test_thread_flag(TIF_NEED_RESCHED)); } /*