Skip to contentSkip to conversation

arm: lazy preempt: correct resched condition

PATCH New Sebastian Andrzej Siewior 1 participant 1 message May 24, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: lazy preempt: correct resched condition

If we get out of preempt_schedule_irq() then we check for NEED_RESCHED and call the former function again if set because the preemption counter has be zero at this point.
However the counter for lazy-preempt might not be zero therefore we have to check the counter before looking at the need_resched_lazy flag.

---
 arch/arm/kernel/entry-armv.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/kernel/entry-armv.S +5 -1
index d66b1aef2083..d044cea59f54 100644
@@ -244,7 +244,11 @@ ENDPROC(__irq_svc)
 	bne	1b
 	tst	r0, #_TIF_NEED_RESCHED_LAZY
 	reteq	r8				@ go again
-	b	1b
+	ldr	r0, [tsk, #TI_PREEMPT_LAZY]	@ get preempt lazy count
+	teq	r0, #0				@ if preempt lazy count != 0
+	beq	1b
+	ret	r8				@ go again
+
 #endif
 
 __und_fault:
Signature · 1 line
2.8.1