Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real-time version PREEMPT_RT #88

Open
4-FLOSS-Free-Libre-Open-Source-Software opened this issue Nov 21, 2024 · 11 comments
Open

Real-time version PREEMPT_RT #88

4-FLOSS-Free-Libre-Open-Source-Software opened this issue Nov 21, 2024 · 11 comments

Comments

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor

Since mainline Linux Kernel 6.12 ships, PREEMPT_RT. No patching required anymore for real time kernel.

https://xanmod.org lists alongside LTS that we got already here, another branch

RT Stable Real-time

Well the Xanmod is not 6.12 yet and the RT version equals LTS and is 6.6 currently.

A Locietta/xanmod-kernel-WSL2 fork, implemented it:
taalojarvi@fe4ee5e

Can we add another release, additional to LTS for RT version?

@Andarwinux
Copy link
Contributor

I doubt RT makes sense for WSL, no one is trying to use WSL2 as a pro-audio workstation or an IoT edge controller, and for other general use cases it just reduces performance.

By the way, if you enable RT, you will lose THP.

ref:
https://lwn.net/Articles/938236
https://www.youtube.com/watch?v=7hwoJanE5-U

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

By the way, if you enable RT, you will lose THP.

Thanks for hint, it also disables more flags according to Disabled CONFIG_ options, but which should not affect this WSL2 Kernel version negatively further than lacking THP for now, until THP realtime support fixed.

Several features are disabled by CONFIG_PREEMPT_RT=y because of incompatibility.

Disable Incompatible Options with PREEMPT_RT:

  • CONFIG_TRANSPARENT_HUGEPAGE: transparent huge page (THP) support; currently, it is disabled when PREEMPT_RT is chosen. Gleixner said that the problems with THP for realtime need to be fixed, "patches welcome". The realtime project has been focused on getting other things done, and has not tackled THP yet. There is no technical reason why the two cannot work together, they just do not right now.

@taalojarvi
Copy link
Contributor

taalojarvi commented Nov 22, 2024

Since mainline Linux Kernel 6.12 ships PREEMPT_RT. No patcing required anymore for real time kernel.

https://xanmod.org lists alongside LTS that we got already here, another branch
RT Stable Real-time

Well the Xanmod is not 6.12 yet and the RT version equals LTS and is 6.6 currently.

An Locietta/xanmod-kernel-WSL2 fork, implemented it: taalojarvi@fe4ee5e

Can we add another release, additional to LTS for RT version?

Would it be a good idea to move from PREEMPT_VOLUNTARY to PREEMPT?

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

I was testing this. Changes were pushed out of source. Apart from scheduler latency being very consistent, there wasn't any notable improvements.

But you were testing an < 6.12 Kernel Version or?

@Andarwinux
Copy link
Contributor

export VERSION_BRANCH=$(curl -s https://xanmod.org/ -A $CURL_UA | awk '/MAIN/{getline; getline; print}' | grep -oP '[0-9]+\.[0-9]+')

You need to change this to EDGE to switch to 6.12.

@Locietta
Copy link
Owner

Would it be a good idea to move from PREEMPT_VOLUNTARY to PREEMPT?

How much do we care latency on WSL2? PREEMPT_NONE->PREEMPT_VOLUNTARY ->PREEMPT->PREEMPT_RT gradually trade throughput for lower system latency. Despite wslg exists, I think most use cases of WSL are still about CLI and computing, much like a linux server, that's probably why official kernel sticks with PREEMPT_NONE.

That said, switching to PREEMPT_DYNAMIC might be a good compromise. Users can just override preempt strategy to none/voluntary/full by passing kernel cmdline with .wslconfig if they want.

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

Even today rt cannot be selected with the PREEMPT_DYNAMIC boot parameter.
PREEMPT_RT would still be a separate compile time option

Ensure that PREEMPT_DYNAMIC is enabled in the kernel, possible values for the preempt parameter are:

To enable the voluntary preemption mode (PREEMPT_VOLUNTARY):

[wsl2]
kernelCommandLine = preempt=voluntary

To enable the desktop preemption mode (PREEMPT_DESKTOP):

[wsl2]
kernelCommandLine = preempt=full

To disable preemption (PREEMPT_NONE):

[wsl2]
kernelCommandLine = preempt=none

@Andarwinux
Copy link
Contributor

Let's wait for PREEMPT_LAZY in 6.13, for now PREEMPT_DYNAMIC is good enough.

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

export VERSION_BRANCH=$(curl -s https://xanmod.org/ -A $CURL_UA | awk '/MAIN/{getline; getline; print}' | grep -oP '[0-9]+\.[0-9]+')

You need to change this to EDGE to switch to 6.12.

Now it's the stable Branch >6.12

https://github.com/Locietta/xanmod-kernel-WSL2/releases/tag/6.12.5-locietta-WSL2-xanmod1.1

Will there be a real-time CONFIG_PREEMPT_RT enabled xanmod kernel build for wsl2?

@Andarwinux
Copy link
Contributor

You can build your own toy kernel, but CI resources shouldn't be wasted on a meme, especially since we already provide three variants: do we need to build six?

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

since we already provide three variants: do we need to build six?

This is called Xanmod and Xanmod ships as

  1. Main. V1,V2,v3
  2. LTS V1,V2, V3
  3. RT V2,V3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants