Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145708
b: refs/heads/master
c: ff74334
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 20, 2009
1 parent 5a378f0 commit a0b1d85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 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: 13318a7186d8e0ae08c996ea4111a945e7789772
refs/heads/master: ff743345bf7685a207868048a70e23164c4785e5
4 changes: 3 additions & 1 deletion trunk/kernel/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,

/* didnt get the lock, go to sleep: */
spin_unlock_mutex(&lock->wait_lock, flags);
__schedule();
preempt_enable_no_resched();
schedule();
preempt_disable();
spin_lock_mutex(&lock->wait_lock, flags);
}

Expand Down
12 changes: 4 additions & 8 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -5131,13 +5131,15 @@ pick_next_task(struct rq *rq)
/*
* schedule() is the main scheduler function.
*/
asmlinkage void __sched __schedule(void)
asmlinkage void __sched schedule(void)
{
struct task_struct *prev, *next;
unsigned long *switch_count;
struct rq *rq;
int cpu;

need_resched:
preempt_disable();
cpu = smp_processor_id();
rq = cpu_rq(cpu);
rcu_qsctr_inc(cpu);
Expand Down Expand Up @@ -5194,15 +5196,9 @@ asmlinkage void __sched __schedule(void)

if (unlikely(reacquire_kernel_lock(current) < 0))
goto need_resched_nonpreemptible;
}

asmlinkage void __sched schedule(void)
{
need_resched:
preempt_disable();
__schedule();
preempt_enable_no_resched();
if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
if (need_resched())
goto need_resched;
}
EXPORT_SYMBOL(schedule);
Expand Down

0 comments on commit a0b1d85

Please sign in to comment.