[PATCH] PPC64 Call preempt_schedule on exception exit

Paul Mackerras paulus at samba.org
Thu Jan 13 21:41:36 EST 2005


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: Paul Mackerras <paulus at samba.org>

diff -urN linux-2.5/arch/ppc64/kernel/entry.S test/arch/ppc64/kernel/entry.S
--- linux-2.5/arch/ppc64/kernel/entry.S	2005-01-10 07:54:27.000000000 +1100
+++ test/arch/ppc64/kernel/entry.S	2005-01-13 20:48:36.000000000 +1100
@@ -574,25 +574,22 @@
 	crandc	eq,cr1*4+eq,eq
 	bne	restore
 	/* here we are preempting the current task */
-1:	lis	r0,PREEMPT_ACTIVE at 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:



More information about the Linuxppc64-dev mailing list