From 4492bf66237c6352d713c3722b0e83a4d258906e Mon Sep 17 00:00:00 2001 From: William Lee Irwin III Date: Mon, 18 Oct 2004 18:11:56 -0700 Subject: [PATCH] [PATCH] make console_conditional_schedule() __sched and use cond_resched() 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 Signed-off-by: Linus Torvalds --- kernel/printk.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/printk.c b/kernel/printk.c index c02ec626f3840..390396fc6d017 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -661,12 +661,10 @@ EXPORT_SYMBOL(release_console_sem); * * 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); -- 2.53.0