Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135702
b: refs/heads/master
c: 5ed0cec
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Ingo Molnar committed Mar 6, 2009
1 parent 5cd63fc commit 518db7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fc07d84108d54c5b94625c0e168f31b2d66976e
refs/heads/master: 5ed0cec0ac5f1b3759bdbe4d9df32ee4ff8afb5a
10 changes: 5 additions & 5 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,10 +1189,10 @@ static void resched_task(struct task_struct *p)

assert_spin_locked(&task_rq(p)->lock);

if (unlikely(test_tsk_thread_flag(p, TIF_NEED_RESCHED)))
if (test_tsk_need_resched(p))
return;

set_tsk_thread_flag(p, TIF_NEED_RESCHED);
set_tsk_need_resched(p);

cpu = task_cpu(p);
if (cpu == smp_processor_id())
Expand Down Expand Up @@ -1248,7 +1248,7 @@ void wake_up_idle_cpu(int cpu)
* lockless. The worst case is that the other CPU runs the
* idle task through an additional NOOP schedule()
*/
set_tsk_thread_flag(rq->idle, TIF_NEED_RESCHED);
set_tsk_need_resched(rq->idle);

/* NEED_RESCHED must be visible before we test polling */
smp_mb();
Expand Down Expand Up @@ -4740,7 +4740,7 @@ asmlinkage void __sched preempt_schedule(void)
* between schedule and now.
*/
barrier();
} while (unlikely(test_thread_flag(TIF_NEED_RESCHED)));
} while (need_resched());
}
EXPORT_SYMBOL(preempt_schedule);

Expand Down Expand Up @@ -4769,7 +4769,7 @@ asmlinkage void __sched preempt_schedule_irq(void)
* between schedule and now.
*/
barrier();
} while (unlikely(test_thread_flag(TIF_NEED_RESCHED)));
} while (need_resched());
}

#endif /* CONFIG_PREEMPT */
Expand Down
2 changes: 1 addition & 1 deletion trunk/lib/kernel_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static __cacheline_aligned_in_smp DEFINE_SPINLOCK(kernel_flag);
int __lockfunc __reacquire_kernel_lock(void)
{
while (!_raw_spin_trylock(&kernel_flag)) {
if (test_thread_flag(TIF_NEED_RESCHED))
if (need_resched())
return -EAGAIN;
cpu_relax();
}
Expand Down

0 comments on commit 518db7d

Please sign in to comment.