From b2bd3a26bbf30c69062d45de4622e7e5b412ad16 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 4 Jul 2002 08:30:54 -0700 Subject: [PATCH] set TASK_RUNNING in cond_resched() do_select() does set_current_state(TASK_INTERRUPTIBLE) then calls __pollwait() which calls __get_free_page() and the cond_resched() which I added to the pagecache reclaim code never returns. The patch makes cond_resched() more useful by setting current->state to TASK_RUNNING before scheduling. --- include/linux/sched.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/sched.h b/include/linux/sched.h index 90fb402ee802..9b5af2cc11d2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -837,10 +837,11 @@ static inline int need_resched(void) return unlikely(test_thread_flag(TIF_NEED_RESCHED)); } +extern void __cond_resched(void); static inline void cond_resched(void) { if (need_resched()) - schedule(); + __cond_resched(); } /* Reevaluate whether the task has signals pending delivery. -- cgit v1.2.3