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.
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.
#endif
EXPORT_SYMBOL(schedule_timeout);
EXPORT_SYMBOL(sys_sched_yield);
+EXPORT_SYMBOL(__cond_resched);
EXPORT_SYMBOL(set_user_nice);
EXPORT_SYMBOL(task_nice);
EXPORT_SYMBOL_GPL(idle_cpu);
return 0;
}
+void __cond_resched(void)
+{
+ set_current_state(TASK_RUNNING);
+ schedule();
+}
+
asmlinkage long sys_sched_get_priority_max(int policy)
{
int ret = -EINVAL;