[RT,0/3] riscv: add PREEMPT_RT support

Message ID 20230510162406.1955-1-jszhang@kernel.org
Headers
Series riscv: add PREEMPT_RT support |

Message

Jisheng Zhang May 10, 2023, 4:24 p.m. UTC
  This series is to add PREEMPT_RT support to riscv. Compared with last
try[1], there are two major changes:

1. riscv has been converted to Generic Entry. And riscv uses
asm-generic/preeempt.h, so we need to patch asm-generic's preeempt to
enable lazy preempt support for riscv. This is what patch1 does.
However, it duplicates the preempt_lazy_count() defintion, I'm sure
there must be an elegant solution. Neverless, it doesn't impact the
riscv PREEMPT_RT support itself.

2. three preparation patches(patch1/2/3 in [1]) has been merged in
mainline.

I back-ported the lastest linux-6.3.y-rt patches to the lastest Linus tree,
then cook this series.

Link: https://lore.kernel.org/linux-riscv/20220831175920.2806-1-jszhang@kernel.org/

Jisheng Zhang (3):
  asm-generic/preempt: also check preempt_lazy_count for
    should_resched() etc.
  riscv: add lazy preempt support
  riscv: Allow to enable RT

 arch/riscv/Kconfig                   | 2 ++
 arch/riscv/include/asm/thread_info.h | 5 ++++-
 arch/riscv/kernel/asm-offsets.c      | 1 +
 include/asm-generic/preempt.h        | 8 +++++++-
 4 files changed, 14 insertions(+), 2 deletions(-)
  

Comments

Schaffner, Tobias Oct. 23, 2023, 4:33 p.m. UTC | #1
On 10.05.23 18:24, Jisheng Zhang wrote:
> This series is to add PREEMPT_RT support to riscv. Compared with last
> try[1], there are two major changes:
> 
> 1. riscv has been converted to Generic Entry. And riscv uses
> asm-generic/preeempt.h, so we need to patch asm-generic's preeempt to
> enable lazy preempt support for riscv. This is what patch1 does.
> However, it duplicates the preempt_lazy_count() defintion, I'm sure
> there must be an elegant solution. Neverless, it doesn't impact the
> riscv PREEMPT_RT support itself.
> 
> 2. three preparation patches(patch1/2/3 in [1]) has been merged in
> mainline.
> 
> I back-ported the lastest linux-6.3.y-rt patches to the lastest Linus tree,
> then cook this series.
> 
> Link: https://lore.kernel.org/linux-riscv/20220831175920.2806-1-jszhang@kernel.org/

Any news on this series? Are there any open tasks blocking this?
I am willing to help, but do not see what's missing to get this merged.

> Jisheng Zhang (3):
>    asm-generic/preempt: also check preempt_lazy_count for
>      should_resched() etc.
>    riscv: add lazy preempt support
>    riscv: Allow to enable RT
> 
>   arch/riscv/Kconfig                   | 2 ++
>   arch/riscv/include/asm/thread_info.h | 5 ++++-
>   arch/riscv/kernel/asm-offsets.c      | 1 +
>   include/asm-generic/preempt.h        | 8 +++++++-
>   4 files changed, 14 insertions(+), 2 deletions(-)
>
  
Jisheng Zhang Oct. 23, 2023, 4:40 p.m. UTC | #2
On Mon, Oct 23, 2023 at 04:33:13PM +0000, Schaffner, Tobias wrote:
> On 10.05.23 18:24, Jisheng Zhang wrote:
> > This series is to add PREEMPT_RT support to riscv. Compared with last
> > try[1], there are two major changes:
> > 
> > 1. riscv has been converted to Generic Entry. And riscv uses
> > asm-generic/preeempt.h, so we need to patch asm-generic's preeempt to
> > enable lazy preempt support for riscv. This is what patch1 does.
> > However, it duplicates the preempt_lazy_count() defintion, I'm sure
> > there must be an elegant solution. Neverless, it doesn't impact the
> > riscv PREEMPT_RT support itself.
> > 
> > 2. three preparation patches(patch1/2/3 in [1]) has been merged in
> > mainline.
> > 
> > I back-ported the lastest linux-6.3.y-rt patches to the lastest Linus tree,
> > then cook this series.
> > 
> > Link: https://lore.kernel.org/linux-riscv/20220831175920.2806-1-jszhang@kernel.org/
> 
> Any news on this series? Are there any open tasks blocking this?
> I am willing to help, but do not see what's missing to get this merged.

