Relatively minor add-on (not necessarily tied to it or required to be taken
or a fix for any bug). Since cond_resched() is using PREEMPT_ACTIVE now,
it may be useful to update the open-coded instance of cond_resched() to use
the generic call. Also, it should probably be __sched so the caller shows
up in wchan.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
*
* Must be called within acquire_console_sem().
*/
-void console_conditional_schedule(void)
+void __sched console_conditional_schedule(void)
{
- if (console_may_schedule && need_resched()) {
- set_current_state(TASK_RUNNING);
- schedule();
- }
+ if (console_may_schedule)
+ cond_resched();
}
EXPORT_SYMBOL(console_conditional_schedule);