linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/32bit,PREEMPT:Load TI_FLAGS to check NEED_RESCHED
@ 2013-05-27  6:27 Priyanka Jain
  2013-05-27  6:45 ` [PATCH] powerpc/32bit, PREEMPT:Load " tiejun.chen
  2013-05-27  7:12 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 6+ messages in thread
From: Priyanka Jain @ 2013-05-27  6:27 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: scottwood, Priyanka Jain

Add instruction to load TI_FLAGS in r8
    
While returning from exception handling in case of PREEMPT enabled,
_TIF_NEED_RESCHED bit is checked in TI_FLAGS (thread_info flag) of current
task. Only if this bit is set, it should continue with the process of
calling preempt_schedule_irq() to schedule highest priority task if
available.
    
Current code assumes that r8 contains TI_FLAGS and check this for
_TIF_NEED_RESCHED, but as r8 is modified in the code which executes before
this check, r8 no longer contains the expected TI_FLAGS information.
    
As a result check for comparison with _TIF_NEED_RESCHED was failing even if
NEED_RESCHED bit is set in the current thread_info flag. Due to this,
preempt_schedule_irq() and in turn scheduler was not getting called even if
highest priority task is ready for execution.
    

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
---
 arch/powerpc/kernel/entry_32.S |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index d22e73e..0239c7f 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -887,6 +887,7 @@ resume_kernel:
 #ifdef CONFIG_PREEMPT
 	/* check current_thread_info->preempt_count */
 	lwz	r0,TI_PREEMPT(r9)
+	lwz	r8,TI_FLAGS(r9)
 	cmpwi	0,r0,0		/* if non-zero, just restore regs and return */
 	bne	restore
 	andi.	r8,r8,_TIF_NEED_RESCHED
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-27  7:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-27  6:27 [PATCH] powerpc/32bit,PREEMPT:Load TI_FLAGS to check NEED_RESCHED Priyanka Jain
2013-05-27  6:45 ` [PATCH] powerpc/32bit, PREEMPT:Load " tiejun.chen
2013-05-27  6:55   ` [PATCH] powerpc/32bit,PREEMPT:Load " Jain Priyanka-B32167
2013-05-27  7:18     ` [PATCH] powerpc/32bit, PREEMPT:Load " tiejun.chen
2013-05-27  7:21       ` [PATCH] powerpc/32bit,PREEMPT:Load " Jain Priyanka-B32167
2013-05-27  7:12 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).