r/programming • u/scientologist2 • Nov 19 '10
Alternative To the 200-Line Linux Kernel Patch
http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html1
1
u/nikosk Nov 19 '10
FYI: Just tried it on an Ubuntu 10.04 desktop and I can confirm that at the least your system won't crash. I can't comment on actual performance improvements yet, not without any hard data at least.
PS: My current kernel signature is: 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:48:22 UTC 2010 i686 GNU/Linux
0
Nov 19 '10
[deleted]
0
Nov 19 '10
[deleted]
3
u/literal Nov 19 '10
Every line of code in the kernel is a possible system crashing bug. Never do in kernel mode what you can get away with in user mode.
You have to take into account that the solution mention in the article is there to activate a kernel feature (cgroup) to solve the problem. Whether that part of the kernel is more bloated or better tested than this patch is another matter, though.
5
u/spotter Nov 19 '10
You point is valid. But please note that this patch is 200 lines of code, while 2.6.32 is 12606910 LOC.
200/12606910 is 1.586431568084487e-05, or 0.000016, or as Python programmer would tell you: 0. ;-)
2
u/w0073r Nov 19 '10
epanastrophe:~$ python3 Python 3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> 200 / 12606910 1.586431568084487e-052
u/spotter Nov 20 '10
I said "Python programmer", not "Python3 programmer", you guys are the __future__ though. Sheesh! ;)
0
Nov 19 '10
[deleted]
2
u/bonzinip Nov 19 '10
As an end user, why exactly should I care about some scheduler magic deep in the bowels of the system?
Because it's not generic. It does wonders if you run compilations from a terminal, but not if a program runs "make > /tmp/blah.txt".
It's policy, and policy belongs in things such as gdm (or systemd) or gnome-terminal, not in the kernel.
-1
u/DPyro Nov 19 '10
So now every UI frontend must implement its own scheduler policy?
The current scheduling system for desktop Linux just sucks, period.
3
u/bonzinip Nov 19 '10
Yes, because these frontends are all different, so these policies are also different even though they share the basic idea.
If you implement it in systemd, every console (session) gets a fair share of the CPU. If you implement it in the desktop, every app in the session gets a fair share of the CPU within what is allotted to the session. If you implement it in gnome-terminal, every tab gets a fair share of the CPU within what is allotted to gnome-terminal by the desktop. And so on. Every application that needs to subdivide its share of the CPU must implement the policy.
Within the kernel, you can only make a simple per-tty policy, which only works in a very specific case ("the desktop will not get less CPU than what each tty will get"). For example, it will not work if you have mplayer in one window and an ffmpeg frontend on the other. It makes no sense, except that it affects Linus's workflow so he likes it.
0
Nov 19 '10
[deleted]
2
u/NitWit005 Nov 19 '10
And for a scenario that only matters to kernel devs?
And anyone who would like their desktop to stop freezing up?
1
u/Comment111 Nov 19 '10
I like running rtorrent in another tty and do my packet managing in a different tty, especially with KMS switching is so easy. Now I have to suffer because they want to lower the priority on the ttys.
3
u/[deleted] Nov 19 '10
Can someone explain to the ignorant, what does all that shell wrangling accomplish? I take it it writes something to some special device that tells the kernel to change something inside itself. But what?