Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205418
b: refs/heads/master
c: 246d86b
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jun 9, 2010
1 parent e7511ac commit 2b0acfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: c676329abb2b8359d9a5d734dec0c81779823fd6
refs/heads/master: 246d86b51845063e4b06b27579990492dc5fa317
13 changes: 6 additions & 7 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3636,7 +3636,6 @@ asmlinkage void __sched schedule(void)
rq = cpu_rq(cpu);
rcu_note_context_switch(cpu);
prev = rq->curr;
switch_count = &prev->nivcsw;

release_kernel_lock(prev);
need_resched_nonpreemptible:
Expand All @@ -3649,6 +3648,7 @@ asmlinkage void __sched schedule(void)
raw_spin_lock_irq(&rq->lock);
clear_tsk_need_resched(prev);

switch_count = &prev->nivcsw;
if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
if (unlikely(signal_pending_state(prev->state, prev))) {
prev->state = TASK_RUNNING;
Expand Down Expand Up @@ -3689,8 +3689,10 @@ asmlinkage void __sched schedule(void)

context_switch(rq, prev, next); /* unlocks the rq */
/*
* the context switch might have flipped the stack from under
* us, hence refresh the local variables.
* The context switch have flipped the stack from under us
* and restored the local variables which were saved when
* this task called schedule() in the past. prev == current
* is still correct, but it can be moved to another cpu/rq.
*/
cpu = smp_processor_id();
rq = cpu_rq(cpu);
Expand All @@ -3699,11 +3701,8 @@ asmlinkage void __sched schedule(void)

post_schedule(rq);

if (unlikely(reacquire_kernel_lock(current) < 0)) {
prev = rq->curr;
switch_count = &prev->nivcsw;
if (unlikely(reacquire_kernel_lock(prev)))
goto need_resched_nonpreemptible;
}

preempt_enable_no_resched();
if (need_resched())
Expand Down

0 comments on commit 2b0acfe

Please sign in to comment.