提交 9404ef02 编写于 作者: L Linus Torvalds

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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2b753a15
......@@ -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));
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册