* [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
@ 2024-12-26 19:12 Robert Joslyn
2025-01-07 11:56 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 9+ messages in thread
From: Robert Joslyn @ 2024-12-26 19:12 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-rt-users, bigeasy, tglx, rostedt, Robert Joslyn
This branch is needed to allow preemptible IRQs to be scheduled,
otherwise the kernel hangs during boot on my e300 based platforms.
This branch is needed for both CONFIG_PREEMPT and CONFIG_PREEMPT_RT,
so broaden the check to CONFIG_PREEMPTION, which is selected by both.
This was previously set to CONFIG_PREEMPTION, but was reverted as part
of removing LAZY_PREEMPT support.
Fixes: b33022a48c79
Signed-off-by: Robert Joslyn <robert_joslyn@selinc.com>
---
arch/powerpc/kernel/interrupt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index af62ec974b97..970039af8e92 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -396,7 +396,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
/* Returning to a kernel context with local irqs enabled. */
WARN_ON_ONCE(!(regs->msr & MSR_EE));
again:
- if (IS_ENABLED(CONFIG_PREEMPT)) {
+ if (IS_ENABLED(CONFIG_PREEMPTION)) {
/* Return to preemptible kernel context */
if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
if (preempt_count() == 0)
--
2.45.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2024-12-26 19:12 [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT Robert Joslyn
@ 2025-01-07 11:56 ` Sebastian Andrzej Siewior
2025-01-07 11:58 ` Sebastian Andrzej Siewior
2025-01-07 13:10 ` Shrikanth Hegde
0 siblings, 2 replies; 9+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-01-07 11:56 UTC (permalink / raw)
To: Robert Joslyn
Cc: linux-kernel, linux-rt-users, tglx, rostedt, Shrikanth Hegde
On 2024-12-26 11:12:38 [-0800], Robert Joslyn wrote:
> This branch is needed to allow preemptible IRQs to be scheduled,
> otherwise the kernel hangs during boot on my e300 based platforms.
> This branch is needed for both CONFIG_PREEMPT and CONFIG_PREEMPT_RT,
> so broaden the check to CONFIG_PREEMPTION, which is selected by both.
>
> This was previously set to CONFIG_PREEMPTION, but was reverted as part
> of removing LAZY_PREEMPT support.
I remember I pointed this out while Shrikanth posted the preempt-lazy
patches but didn't realize that I need this in RT tree, too.
The lazy-preempt patches for powerpc were merged upstream, I am going to
pull them into the v6.6-series.
I am going to Cc you, hopefully you can confirm that it is working.
> Fixes: b33022a48c79
> Signed-off-by: Robert Joslyn <robert_joslyn@selinc.com>
> ---
> arch/powerpc/kernel/interrupt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> index af62ec974b97..970039af8e92 100644
> --- a/arch/powerpc/kernel/interrupt.c
> +++ b/arch/powerpc/kernel/interrupt.c
> @@ -396,7 +396,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
> /* Returning to a kernel context with local irqs enabled. */
> WARN_ON_ONCE(!(regs->msr & MSR_EE));
> again:
> - if (IS_ENABLED(CONFIG_PREEMPT)) {
> + if (IS_ENABLED(CONFIG_PREEMPTION)) {
> /* Return to preemptible kernel context */
> if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
> if (preempt_count() == 0)
Sebastian
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-07 11:56 ` Sebastian Andrzej Siewior
@ 2025-01-07 11:58 ` Sebastian Andrzej Siewior
2025-01-07 18:09 ` Robert Joslyn
2025-01-07 13:10 ` Shrikanth Hegde
1 sibling, 1 reply; 9+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-01-07 11:58 UTC (permalink / raw)
To: Robert Joslyn
Cc: linux-kernel, linux-rt-users, tglx, rostedt, Shrikanth Hegde
On 2025-01-07 12:56:08 [+0100], To Robert Joslyn wrote:
> On 2024-12-26 11:12:38 [-0800], Robert Joslyn wrote:
> > This branch is needed to allow preemptible IRQs to be scheduled,
> > otherwise the kernel hangs during boot on my e300 based platforms.
> > This branch is needed for both CONFIG_PREEMPT and CONFIG_PREEMPT_RT,
> > so broaden the check to CONFIG_PREEMPTION, which is selected by both.
> >
> > This was previously set to CONFIG_PREEMPTION, but was reverted as part
> > of removing LAZY_PREEMPT support.
>
> I remember I pointed this out while Shrikanth posted the preempt-lazy
> patches but didn't realize that I need this in RT tree, too.
>
> The lazy-preempt patches for powerpc were merged upstream, I am going to
> pull them into the v6.6-series.
> I am going to Cc you, hopefully you can confirm that it is working.
Robert, you are referring to v6.6-RT, correct?
Sebastian
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-07 11:58 ` Sebastian Andrzej Siewior
@ 2025-01-07 18:09 ` Robert Joslyn
2025-01-09 11:44 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 9+ messages in thread
From: Robert Joslyn @ 2025-01-07 18:09 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
tglx@linutronix.de, rostedt@goodmis.org, Shrikanth Hegde
> -----Original Message-----
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Sent: Tuesday, January 7, 2025 3:59 AM
> To: Robert Joslyn <robert_joslyn@selinc.com>
> Cc: linux-kernel@vger.kernel.org; linux-rt-users@vger.kernel.org;
> tglx@linutronix.de; rostedt@goodmis.org; Shrikanth Hegde
> <sshegde@linux.ibm.com>
> Subject: Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
>
> [Caution - External]
>
> On 2025-01-07 12:56:08 [+0100], To Robert Joslyn wrote:
> > On 2024-12-26 11:12:38 [-0800], Robert Joslyn wrote:
> > > This branch is needed to allow preemptible IRQs to be scheduled,
> > > otherwise the kernel hangs during boot on my e300 based platforms.
> > > This branch is needed for both CONFIG_PREEMPT and
> CONFIG_PREEMPT_RT,
> > > so broaden the check to CONFIG_PREEMPTION, which is selected by both.
> > >
> > > This was previously set to CONFIG_PREEMPTION, but was reverted as
> > > part of removing LAZY_PREEMPT support.
> >
> > I remember I pointed this out while Shrikanth posted the preempt-lazy
> > patches but didn't realize that I need this in RT tree, too.
> >
> > The lazy-preempt patches for powerpc were merged upstream, I am going
> > to pull them into the v6.6-series.
> > I am going to Cc you, hopefully you can confirm that it is working.
>
> Robert, you are referring to v6.6-RT, correct?
>
> Sebastian
Yes, I'm using 6.6.58-rt45 at the moment. We found this regression while trying to update from 5.10-rt. I haven't played with lazy-preempt yet but I can certainly test the patches, presently we run everything with PREEMPT_RT.
Thanks,
Robert
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: RE: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-07 18:09 ` Robert Joslyn
@ 2025-01-09 11:44 ` Sebastian Andrzej Siewior
2025-01-10 22:36 ` Robert Joslyn
0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-01-09 11:44 UTC (permalink / raw)
To: Robert Joslyn
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
tglx@linutronix.de, rostedt@goodmis.org, Shrikanth Hegde
On 2025-01-07 18:09:46 [+0000], Robert Joslyn wrote:
>
> Yes, I'm using 6.6.58-rt45 at the moment. We found this regression
> while trying to update from 5.10-rt. I haven't played with
> lazy-preempt yet but I can certainly test the patches, presently we
> run everything with PREEMPT_RT.
So I released v6.12.8-rt8 and v6.13-rc6-rt3. Looking at the lazy bits I
think I just forward your patch to the stable queue for v6.6.
> Thanks,
> Robert
Sebastian
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: RE: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-09 11:44 ` Sebastian Andrzej Siewior
@ 2025-01-10 22:36 ` Robert Joslyn
0 siblings, 0 replies; 9+ messages in thread
From: Robert Joslyn @ 2025-01-10 22:36 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
tglx@linutronix.de, rostedt@goodmis.org, Shrikanth Hegde
> -----Original Message-----
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Sent: Thursday, January 9, 2025 3:44 AM
> To: Robert Joslyn <robert_joslyn@selinc.com>
> Cc: linux-kernel@vger.kernel.org; linux-rt-users@vger.kernel.org;
> tglx@linutronix.de; rostedt@goodmis.org; Shrikanth Hegde
> <sshegde@linux.ibm.com>
> Subject: Re: RE: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
>
> [Caution - External]
>
> On 2025-01-07 18:09:46 [+0000], Robert Joslyn wrote:
> >
> > Yes, I'm using 6.6.58-rt45 at the moment. We found this regression
> > while trying to update from 5.10-rt. I haven't played with
> > lazy-preempt yet but I can certainly test the patches, presently we
> > run everything with PREEMPT_RT.
>
> So I released v6.12.8-rt8 and v6.13-rc6-rt3. Looking at the lazy bits I think I
> just forward your patch to the stable queue for v6.6.
I did some basic testing on 6.12.8-rt8 and that worked fine with both preempt_lazy and preempt_rt.
For what it's worth, we've been using the patch for 6.6-rt for about a month now in internal testing and haven't seen any other issues.
Thanks!
Robert
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-07 11:56 ` Sebastian Andrzej Siewior
2025-01-07 11:58 ` Sebastian Andrzej Siewior
@ 2025-01-07 13:10 ` Shrikanth Hegde
2025-01-07 18:13 ` Robert Joslyn
1 sibling, 1 reply; 9+ messages in thread
From: Shrikanth Hegde @ 2025-01-07 13:10 UTC (permalink / raw)
To: Robert Joslyn
Cc: linux-kernel, linux-rt-users, tglx, rostedt,
Sebastian Andrzej Siewior
On 1/7/25 17:26, Sebastian Andrzej Siewior wrote:
> On 2024-12-26 11:12:38 [-0800], Robert Joslyn wrote:
>> This branch is needed to allow preemptible IRQs to be scheduled,
>> otherwise the kernel hangs during boot on my e300 based platforms.
>> This branch is needed for both CONFIG_PREEMPT and CONFIG_PREEMPT_RT,
Hi Robert.
Are you running with preempt=full or enabled preempt_rt ?
rt is yet to be supported on powerpc. are you having it enabled out of tree?
Also, I have sent out patch to enable dynamic preemption. It uses preempt_model_preemptible.
I think it should work for you as well. If you could give that a try and ensure it works, it would be great.
https://lore.kernel.org/all/20250106051919.55020-2-sshegde@linux.ibm.com/
>> so broaden the check to CONFIG_PREEMPTION, which is selected by both.
>>
>> This was previously set to CONFIG_PREEMPTION, but was reverted as part
>> of removing LAZY_PREEMPT support.
>
> I remember I pointed this out while Shrikanth posted the preempt-lazy
> patches but didn't realize that I need this in RT tree, too.
>
> The lazy-preempt patches for powerpc were merged upstream, I am going to
> pull them into the v6.6-series.
> I am going to Cc you, hopefully you can confirm that it is working.
>
>> Fixes: b33022a48c79
>> Signed-off-by: Robert Joslyn <robert_joslyn@selinc.com>
>> ---
>> arch/powerpc/kernel/interrupt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
>> index af62ec974b97..970039af8e92 100644
>> --- a/arch/powerpc/kernel/interrupt.c
>> +++ b/arch/powerpc/kernel/interrupt.c
>> @@ -396,7 +396,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
>> /* Returning to a kernel context with local irqs enabled. */
>> WARN_ON_ONCE(!(regs->msr & MSR_EE));
>> again:
>> - if (IS_ENABLED(CONFIG_PREEMPT)) {
>> + if (IS_ENABLED(CONFIG_PREEMPTION)) {
>> /* Return to preemptible kernel context */
>> if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
>> if (preempt_count() == 0)
>
> Sebastian
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-07 13:10 ` Shrikanth Hegde
@ 2025-01-07 18:13 ` Robert Joslyn
2025-01-08 4:56 ` Shrikanth Hegde
0 siblings, 1 reply; 9+ messages in thread
From: Robert Joslyn @ 2025-01-07 18:13 UTC (permalink / raw)
To: Shrikanth Hegde
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
tglx@linutronix.de, rostedt@goodmis.org,
Sebastian Andrzej Siewior
> -----Original Message-----
> From: Shrikanth Hegde <sshegde@linux.ibm.com>
> Sent: Tuesday, January 7, 2025 5:10 AM
> To: Robert Joslyn <robert_joslyn@selinc.com>
> Cc: linux-kernel@vger.kernel.org; linux-rt-users@vger.kernel.org;
> tglx@linutronix.de; rostedt@goodmis.org; Sebastian Andrzej Siewior
> <bigeasy@linutronix.de>
> Subject: Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
>
> [Caution - External]
>
> On 1/7/25 17:26, Sebastian Andrzej Siewior wrote:
> > On 2024-12-26 11:12:38 [-0800], Robert Joslyn wrote:
> >> This branch is needed to allow preemptible IRQs to be scheduled,
> >> otherwise the kernel hangs during boot on my e300 based platforms.
> >> This branch is needed for both CONFIG_PREEMPT and
> CONFIG_PREEMPT_RT,
>
> Hi Robert.
>
> Are you running with preempt=full or enabled preempt_rt ?
> rt is yet to be supported on powerpc. are you having it enabled out of tree?
I'm running PREEMPT_RT using the out of tree patches on 6.6.58-rt45:
https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git/
I haven't tried using the mainline kernel, since as you said, it doesn't have powerpc support for PREEMPT_RT yet.
>
> Also, I have sent out patch to enable dynamic preemption. It uses
> preempt_model_preemptible.
> I think it should work for you as well. If you could give that a try and ensure it
> works, it would be great.
> https://urldefense.com/v3/__https://lore.kernel.org/all/20250106051919.5
> 5020-2-
> sshegde@linux.ibm.com/__;!!O7uE89YCNVw!IDeomstGeuiEZi9FmLHH8C2xo
> PPo_ewL-
> k2kiQ9CmVID35U4J_v3Dkafjo3RnS9ygPoUZWwyyp91SP2euRkKArk$
Does the dynamic preemption support let me enable the same functionality as PREEMPT_RT with the out of tree patches? I can test it out either way.
Thanks,
Robert
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
2025-01-07 18:13 ` Robert Joslyn
@ 2025-01-08 4:56 ` Shrikanth Hegde
0 siblings, 0 replies; 9+ messages in thread
From: Shrikanth Hegde @ 2025-01-08 4:56 UTC (permalink / raw)
To: Robert Joslyn
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
tglx@linutronix.de, rostedt@goodmis.org,
Sebastian Andrzej Siewior
On 1/7/25 23:43, Robert Joslyn wrote:
>> -----Original Message-----
>> From: Shrikanth Hegde <sshegde@linux.ibm.com>
>> Sent: Tuesday, January 7, 2025 5:10 AM
>> To: Robert Joslyn <robert_joslyn@selinc.com>
>> Cc: linux-kernel@vger.kernel.org; linux-rt-users@vger.kernel.org;
>> tglx@linutronix.de; rostedt@goodmis.org; Sebastian Andrzej Siewior
>> <bigeasy@linutronix.de>
>> Subject: Re: [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT
>>
>> [Caution - External]
>>
>> On 1/7/25 17:26, Sebastian Andrzej Siewior wrote:
>>> On 2024-12-26 11:12:38 [-0800], Robert Joslyn wrote:
>>>> This branch is needed to allow preemptible IRQs to be scheduled,
>>>> otherwise the kernel hangs during boot on my e300 based platforms.
>>>> This branch is needed for both CONFIG_PREEMPT and
>> CONFIG_PREEMPT_RT,
>>
>> Hi Robert.
>>
>> Are you running with preempt=full or enabled preempt_rt ?
>> rt is yet to be supported on powerpc. are you having it enabled out of tree?
>
> I'm running PREEMPT_RT using the out of tree patches on 6.6.58-rt45:
> https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git/
>
> I haven't tried using the mainline kernel, since as you said, it doesn't have powerpc support for PREEMPT_RT yet.
>
>>
>> Also, I have sent out patch to enable dynamic preemption. It uses
>> preempt_model_preemptible.
>> I think it should work for you as well. If you could give that a try and ensure it
>> works, it would be great.
>> https://urldefense.com/v3/__https://lore.kernel.org/all/20250106051919.5
>> 5020-2-
>> sshegde@linux.ibm.com/__;!!O7uE89YCNVw!IDeomstGeuiEZi9FmLHH8C2xo
>> PPo_ewL-
>> k2kiQ9CmVID35U4J_v3Dkafjo3RnS9ygPoUZWwyyp91SP2euRkKArk$
>
> Does the dynamic preemption support let me enable the same functionality as PREEMPT_RT with the out of tree patches? I can test it out either way.
>
with preempt_rt, dynamic preemption allows you to switch between full
and lazy. without preempt_rt, you can switch between none,
voluntary,full and lazy.
> Thanks,
> Robert
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-01-10 22:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 19:12 [PATCH] powerpc: Allow scheduling of IRQ with PREEMPT_RT Robert Joslyn
2025-01-07 11:56 ` Sebastian Andrzej Siewior
2025-01-07 11:58 ` Sebastian Andrzej Siewior
2025-01-07 18:09 ` Robert Joslyn
2025-01-09 11:44 ` Sebastian Andrzej Siewior
2025-01-10 22:36 ` Robert Joslyn
2025-01-07 13:10 ` Shrikanth Hegde
2025-01-07 18:13 ` Robert Joslyn
2025-01-08 4:56 ` Shrikanth Hegde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox