* [PATCH RESEND 1/7] sched/core: Fix preempt_schedule() interrupt return comment
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
2019-05-28 10:58 ` Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 2/7] csky: entry: Remove unneeded need_resched() loop Valentin Schneider
` (5 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel
preempt_schedule_irq() is the one that should be called on return from
interrupt, clean up the comment to avoid any ambiguity.
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
---
kernel/sched/core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 874c427742a9..55ebc2cfb08c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3600,9 +3600,8 @@ static void __sched notrace preempt_schedule_common(void)
#ifdef CONFIG_PREEMPT
/*
- * this is the entry point to schedule() from in-kernel preemption
- * off of preempt_enable. Kernel preemptions off return from interrupt
- * occur there and call schedule directly.
+ * This is the entry point to schedule() from in-kernel preemption
+ * off of preempt_enable.
*/
asmlinkage __visible void __sched notrace preempt_schedule(void)
{
@@ -3673,7 +3672,7 @@ EXPORT_SYMBOL_GPL(preempt_schedule_notrace);
#endif /* CONFIG_PREEMPT */
/*
- * this is the entry point to schedule() from kernel preemption
+ * This is the entry point to schedule() from kernel preemption
* off of irq context.
* Note, that this is called and return with irqs disabled. This will
* protect us against recursive calling from irq.
--
2.20.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH RESEND 1/7] sched/core: Fix preempt_schedule() interrupt return comment
2019-05-28 10:48 ` [PATCH RESEND 1/7] sched/core: Fix preempt_schedule() interrupt return comment Valentin Schneider
@ 2019-05-28 10:58 ` Valentin Schneider
2019-06-11 19:30 ` Thomas Gleixner
0 siblings, 1 reply; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Peter Zijlstra, Thomas Gleixner
Duh, forgot to cc the relevant folks on this one...
On 28/05/2019 11:48, Valentin Schneider wrote:
> preempt_schedule_irq() is the one that should be called on return from
> interrupt, clean up the comment to avoid any ambiguity.
>
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> ---
> kernel/sched/core.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 874c427742a9..55ebc2cfb08c 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3600,9 +3600,8 @@ static void __sched notrace preempt_schedule_common(void)
>
> #ifdef CONFIG_PREEMPT
> /*
> - * this is the entry point to schedule() from in-kernel preemption
> - * off of preempt_enable. Kernel preemptions off return from interrupt
> - * occur there and call schedule directly.
> + * This is the entry point to schedule() from in-kernel preemption
> + * off of preempt_enable.
> */
> asmlinkage __visible void __sched notrace preempt_schedule(void)
> {
> @@ -3673,7 +3672,7 @@ EXPORT_SYMBOL_GPL(preempt_schedule_notrace);
> #endif /* CONFIG_PREEMPT */
>
> /*
> - * this is the entry point to schedule() from kernel preemption
> + * This is the entry point to schedule() from kernel preemption
> * off of irq context.
> * Note, that this is called and return with irqs disabled. This will
> * protect us against recursive calling from irq.
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RESEND 1/7] sched/core: Fix preempt_schedule() interrupt return comment
2019-05-28 10:58 ` Valentin Schneider
@ 2019-06-11 19:30 ` Thomas Gleixner
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Gleixner @ 2019-06-11 19:30 UTC (permalink / raw)
To: Valentin Schneider; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra
On Tue, 28 May 2019, Valentin Schneider wrote:
> Duh, forgot to cc the relevant folks on this one...
Nevertheless:
Acked-by: Thomas Gleixner <tglx@linutronix.de>
> On 28/05/2019 11:48, Valentin Schneider wrote:
> > preempt_schedule_irq() is the one that should be called on return from
> > interrupt, clean up the comment to avoid any ambiguity.
> >
> > Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> > ---
> > kernel/sched/core.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 874c427742a9..55ebc2cfb08c 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -3600,9 +3600,8 @@ static void __sched notrace preempt_schedule_common(void)
> >
> > #ifdef CONFIG_PREEMPT
> > /*
> > - * this is the entry point to schedule() from in-kernel preemption
> > - * off of preempt_enable. Kernel preemptions off return from interrupt
> > - * occur there and call schedule directly.
> > + * This is the entry point to schedule() from in-kernel preemption
> > + * off of preempt_enable.
> > */
> > asmlinkage __visible void __sched notrace preempt_schedule(void)
> > {
> > @@ -3673,7 +3672,7 @@ EXPORT_SYMBOL_GPL(preempt_schedule_notrace);
> > #endif /* CONFIG_PREEMPT */
> >
> > /*
> > - * this is the entry point to schedule() from kernel preemption
> > + * This is the entry point to schedule() from kernel preemption
> > * off of irq context.
> > * Note, that this is called and return with irqs disabled. This will
> > * protect us against recursive calling from irq.
> >
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH RESEND 2/7] csky: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 1/7] sched/core: Fix preempt_schedule() interrupt return comment Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
2019-05-29 1:48 ` Guo Ren
2019-05-28 10:48 ` [PATCH RESEND 3/7] h8300: " Valentin Schneider
` (4 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Guo Ren
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 <valentin.schneider@arm.com>
Cc: Guo Ren <guoren@kernel.org>
---
arch/csky/kernel/entry.S | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S
index a7e84ccccbd8..679afbcc2001 100644
--- a/arch/csky/kernel/entry.S
+++ b/arch/csky/kernel/entry.S
@@ -292,11 +292,7 @@ ENTRY(csky_irq)
ldw r8, (r9, TINFO_FLAGS)
btsti r8, TIF_NEED_RESCHED
bf 2f
-1:
jbsr preempt_schedule_irq /* irq en/disable is done inside */
- ldw r7, (r9, TINFO_FLAGS) /* get new tasks TI_FLAGS */
- btsti r7, TIF_NEED_RESCHED
- bt 1b /* go again */
#endif
2:
jmpi ret_from_exception
--
2.20.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH RESEND 2/7] csky: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 ` [PATCH RESEND 2/7] csky: entry: Remove unneeded need_resched() loop Valentin Schneider
@ 2019-05-29 1:48 ` Guo Ren
0 siblings, 0 replies; 13+ messages in thread
From: Guo Ren @ 2019-05-29 1:48 UTC (permalink / raw)
To: Valentin Schneider; +Cc: linux-kernel
Thx Valentin,
You are right, Approved.
Best Regards
Guo Ren
On Tue, May 28, 2019 at 11:48:43AM +0100, Valentin Schneider 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 <valentin.schneider@arm.com>
> Cc: Guo Ren <guoren@kernel.org>
> ---
> arch/csky/kernel/entry.S | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S
> index a7e84ccccbd8..679afbcc2001 100644
> --- a/arch/csky/kernel/entry.S
> +++ b/arch/csky/kernel/entry.S
> @@ -292,11 +292,7 @@ ENTRY(csky_irq)
> ldw r8, (r9, TINFO_FLAGS)
> btsti r8, TIF_NEED_RESCHED
> bf 2f
> -1:
> jbsr preempt_schedule_irq /* irq en/disable is done inside */
> - ldw r7, (r9, TINFO_FLAGS) /* get new tasks TI_FLAGS */
> - btsti r7, TIF_NEED_RESCHED
> - bt 1b /* go again */
> #endif
> 2:
> jmpi ret_from_exception
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH RESEND 3/7] h8300: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 1/7] sched/core: Fix preempt_schedule() interrupt return comment Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 2/7] csky: entry: Remove unneeded need_resched() loop Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 4/7] microblaze: " Valentin Schneider
` (3 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Yoshinori Sato, uclinux-h8-devel
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 <valentin.schneider@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: uclinux-h8-devel@lists.sourceforge.jp
---
arch/h8300/kernel/entry.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/h8300/kernel/entry.S b/arch/h8300/kernel/entry.S
index 4ade5f8299ba..6bde028e7d4a 100644
--- a/arch/h8300/kernel/entry.S
+++ b/arch/h8300/kernel/entry.S
@@ -323,7 +323,6 @@ restore_all:
resume_kernel:
mov.l @(TI_PRE_COUNT:16,er4),er0
bne restore_all:8
-need_resched:
mov.l @(TI_FLAGS:16,er4),er0
btst #TIF_NEED_RESCHED,r0l
beq restore_all:8
@@ -332,7 +331,7 @@ need_resched:
mov.l sp,er0
jsr @set_esp0
jsr @preempt_schedule_irq
- bra need_resched:8
+ bra restore_all:8
#endif
ret_from_fork:
--
2.20.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH RESEND 4/7] microblaze: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
` (2 preceding siblings ...)
2019-05-28 10:48 ` [PATCH RESEND 3/7] h8300: " Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 5/7] RISC-V: " Valentin Schneider
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Michal Simek
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 <valentin.schneider@arm.com>
Cc: Michal Simek <monstr@monstr.eu>
---
arch/microblaze/kernel/entry.S | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
index 4e1b567becd6..de7083bd1d24 100644
--- a/arch/microblaze/kernel/entry.S
+++ b/arch/microblaze/kernel/entry.S
@@ -738,14 +738,9 @@ no_intr_resched:
andi r5, r5, _TIF_NEED_RESCHED;
beqi r5, restore /* if zero jump over */
-preempt:
/* interrupts are off that's why I am calling preempt_chedule_irq */
bralid r15, preempt_schedule_irq
nop
- lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */
- lwi r5, r11, TI_FLAGS; /* get flags in thread info */
- andi r5, r5, _TIF_NEED_RESCHED;
- bnei r5, preempt /* if non zero jump to resched */
restore:
#endif
VM_OFF /* MS: turn off MMU */
--
2.20.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
` (3 preceding siblings ...)
2019-05-28 10:48 ` [PATCH RESEND 4/7] microblaze: " Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
2019-05-30 4:09 ` Palmer Dabbelt
2019-05-28 10:48 ` [PATCH RESEND 6/7] sh: " Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 7/7] sh64: " Valentin Schneider
6 siblings, 1 reply; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Palmer Dabbelt, Albert Ou, linux-riscv
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 <valentin.schneider@arm.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
---
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 ` [PATCH RESEND 5/7] RISC-V: " Valentin Schneider
@ 2019-05-30 4:09 ` Palmer Dabbelt
2019-05-30 16:37 ` Valentin Schneider
0 siblings, 1 reply; 13+ messages in thread
From: Palmer Dabbelt @ 2019-05-30 4:09 UTC (permalink / raw)
To: valentin.schneider; +Cc: linux-kernel, aou, linux-riscv
On Tue, 28 May 2019 03:48:46 PDT (-0700), valentin.schneider@arm.com 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 <valentin.schneider@arm.com>
> Cc: Palmer Dabbelt <palmer@sifive.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: linux-riscv@lists.infradead.org
> ---
> 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 <palmer@sifive.com>
Do you want this through the RISC-V tree, or are you going to take it?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RESEND 5/7] RISC-V: entry: Remove unneeded need_resched() loop
2019-05-30 4:09 ` Palmer Dabbelt
@ 2019-05-30 16:37 ` Valentin Schneider
0 siblings, 0 replies; 13+ messages in thread
From: Valentin Schneider @ 2019-05-30 16:37 UTC (permalink / raw)
To: Palmer Dabbelt; +Cc: linux-kernel, aou, linux-riscv
On 30/05/2019 05:09, Palmer Dabbelt wrote:
[...]
>
> Sorry I missed this the first time around.
>
> Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
>
> 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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH RESEND 6/7] sh: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
` (4 preceding siblings ...)
2019-05-28 10:48 ` [PATCH RESEND 5/7] RISC-V: " Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
2019-05-28 10:48 ` [PATCH RESEND 7/7] sh64: " Valentin Schneider
6 siblings, 0 replies; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Yoshinori Sato, Rich Felker, linux-sh
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 <valentin.schneider@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
---
arch/sh/kernel/entry-common.S | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index d31f66e82ce5..65a105de52a0 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -93,7 +93,7 @@ ENTRY(resume_kernel)
mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count
tst r0, r0
bf noresched
-need_resched:
+
mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags
tst #_TIF_NEED_RESCHED, r0 ! need_resched set?
bt noresched
@@ -107,8 +107,6 @@ need_resched:
mov.l 1f, r0
jsr @r0 ! call preempt_schedule_irq
nop
- bra need_resched
- nop
noresched:
bra __restore_all
--
2.20.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH RESEND 7/7] sh64: entry: Remove unneeded need_resched() loop
2019-05-28 10:48 [PATCH RESEND 0/7] entry: preempt_schedule_irq() callers scrub Valentin Schneider
` (5 preceding siblings ...)
2019-05-28 10:48 ` [PATCH RESEND 6/7] sh: " Valentin Schneider
@ 2019-05-28 10:48 ` Valentin Schneider
6 siblings, 0 replies; 13+ messages in thread
From: Valentin Schneider @ 2019-05-28 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Yoshinori Sato, Rich Felker, linux-sh
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 <valentin.schneider@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
---
arch/sh/kernel/cpu/sh5/entry.S | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index de68ffdfffbf..40e6d9a7a6a2 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -897,7 +897,6 @@ resume_kernel:
ld.l r6, TI_PRE_COUNT, r7
beq/u r7, ZERO, tr0
-need_resched:
ld.l r6, TI_FLAGS, r7
movi (1 << TIF_NEED_RESCHED), r8
and r8, r7, r8
@@ -911,9 +910,7 @@ need_resched:
ori r7, 1, r7
ptabs r7, tr1
blink tr1, LINK
-
- pta need_resched, tr1
- blink tr1, ZERO
+ blink tr0, ZERO
#endif
.global ret_from_syscall
--
2.20.1
^ permalink raw reply related [flat|nested] 13+ messages in thread