Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32941
b: refs/heads/master
c: 2d7d253
h: refs/heads/master
i:
  32939: b334eb1
v: v3
  • Loading branch information
Jim Houston authored and Linus Torvalds committed Jul 31, 2006
1 parent d27f808 commit fccd03c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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: 6ea24f9ad18c65cc179593b5cc2a88cdadf8cc0c
refs/heads/master: 2d7d253548cffdce80f4e03664686e9ccb1b0ed7
10 changes: 5 additions & 5 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4456,9 +4456,9 @@ asmlinkage long sys_sched_yield(void)
return 0;
}

static inline int __resched_legal(void)
static inline int __resched_legal(int expected_preempt_count)
{
if (unlikely(preempt_count()))
if (unlikely(preempt_count() != expected_preempt_count))
return 0;
if (unlikely(system_state != SYSTEM_RUNNING))
return 0;
Expand All @@ -4484,7 +4484,7 @@ static void __cond_resched(void)

int __sched cond_resched(void)
{
if (need_resched() && __resched_legal()) {
if (need_resched() && __resched_legal(0)) {
__cond_resched();
return 1;
}
Expand All @@ -4510,7 +4510,7 @@ int cond_resched_lock(spinlock_t *lock)
ret = 1;
spin_lock(lock);
}
if (need_resched() && __resched_legal()) {
if (need_resched() && __resched_legal(1)) {
spin_release(&lock->dep_map, 1, _THIS_IP_);
_raw_spin_unlock(lock);
preempt_enable_no_resched();
Expand All @@ -4526,7 +4526,7 @@ int __sched cond_resched_softirq(void)
{
BUG_ON(!in_softirq());

if (need_resched() && __resched_legal()) {
if (need_resched() && __resched_legal(0)) {
raw_local_irq_disable();
_local_bh_enable();
raw_local_irq_enable();
Expand Down

0 comments on commit fccd03c

Please sign in to comment.