diff mbox series

[12/14] sparc64: rtrap: Remove unneeded need_resched() loop

Message ID 20190311224752.8337-13-valentin.schneider@arm.com
State Not Applicable
Delegated to: David Miller
Headers show
Series entry: preempt_schedule_irq() callers scrub | expand

Commit Message

Valentin Schneider March 11, 2019, 10:47 p.m. UTC
Since the enabling and disabling of IRQs within preempt_schedule_irq()
is contained in a need_resched() loop, we don't need the outer arch
code loop.

We seem to be looping back somewhere much higher than the usual
preempt/need_resched checks, but AFAICT we would just branch to
'rtrap_no_irq_enable' and then back to 'to_kernel', which is
a need_resched() loop with a few extra steps.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/kernel/rtrap_64.S | 1 -
 1 file changed, 1 deletion(-)

Comments

David Miller March 11, 2019, 11:13 p.m. UTC | #1
From: Valentin Schneider <valentin.schneider@arm.com>
Date: Mon, 11 Mar 2019 22:47:50 +0000

> Since the enabling and disabling of IRQs within preempt_schedule_irq()
> is contained in a need_resched() loop, we don't need the outer arch
> code loop.
> 
> We seem to be looping back somewhere much higher than the usual
> preempt/need_resched checks, but AFAICT we would just branch to
> 'rtrap_no_irq_enable' and then back to 'to_kernel', which is
> a need_resched() loop with a few extra steps.
> 
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> ---
>  arch/sparc/kernel/rtrap_64.S | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
> index 29aa34f11720..57fb75686957 100644
> --- a/arch/sparc/kernel/rtrap_64.S
> +++ b/arch/sparc/kernel/rtrap_64.S
> @@ -322,7 +322,6 @@ to_kernel:
>  		 nop
>  		call			preempt_schedule_irq
>  		 nop
> -		ba,pt			%xcc, rtrap
>  #endif
>  kern_fpucheck:	ldub			[%g6 + TI_FPDEPTH], %l5
>  		brz,pt			%l5, rt_continue
> -- 
> 2.20.1
> 

We must re-evaluate the %tstate value stored in ptregs, you cannot
make this change.
Valentin Schneider March 12, 2019, 9:43 a.m. UTC | #2
Hi,

On 11/03/2019 23:13, David Miller wrote:
[...]
> 
> We must re-evaluate the %tstate value stored in ptregs, you cannot
> make this change.
> 

That's the one I was the less sure about, thanks for clearing it up and
sorry for the noise.
diff mbox series

Patch

diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
index 29aa34f11720..57fb75686957 100644
--- a/arch/sparc/kernel/rtrap_64.S
+++ b/arch/sparc/kernel/rtrap_64.S
@@ -322,7 +322,6 @@  to_kernel:
 		 nop
 		call			preempt_schedule_irq
 		 nop
-		ba,pt			%xcc, rtrap
 #endif
 kern_fpucheck:	ldub			[%g6 + TI_FPDEPTH], %l5
 		brz,pt			%l5, rt_continue