Skip to content

Commit

Permalink
Fix up 'need_resched()' definition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds committed May 12, 2008
1 parent 2b753a1 commit 9404ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/*
Expand Down

0 comments on commit 9404ef0

Please sign in to comment.