2019-05-28 10:52:17

by Valentin Schneider

[permalink] [raw]
Subject: [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop

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.

Signed-off-by: Valentin Schneider <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Albert Ou <[email protected]>
Cc: [email protected]
---
arch/riscv/kernel/entry.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index 1c1ecc238cfa..d0b1b9660283 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -258,12 +258,11 @@ restore_all:
resume_kernel:
REG_L s0, TASK_TI_PREEMPT_COUNT(tp)
bnez s0, restore_all
-need_resched:
REG_L s0, TASK_TI_FLAGS(tp)
andi s0, s0, _TIF_NEED_RESCHED
beqz s0, restore_all
call preempt_schedule_irq
- j need_resched
+ j restore_all
#endif

work_pending:
--
2.20.1


2019-05-30 04:12:05

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop

On Tue, 28 May 2019 03:48:46 PDT (-0700), [email protected] wrote:
> 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.
>
> Signed-off-by: Valentin Schneider <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: Albert Ou <[email protected]>
> Cc: [email protected]
> ---
> arch/riscv/kernel/entry.S | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
> index 1c1ecc238cfa..d0b1b9660283 100644
> --- a/arch/riscv/kernel/entry.S
> +++ b/arch/riscv/kernel/entry.S
> @@ -258,12 +258,11 @@ restore_all:
> resume_kernel:
> REG_L s0, TASK_TI_PREEMPT_COUNT(tp)
> bnez s0, restore_all
> -need_resched:
> REG_L s0, TASK_TI_FLAGS(tp)
> andi s0, s0, _TIF_NEED_RESCHED
> beqz s0, restore_all
> call preempt_schedule_irq
> - j need_resched
> + j restore_all
> #endif
>
> work_pending:

Sorry I missed this the first time around.

Reviewed-by: Palmer Dabbelt <[email protected]>

Do you want this through the RISC-V tree, or are you going to take it?

2019-05-30 16:54:32

by Valentin Schneider

[permalink] [raw]
Subject: Re: [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop

On 30/05/2019 05:09, Palmer Dabbelt wrote:
[...]
>
> Sorry I missed this the first time around.
>
> Reviewed-by: Palmer Dabbelt <[email protected]>
>
> Do you want this through the RISC-V tree, or are you going to take it?

Thanks! It's a standalone change so this would be fine through your tree.