Hi Thomas, Sebastian

could you please review? Any comments are appreciated. or do you want a
rebase on linux-6.5.y-rt?

Thanks

> 
> > Jisheng Zhang (3):
> >    asm-generic/preempt: also check preempt_lazy_count for
> >      should_resched() etc.
> >    riscv: add lazy preempt support
> >    riscv: Allow to enable RT
> > 
> >   arch/riscv/Kconfig                   | 2 ++
> >   arch/riscv/include/asm/thread_info.h | 5 ++++-
> >   arch/riscv/kernel/asm-offsets.c      | 1 +
> >   include/asm-generic/preempt.h        | 8 +++++++-
> >   4 files changed, 14 insertions(+), 2 deletions(-)
> > 
>
  
Sebastian Andrzej Siewior Oct. 24, 2023, 6:18 a.m. UTC | #3
On 2023-10-24 00:40:20 [+0800], Jisheng Zhang wrote:
> Hi Thomas, Sebastian
> 
> could you please review? Any comments are appreciated. or do you want a
> rebase on linux-6.5.y-rt?

Please resend on top of latest v6.6-RT. Lazy preempt is gone so only
PREEMPT_RT config switch remains from your three patch series. If you
have generic-entry then you could use the new PREEMPT_AUTO.

Are there any reports of this booting without warnings with LOCKDEP and
CONFIG_DEBUG_ATOMIC_SLEEP enabled? I remember there was something
earlier.

> Thanks

Sebastian
  
Jisheng Zhang Oct. 31, 2023, 2:43 p.m. UTC | #4
On Tue, Oct 24, 2023 at 08:18:52AM +0200, Sebastian Andrzej Siewior wrote:
> On 2023-10-24 00:40:20 [+0800], Jisheng Zhang wrote:
> > Hi Thomas, Sebastian
> > 
> > could you please review? Any comments are appreciated. or do you want a
> > rebase on linux-6.5.y-rt?
> 
> Please resend on top of latest v6.6-RT. Lazy preempt is gone so only
> PREEMPT_RT config switch remains from your three patch series. If you
> have generic-entry then you could use the new PREEMPT_AUTO.

Hi Sebastian,

Thank you so much for pointing out PREEMPT_AUTO, I read the discussions
last weekend, glad to know PREEMPT_AUTO. And riscv has switched to
generic entry, so it's easy to support PREEMPT_AUTO for riscv. V2 was
sent out a few mintues ago. Could you please review?

> 
> Are there any reports of this booting without warnings with LOCKDEP and
> CONFIG_DEBUG_ATOMIC_SLEEP enabled? I remember there was something
> earlier.

IIRC, Conor reported the warning and stack trace is ext4 related. But
I didn't reproduce the warning. And Schaffner also tried the series
but it seems he didn't see the warning either. So I'm asking for Conor's
help to retry v2.

Thanks
> 
> > Thanks
> 
> Sebastian
  
Sebastian Andrzej Siewior Oct. 31, 2023, 3:34 p.m. UTC | #5
On 2023-10-31 22:43:52 [+0800], Jisheng Zhang wrote:
> Hi Sebastian,
Hi Jisheng,

> Thank you so much for pointing out PREEMPT_AUTO, I read the discussions
> last weekend, glad to know PREEMPT_AUTO. And riscv has switched to
> generic entry, so it's easy to support PREEMPT_AUTO for riscv. V2 was
> sent out a few mintues ago. Could you please review?

Sure. I have no idea what the upstream status about PREEMPT_AUTO but I
think we want this.

> > Are there any reports of this booting without warnings with LOCKDEP and
> > CONFIG_DEBUG_ATOMIC_SLEEP enabled? I remember there was something
> > earlier.
> 
> IIRC, Conor reported the warning and stack trace is ext4 related. But
> I didn't reproduce the warning. And Schaffner also tried the series
> but it seems he didn't see the warning either. So I'm asking for Conor's
> help to retry v2.

oki.

> Thanks

Sebastian