Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Linux

The ~200 Line Linux Kernel Patch That Does Wonders 603

An anonymous reader writes "There is a relatively miniscule patch to the Linux kernel scheduler being queued up for Linux 2.6.38 that is proving to have dramatic results for those multi-tasking on the desktop. Phoronix is reporting the ~200 line Linux kernel patch that does wonders with before and after videos demonstrating the much-improved responsiveness and interactivity of the Linux desktop. While compiling the Linux kernel with 64 parallel jobs, 1080p video playback was still smooth, windows could be moved fluidly, and there was not nearly as much of a slowdown compared to when this patch was applied. Linus Torvalds has shared his thoughts on this patch: So I think this is firmly one of those 'real improvement' patches. Good job. Group scheduling goes from 'useful for some specific server loads' to 'that's a killer feature.'"
This discussion has been archived. No new comments can be posted.

The ~200 Line Linux Kernel Patch That Does Wonders

Comments Filter:
  • teh snappy!!!! (Score:5, Insightful)

    by schmidt349 ( 690948 ) on Tuesday November 16, 2010 @09:52AM (#34241148)

    Considering that UI lag was always my big problem with anything Linux-based (hell, it even seems to affect Android phones), this might be one small patch for the kernel, one giant leap for userspace...

  • Re:Distros? (Score:3, Insightful)

    by piffey ( 1627145 ) on Tuesday November 16, 2010 @10:04AM (#34241288) Homepage
    Arch: Friday Not to be one of /those/ people or anything...
  • Isn't it awesome (Score:5, Insightful)

    by bcmm ( 768152 ) on Tuesday November 16, 2010 @10:10AM (#34241344)
    Isn't it awesome when a new version of your OS performs *better* than the last one on the same hardware?
  • backport? (Score:3, Insightful)

    by real_smiff ( 611054 ) on Tuesday November 16, 2010 @10:18AM (#34241416)
    any chance of backport of this e.g. to .35 kernel for use in ubuntu maverick? i could use that :) or even to .32 for use in 10.04 LTS..
  • by LanMan04 ( 790429 ) on Tuesday November 16, 2010 @10:20AM (#34241440)

    Isn't it awesome when a new version of your OS performs *better* than the last one on the same hardware?

    It sure is. Mac OS X has been doing this for almost a decade.

  • by nschubach ( 922175 ) on Tuesday November 16, 2010 @10:20AM (#34241446) Journal

    You should clarify that you also don't have to do a full reformat, re-install, and get used to the "new" methods for getting to your files.

  • Please. (Score:3, Insightful)

    by drolli ( 522659 ) on Tuesday November 16, 2010 @10:20AM (#34241454) Journal

    When doing benchmarks, do them seriously.

    okok... i know its phoronix...

    A single *atypical* workload as a benchmark, without a full characterization does not make me consider to use a kernel path on my system which is reported in the style of an UFO-sighting....

    I wonder if nicing the kernel compilation would have had a similar effect....

  • by arivanov ( 12034 ) on Tuesday November 16, 2010 @10:38AM (#34241622) Homepage

    The answer is very very very badly.

    This is a "NERD Feature" patch which does very little to the improve the way Joe Average Luser uses his desktop. In fact it leads to some seriously goofy allocation artefacts.

    What it does (if I read it right) is that it puts all processes with the same controlling TTY into the same group. Well, anything launched in X has no controlling TTY. So it all gets lumped into one group. Now you open a xterm and you launch something from there. Miracle, halleluyah, that actually got into a separate schedule group which can now hog a CPU while the rest of apps will fight for the other one on a two core machine. So what am I supposed to do? Start every one of my X applications from a different Xterm so they have a different controlling TTY (and do not close any of them)?

    Screw that for laughs.

    Process grouping is too difficult to be done based on such simplistic criteria. It is best to provider an interface through which a user can group all of the processes with his UID and leave the Desktop environment do the grouping. Or put something on the dbus which listens and follows who talks to whom to do the same. This will provide much better results than putting yet another simplistic euristic in the kernel.

  • by Zero__Kelvin ( 151819 ) on Tuesday November 16, 2010 @11:02AM (#34241916) Homepage

    "Compiling the kernel isn't a useful benchmark. How well does it deal with running Adobe Air?"

    Obviously you've never compiled a kernel passing -j64 to the make process. If you had, you would know that all your CPUs would be pegged (indeed -j7 pegs all 8 cores on my laptop.) Of course that is not the benchmark part. The point is that with an "all your processors are belong to kernel build" condition, group scheduling allows there to be essentially no perceived slowdown for interactive GUI/Window manager based computing. You probably should have figured out that you were missing something when Linus Torvalds didn't object to the benchmark and the results. Seriously, this is a major point to understand: When it comes to the kernel, in a fight between your knowledge and Linus', Linus wins.

  • Re:Please. (Score:4, Insightful)

    by onefriedrice ( 1171917 ) on Tuesday November 16, 2010 @11:19AM (#34242094)

    I wonder if nicing the kernel compilation would have had a similar effect....

    Probably, but that's not really the point. A user should rarely (if at all) have to use nice on a desktop, because a desktop operating system is supposed to be able to keep input latency low, always. That is the reason BeOS had such incredible perceived speed, but some "modern" operating systems are still struggling with this feat. I mean, it's 2010 and we've had 25+ years to work this out. Cursor stuttering and choppy video should have been a completely solved problem by now.

  • Re:backport? (Score:5, Insightful)

    by pak9rabid ( 1011935 ) on Tuesday November 16, 2010 @11:40AM (#34242416)
    Why not just compile it yourself?
  • by morgan_greywolf ( 835522 ) on Tuesday November 16, 2010 @11:44AM (#34242496) Homepage Journal

    1) There are no 1200 kbps dialup modems. The fastest ones do 56 Kbps under specialized conditions.

    2) If you meant to say 1200 bps modems, well, by the Linus wrote and released the first versions of the Linux kernel, 1200 bps modems and the 386SX were both well obsolete. The most common systems of that day were 486DXs running at 33 MHz at the sweet spot and 50 MHz at the high end. Most people had modems capable of greater than 9600 BPS (many around 14.4Kbps and 28.8Kbps)

    3) Now quit making fun of us real old-timers and get off my lawn .

  • by TheLink ( 130905 ) on Tuesday November 16, 2010 @11:45AM (#34242512) Journal
    10gui just _looks_ nice to the naive, and probably OK for people who only can cope with a few windows open at a time. But I don't see how it's actually going to be faster in task switching than using alt-tab, or clicking on task bar buttons.

    The 10GUI interface would just get in my way a lot.

    I often have about 30 windows open (I have a double height taskbar) - ssh sessions, browsers for work, browsers for nonwork (e.g. slashdot :) ), IM windows, editor, email, virtual box machines, file managers, it all starts to add up. I find opening and closing stuff only to reopen them again is usually a waste of time - why close an app if you're not running out of memory and you can still remember which task button raises it? So if a colleague on IM says: "hey can you restart XYZ again?" I don't have to ssh in, and etc. All I need to do is just click on the correct task button, press up arrow, confirm its what I want, press enter.

    Sad to say, I find Windows XP/7 is so far best for handling stuff like that. Even better than OSX.

    I tried doing the 30+ windows thing on OSX, using Expose. But it's just slower - more steps to get from one window to another. In contrast, on windows I can just click on the desired task button and that's it, no need for two clicks, or click then pause or other bullshit. Keep in mind, I'm not saying Windows is the best possible, there's still room for improvement. For instance, it'll be nice to be able to "alt-tab" from one browser tab to another browser tab (so much so that sometimes I open new browser windows just to be able to alt-tab between them).

    KDE when I last used it was stupid. They sort tasks top to bottom first then only left to right. So if you have a double height taskbar and you close one button in the middle, all the buttons to the right of the closed button change position! That is so stupid.

    If you think it's ridiculous to have 30 windows open, keep this in mind - nearly any crappy GUI can seem cool and easy for a workload that only has 3 windows open. It's when you need to juggle lots of tasks at the same time that's where the GUI either adds value or gets in the way. On-topic analogy: it's just like an O/S, a crappy kernel can seem good when you only have 3 concurrent processes. It's when you have 30 concurrent _running_ processes that you find out whether the kernel's IO and CPU scheduling is good, mediocre or poor.

    I would prefer a GUI that's good for the naive/noob users, but at the same time provides short-cuts that can speed things up immensely for users that are willing to learn them.

    GUI designers should not assume that users are not able to learn "fancy" stuff. Just watch an experienced Starcraft player (actions per second and all that ;) ) or some other competitive gamer, or watch a skilled person handling a Point-of-Sale machine.

    A great UI should be able to hyper-augment humans. To paraphrase a perlism, a great GUI should make simple things trivial, and difficult things easier.

    Desktop GUI designers should not be saying "most people don't do difficult things so let's just handle the simple case".
  • by h00manist ( 800926 ) on Tuesday November 16, 2010 @11:46AM (#34242522) Journal
    Indeed everyone that asks me about migrating to Linux is asking about "can I run xyz programs". The answer to that question is generally what matters most. It's not an easy question, there are no easy answers to it, but it's the most relevant.
  • Re:Just say it (Score:5, Insightful)

    by Enderandrew ( 866215 ) <enderandrew&gmail,com> on Tuesday November 16, 2010 @11:58AM (#34242688) Homepage Journal

    Occassionally, yes. But usually when Linus flames someone on the LKML he is entertaining, and is right. This was an instance where Linus just seemed to be a dick for no reason.

  • by Joey Vegetables ( 686525 ) on Tuesday November 16, 2010 @12:00PM (#34242722) Journal
    Only 3 years? How can you call that a fair chance? It's not even enough time to compile KDE!! :) (disclaimer: mostly happy Gentoo user here, but yes, like many other worthwhile things, it can come at a cost, mainly in hopefully unattended compile time, and occasionally, if you want the latest stuff, some user/administrator time as well trying to figure out what the ebuild maintainers were smoking when they did certain things.)
  • I think part of the reason that Linus is more accepting of this change rather than replacing the entire scheduler (like Con Kolivas pushed for) is that Linus likes small, neat patches. And I think Linus gets offended when someone wants to rip out large sections of the kernel and replace them.

    I often wonder how much old, legacy code there is in the kernel that is just overlooked. Anytime you carry code for that many years, you're bound to have some legacy systems that can due to be replaced.

  • by GooberToo ( 74388 ) on Tuesday November 16, 2010 @01:17PM (#34244030)

    Its been fairly well documented as to what happened. Linus is an egotist; as are many smart people, including others on the LKML. It seems Con has a fair ego himself with somewhat gruff interpersonal skills. The combination put him at odds with a lot of people. Generally speaking, people with large egos, don't like others who know more than they do, especially when its their pet project. Furthermore, Linus already had some people he trusted, who also had their ego's hurt by Con's work.

    So the line was drawn. Linus and his trusted lieutenants on one side and Con on the other. Linus with his lieutenants, all with hurt egos from a slightly abrasive developer who clearly understood the problem domain better than all of them, simply decided he preferred his pride and undue ego over that of Con's potential contributions.

    Not surprisingly, this type stuff happens ALL THE TIME amongst developers. I can't tell you how many times I've seen personal pride and ego take priority over extremely well documented and well understood solutions. Not to mention, frequently, the same documentation which explains why its a good decision, also explains why the decision of pride is an incredibly bad decision; with a long history of being very dumb. Despite that, egos frequently rule the day. So its hardly surprising that Linus isn't immune.

  • by Ltap ( 1572175 ) on Tuesday November 16, 2010 @02:25PM (#34245208) Homepage
    Indeed, I find that Linux has an almost miraculous ability to convert users into developers. I've encouraged several friends over the years to use it, and out of those that have actually done it, most have not just stuck with it but have even surpassed me in some ways. It can take a teenager or young adult who knows barely anything about coding or even much about computers and can turn them into a coder or admin in no time. My theory is that people follow a sort of a path:

    1. They use a bloated (but more immediately user-friendly) distribution like Ubuntu.
    2. They hear about other users with lighter software and try it out. It requires a bit more configuration to be the way they want it to be. In the process, they learn more about their system and they learn many useful things.
    3. The drive for improved performance and usability leads them to learning more and more and doing deeper and deeper configuration until they know a great deal and are very comfortable with their system.
    4. The "scratch that itch" (ESR) effect comes into play; they see deficiencies in existing software and go out to make their own.
    5. Before long, they are contributing to several projects, have a technical blog, and are advanced users.

    It seems to be some sort of natural progression and it's interesting to see it happen over the period of several years. More significantly, Linux seems to turn a higher percentage of basic users (even those of the luser variety) into developers and advanced users. This seems to be why Linux progresses at such a fast pace; its users actively encourage other users to involve themselves on a deeper level.
  • by Anonymous Coward on Tuesday November 16, 2010 @02:46PM (#34245538)

    http://lkml.org/lkml/2010/11/16/330 - user space solution that does the same.

  • by ciggieposeur ( 715798 ) on Tuesday November 16, 2010 @03:15PM (#34245980)

    Back in the 80's and 90's many DOS users followed the same path. BYTE, PC Magazine, and even PC Computing provided essays on "how it works" and source listings for 8086 ASM and BASIC programs. But somewhere around the time of Windows 95, things seemed to change and it became expected that the "average user" had no interest or time in learning how anything works. I remember that desire to Not Know Or Care as one of the major friction points between the DOS user base and the Windows (and Mac for that matter) user base.

  • by 10101001 10101001 ( 732688 ) on Tuesday November 16, 2010 @04:53PM (#34247570) Journal

    I have never, not even once, thought of Windows as "snappy", especially when compared to Linux. But, I don't want to argue about it, I don't want to start a flamewar, and I don't doubt the sincerity of your statement; I merely have had a very, very different experience.

    I don't want to start a flamewar either, but I'll throw in my two cents. My own experience has been that Windows 95, Windows 98, and Windows 98SE (never really used ME) were snappy on the hardware of their day when it came to things like file browsing. This held true even after the installation of IE4 to IE6SP1 (although after every IE install it seemed less snappy). In comparison, Nautilus, Konqueror, Dolphin, and ROX all seem significantly slower on much more powerful hardware. With Windows 2000/XP on similar hardware I see similar behavior.

    I'd assume it's all scheduling issues, personally. But, then, it could also be partially a perceptual thing. A file browser locking up for two seconds and displaying a full file list seems faster (and is less annoying) than a file browser that updates every half second (which is frustrating because things jump around) and displays a full file list after 1.5 seconds (although you'll probably have to wait until 3 seconds to make sure it didn't just seeming stall and will resume again). With Windows 9x, it seemed that whatever you were doing was always more responsive than what happened on Windows 2000/XP or Linux, nearly regardless of the power of the hardware.

    It's funny, but Windows 9x came out at the time when hardware was finally powerful enough to have near instant user interactivity on most common tasks, so it's not hard to see why people might have fond and/or warped memories of the past. I know i do.

  • by jbolden ( 176878 ) on Tuesday November 16, 2010 @04:55PM (#34247600) Homepage

    Part of the problem was the jump in difficulty. Windows 286/386/3.0 was difficult enough to program that to do anything useful required more than just basic skills. Also BAT worked sorta well as a scripting language there no scripting language for windows.

    Basically the difficult shot up suddenly when it came down again with things like visual basic the paradigm had changed. Incidentally its still fairly hard in windows to manipulate hardware.

  • by dgriff ( 1263092 ) on Tuesday November 16, 2010 @05:04PM (#34247762)

    Yep. For those that haven't tried it without the patch, a multithreaded kernel compile will typically peg a modern multicore CPU at 100% and will even give you drunken mouse syndrome. Just being able to scroll around a browser window while doing a lengthy make -j64 is impressive. Being able to watch 1080p video smoothly is ... astounding.

    For an OS that has been around for nearly 20 years and has had thousands of very bright programmers poring over it, it's quite astounding that only now has someone finally figured out how to let gui-related activity have top priority.

  • by vegiVamp ( 518171 ) on Wednesday November 17, 2010 @03:44AM (#34252106) Homepage

    I have to say that I went rougly the other way: I started with Linux because I was highly discontent with the then-current Microsoft offerings, finding them unwieldy and unstable. I started way back on Slack 6, where the first step of the installation process was compiling your own kernel and gcc three times to get them pure :-)

    Later I switched to RedHat (3 or 4, I think), and was also messing in some code - mostly for my own benefit, can't recall ever committing anything because I didn't think the changes I made were useful for enough people to be included.

    These days, I just run Ubuntu - I've been through the whole trial-and-error config file thing, it's given me a good understanding of many things, but now I just want something that simply works so I can get on with other stuff.

    These days, the MS offerings (well, some of them) are at least a lot more stable, although I personally still find them unwieldy - I guess I'm no longer used to having my OS babysit me. I even occasionally recommend that a friend who needs a reinstall sticks with windows, depending on his needs, although I always offer them Linux, too. I flat out refuse to support windows boxen, though :)

It's great to be smart 'cause then you know stuff.

Working...