*
* WARNING: must be called with preemption disabled!
*/
-static void __sched __schedule(void)
+static void __sched __schedule(bool preempt)
{
struct task_struct *prev, *next;
unsigned long *switch_count;
rq->clock_skip_update <<= 1; /* promote REQ to ACT */
switch_count = &prev->nivcsw;
- if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
+ if (!preempt && prev->state) {
if (unlikely(signal_pending_state(prev->state, prev))) {
prev->state = TASK_RUNNING;
} else {
sched_submit_work(tsk);
do {
preempt_disable();
- __schedule();
+ __schedule(false);
sched_preempt_enable_no_resched();
} while (need_resched());
}
{
do {
preempt_active_enter();
- __schedule();
+ __schedule(true);
preempt_active_exit();
/*
* an infinite recursion.
*/
prev_ctx = exception_enter();
- __schedule();
+ __schedule(true);
exception_exit(prev_ctx);
barrier();
do {
preempt_active_enter();
local_irq_enable();
- __schedule();
+ __schedule(true);
local_irq_disable();
preempt_active_exit();
} while (need_resched());