Commit f4d0d3c5 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] PPC64 Call preempt_schedule on exception exit

This patch mirrors the recent changes on x86 to call preempt_schedule
rather than schedule in the exception exit path, in the case where the
preempt_count is zero and the TIF_NEED_RESCHED bit is set.

I'm a little concerned that this means that we have a window where
interrupts are enabled and we are on our way into preempt_schedule,
but preempt_count is still zero.  Ingo's proposed preempt_schedule_irq
would fix this, and I think something like that should go in.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ec72859c
......@@ -574,25 +574,22 @@ do_work:
crandc eq,cr1*4+eq,eq
bne restore
/* here we are preempting the current task */
1: lis r0,PREEMPT_ACTIVE@h
stw r0,TI_PREEMPT(r9)
1:
#ifdef CONFIG_PPC_ISERIES
li r0,1
stb r0,PACAPROCENABLED(r13)
#endif
ori r10,r10,MSR_EE
mtmsrd r10,1 /* reenable interrupts */
bl .schedule
bl .preempt_schedule
mfmsr r10
clrrdi r9,r1,THREAD_SHIFT
rldicl r10,r10,48,1 /* disable interrupts again */
li r0,0
rotldi r10,r10,16
mtmsrd r10,1
ld r4,TI_FLAGS(r9)
andi. r0,r4,_TIF_NEED_RESCHED
bne 1b
stw r0,TI_PREEMPT(r9)
b restore
user_work:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment