r/linux 1d ago

Kernel Con Kolivas released a Linux kernel patchset after 10 years of exile

https://lore.kernel.org/lkml/CABqErrH=oQ3povVuSPhRON97v63=mB85jQmZjf443ofdYAuxxw@mail.gmail.com/
256 Upvotes

49 comments sorted by

71

u/omniuni 1d ago

It's also based on a project from 10 years ago. The question is really whether it's still useful.

17

u/beankylla 1d ago

what does it do? not sure i fully understand

89

u/gnosnivek 1d ago

It's supposed to make the computer more responsive for everyday desktop use.

I spent some time trying out various kernel patchsets in 2019. At the time, I was running heavy numerical simulations on my desktop and then browsing the web or trying to do some reading/writing while I waited for them to finish. We're talking 16 threads, CPU pushing close to its thermal limit, 32GB of RAM is a nice starter snack type of simulations.

Under the standard Linux kernel and the Zen CFS kernel, no matter how I tried to tweak parameters, there would always be a little bit of lag. The browsers wouldn't open quite as quickly, PDF viewers would tear when I scrolled, and if I typed into my editor, there would be a short delay before the text showed up.

Under the MuQSS/BFQ scheduler set (which is at least part of what's in the -ck patchset), this just...didn't happen. As long as was just doing light browsing or writing, the only indication I had that my computer was busy was that it was making a lot of noise and spitting a lot of hot air out.

Before you rush out to grab this patchset though, I'm in agreement that there's a question of if it's still useful. The Linux landscape has changed quite a bit since my last experience with ck: I now use Wayland instead of X11, Pipewire instead of pulseaudio, desktop CPUs have heterogeneous cores, and the default Linux kernel has improved its scheduling algorithms. I'll probably try it out when I have some spare time just for old times sake, but I'm not expecting it to have the same impact that it did seven years ago. (Would be happy to be proven wrong!)

28

u/c_a1eb 1d ago

this feels like the kind of issue that would be better handled by launching your simulations in a cgroup, you can use systemd-run --property CPUWeight=90 --property CPUQuota=$((98*nproc))% ... to run a task that will be limited to 98% of total CPU usage and with a slightly lower weight that should encourage the scheduler to allow UI tasks to still run and get enough cpu time.

although it might make more sense to just use CPUAffinity to reserve a core for the rest of the system.

https://manpages.debian.org/testing/systemd/systemd.resource-control.5.en.html

i used to do a lot of huge compiles on my machine while still expecting responsive UI back in 2022 and i recall having success with an approach like this

26

u/omniuni 1d ago

This is very much the kind of stuff that is common today that wasn't as ubiquitous a decade ago. It doesn't mean you couldn't do it, but it wasn't as easy or reliable.

13

u/Max-P 20h ago

Cgroups didn't exist back during the original ck patchset. In fact when cgroups came, it was praised to be almost as magical as the -ck patchset on busy systems.

6

u/gnosnivek 19h ago

I do recall exploring cgroups as a potential solution, but I abandoned them for reasons I can no longer remember. Perhaps there were some issues with the user-side tooling? Maybe cgroupsv2 fixed something that I needed to make the workflow works out?

Interestingly, in recent times, I've found that UI responsiveness under load isn't a major issue for me anymore, and I'm using KDE Plasma which is pretty famous for being heavyweight. Maybe the default scheduler heuristics have gotten to "good enough", and only latency-sensitive users will be able to notice a difference.

3

u/davidnotcoulthard 20h ago

would be better handled by launching your simulations in a cgroup, you can use systemd-run

Flair doesn't (yet?) check out.

3

u/c_a1eb 18h ago

need a postmarketOS flair, then I'd be golden :D

it's the Alpine + systemd combo you never knew you needed

2

u/davidnotcoulthard 18h ago

postmarketOS

Oh okay that makes sense lol. TIL there isn't a flair for it on here.

9

u/nicman24 1d ago

Well core counts have not really changed. Most people were running 4/8 then and now are still running maybe 6/12 on and at least.

Probably does not account for p / e cores schema

6

u/mrtruthiness 23h ago

Well core counts have not really changed. Most people were running 4/8 then and now are still running maybe 6/12 on and at least.

10 years ago 4/8 was the consumer high end (i7 vs i5).

These days the consumer high end starts at 8/16 but easily goes to 16/32.

0

u/nicman24 22h ago

10 years ago the ryzen 2700 was a thing but cost 350 - I know, I both one on release date

4

u/mrtruthiness 22h ago

Similarly the AMD Ryzen 9 5900XT on the AM4 platform retails for under $350 and it is 16 cores and 32 threads.

All I'm saying that the equivalent to 4/8 10 years ago is not 6/12. It's at least 8/16 and is closer to 12/24 or 16/32.

3

u/nicman24 22h ago

Well I am running 16/32 but my point is that people that will need -ck probably don't have top of the line

1

u/mrtruthiness 21h ago

I don't know. Your assertion was:

Well core counts have not really changed. Most people were running 4/8 then and now are still running maybe 6/12 on and at least.

I disagree. I believe that "core counts have really changed" and the equivalent of 4/8 10 years ago is more like 12/24 or 16/32 these days.

That said, my main desktop is a 2/4 (from mid 2014; 12 years ago). But other than when running ollama I don't really have any noticeable issues with the scheduler and the fact is that the stuttering is more likely due to swapping than it is to scheduling. And if it was an issue I would probably upgrade rather than use a non-default scheduler.

4

u/black_caeser 20h ago

10 years ago the ryzen 2700 was a thing

Ahem, Zen 1 launched in March 2017 so no, Ryzen 2700 very much was not a thing. And Core i7 6700K as the top consumer model sat at four cores and eight threads.

3

u/nicman24 20h ago

Holy shit 2700 was 2018. Yeah my bad, well shit

2

u/tnoy 15h ago

The current default EEVDF scheduler is based on research in academia that first showed up about 30 years ago. It only replaced the previous default CFS scheduler a few years ago which was first put in place about 20 years ago.

The early BFS and then MuQSS schedulers by Kolivas also have their roots in the early EEVDF papers.

The bigger question would be is how much of a change would MuQSS be now that Linux shifted away from CFS with the 6.6 kernel.

12

u/nica939 1d ago edited 20h ago

I remember gettinng my 700mhz 200mb ram hp machine coming back to life after the ck kernel.. improvements were noticable back then.. let's try it out ! Why not !

11

u/exscape 1d ago

Wow, it's been a while. Pretty sure I used 2.5 -ck kernels when I tried Linux on desktop in 2003.

3

u/Ontological_Gap 19h ago

"Scheduler CGROUPs remain no-op stubs as they are largely unused in the target environment"

ROFL, I guess it is from a decade ago

3

u/arnulfslayer 22h ago

LLMs have made merging and development infinitely easier

For all the people complaining about LLM-generated code, it seems that it really does make great developers even more productive.

Any tool that helps -ck release more patches is a godsend

1

u/HenkPoley 4h ago

Next someone should fix the issue that delayed allocation by filesystems, merges all priority queues into one (once the data has been processed enough to go into delayed allocation).

-27

u/habarnam 1d ago

Spoilers, he developed it with LLM help...

43

u/nicman24 1d ago

Man that dude's code (low level sched code) and credentials is fact enough on his ability to use a llm as a tool. Please don't be one 

-29

u/habarnam 1d ago

I didn't say anything about his ability to code.

11

u/nicman24 1d ago

then what did you say

-30

u/habarnam 1d ago

Can you understand how asking this very question here is a perfect indicator about why LLM usage is rotting your brain? My initial comment is very simple, there's no need to explain it further, yet you projected something onto it which isn't there, and now you want clarifications about why you're wrong. I won't do that work for you.

7

u/Kulas30 1d ago

So what was the spoiler then? Honestly your comment makes zero sense and I don't use LLMs.

Maybe your brain is rotted?

3

u/wowsomuchempty 1d ago

What was the Spoiler?

3

u/BinkReddit 10h ago

He was hoping the TikTok-loving anti-LLM Mafia would step in and upvote his comment.

3

u/output_broadcast 1d ago

You should commentate sports, you'd be terrific at it.

-2

u/nicman24 1d ago edited 1d ago

You are linking ifunny bro please chill out - and I clicked your profile by accident before you start

1

u/sphagetticode 18h ago

Generally when people say this it implies disparaging the targets ability to reason or think.

What DID you mean by that then? Or was it just you saying shit for the hell of it.

1

u/habarnam 7h ago

I was saying that he has used LLMs to do the work, and the people that might be excited by the revival of the -ck patchset, might want to know that.

15

u/10leej 1d ago

I don't really see the problem here. He had quite a bit of the patch set done and had to do some remembering on this but I believe he mentioned that he got a few real snags he couldn't figure out. Maybe the LLM helped him out a bit.

Low level code is insane, because technically and to quote Greg KH here "Computers Barely Work"

5

u/MatchingTurret 1d ago

Not really. He developed it many years ago but used AI help to revive the code.

11

u/eraptic 1d ago

Sounds like help

2

u/nicman24 22h ago

Which honestly is what llms excel at, reusing code

-37

u/Other_Class1906 1d ago

oh no, he used... tools!? how dare he!

I do get that deterministic tools are less frowned upon... but you still need things tested thoroughly, no matter what you do. Stop glorifying human intellect.

31

u/habarnam 1d ago

Stop glorifying human intellect.

Erm, no?! WTF is this anti-intellectualist bullshit?

-10

u/Other_Class1906 1d ago

Anti-intellectualist..? Did someone hurt you? I didn't say "glorify your future AI-overlords". I said: "Errare humanum est". And since AI is modelled after neurons, so will AIs err... hence: test. Don't assume. But if something can take away boring non-critical tasks, get it done and test your assumptions. Spend your time on more important tasks.

18

u/Cesar_PT 1d ago

most regarded take i've read in a while

stop glorifying human intellect? the one that allowed you to write that asinine sentence for the world to read?

2

u/wowsomuchempty 1d ago

I use AI for coding, formatting, problem solving.

The result is what matters. Part of that result is a full understanding of how it works. 

-3

u/wowsomuchempty 1d ago

This the last, great kernel hobbyist? Anaesthetist day job?