Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Linux Software

The New Linux Speed Trick 426

Brainsur quotes a story saying " Linux kernel 2.6 introduces improved IO scheduling that can increase speed -- "sometimes by 1,000 percent or more, [more] often by 2x" -- for standard desktop workloads, and by as much as 15 percent on many database workloads, according to Andrew Morton of Open Source Development Labs. This increased speed is accomplished by minimizing the disk head movement during concurrent reads. "
This discussion has been archived. No new comments can be posted.

The New Linux Speed Trick

Comments Filter:
  • I've noticed it... (Score:5, Interesting)

    by Anonymous Coward on Tuesday April 06, 2004 @08:03AM (#8778302)
    I'm having trouble getting ACPI working in my laptop in the 2.6 kernel (it's a bad implementation on the part of my laptop). The 2.4 series used to work (sometimes) so I installed Mandrake's 2.4 kernel and 2.6 kernels on my laptop. Using 2.4.x again was like switching to a horse and buggy from a sport-cars; KDE was that much faster with the 2.6.x kernel running the show.
  • Cache? (Score:4, Interesting)

    by Anonymous Coward on Tuesday April 06, 2004 @08:04AM (#8778306)
    Whatever happened to cache. If you can anticipate the head movement surely you have already read the data before and it should be in the cache????
  • SCSI (Score:4, Interesting)

    by Zo0ok ( 209803 ) on Tuesday April 06, 2004 @08:04AM (#8778308) Homepage
    Dont SCSI drives do this themselves?
  • Yay (Score:1, Interesting)

    by Anonymous Coward on Tuesday April 06, 2004 @08:06AM (#8778323)
    I remember when this feature was added to NT Service Pack 4. Performance on the enterprise database server I was managing increased something like 45%.

    It's nice to see smart features like this added to Linux.
  • by maxwell demon ( 590494 ) on Tuesday April 06, 2004 @08:06AM (#8778327) Journal
    Is there any reason why the prediction code (anticipatory scheduler) and the extra queues (deadline scheduler) couldn't be combined in a single scheduler to give us the best of both worlds?
  • Amiga Disks (Score:5, Interesting)

    by tonywestonuk ( 261622 ) on Tuesday April 06, 2004 @08:12AM (#8778351)

    When I had an Amiga (aroung '91ish), even though It was fully multitasking, I learnt to never open any app while another was loading. If you did, you could hear the disk head moving back and forward between two sectors on disk every half second or so, slowing both app launches to a crawl. Waiting until one loaded, and launching the second was many times faster.

    I've always wondered why there wasn't something in the OS to force this behaviour, Ie, making sure that App 2 access to the disk is queued until app 1 has finished. Isn't this one of the reasons Windows takes ages to boot? (many processes all competing for the one disk resource?).
  • by redcliffe ( 466773 ) on Tuesday April 06, 2004 @08:13AM (#8778357) Homepage Journal
    I've actually found that on my machine, a pretty much standard desktop, response is a lot slower on 2.6.5 than 2.4.22. Not sure if I got something set wrong in the compile, but moving the mouse and stuff like that seems a lot jerkier under load. I use a USB mouse and keyboard, so maybe that's part of it. Anyone else seen similiar?
  • I'm an end user (Score:1, Interesting)

    by Anonymous Coward on Tuesday April 06, 2004 @08:13AM (#8778360)
    Can someone please explain how this is done in laymans terms.
    This would be grate for my laptop, as the harddisk slows down the entire system. It takes like 30sec to load up mozilla. My laptop seems to spend half the time reading stuff from the harddrive. It takes 5sec to start xterm!

  • Disk Transfer QoS (Score:4, Interesting)

    by johnhennessy ( 94737 ) on Tuesday April 06, 2004 @08:20AM (#8778394)
    I think Solaris 10 (or maybe a later version, I can't remember) is suppose to support a concept of Quality of Service applied to disk accesses.

    Is anyone in the Linux world considering this ?

    This is probably more applicable to the enterprise market, but surely any scheme of informing the scheduler about the expected disk transfer characteristics has to improve performance.

    On the other hand, it might be just Sun trying to re-invent uses of buzz words to sell their products.
  • Re:Anti-MS Patent (Score:3, Interesting)

    by Tribbin ( 565963 ) on Tuesday April 06, 2004 @08:23AM (#8778406) Homepage
    Stealing what? The algorithms?

    The end-(Windows)-user benefits from it.

    That's the price of freedom.

    And any additions MS makes to the code must be made public.

    So then everybody benefits.
  • by Anonymous Coward on Tuesday April 06, 2004 @08:26AM (#8778424)
    If IO speed is so important, why doesn't Linux do direct IO [berkeley.edu], where the app's buffer is DMA'd directly to/from the device instead of getting buffered in the kernel?

    Doing direct IO can shave up to 30-50% of IO times on Solaris 9.

  • Oh, come on... (Score:5, Interesting)

    by mdb31 ( 132237 ) on Tuesday April 06, 2004 @08:28AM (#8778431)
    ...to achieve the O(1) timing, quite a leap forward that we had not even thought of!

    The NT scheduler has been O(1) like, eh, forever.

    Our kernel produces far superior performance due to providing hooks for the COM layer

    Yeah, whatever. There is no COM anywhere near the NT kernel, and the latest and greatest from Microsoft, the .NET framework, isn't even based on COM anymore

    Nice troll...

  • by Anonymous Coward on Tuesday April 06, 2004 @08:29AM (#8778439)
    like a ferrari and a truck... this doesn't work nor excel in the same way
    Does Not? [barchetta.cc]
  • Re:Anti-MS Patent (Score:4, Interesting)

    by mydigitalself ( 472203 ) on Tuesday April 06, 2004 @08:31AM (#8778448)
    no: stealing the concept (probably by analysing the code) and writing it themselves.

    so if MS make any improvements in their own implementation of the concept, then the code would not be made public and MS benefits and not everyone else.

    to elaborate (and in some ways i believe this is what SCO are arguing), lets say i see an open source application that does something neat. it probably won't be patented because the author expects someone to contribute any modifications back. but lets so i don't because i'm a greedy commercial corporate and so i effectively copy the IDEAS behind the application. my code may look quite similar to theirs, but i certaintly have not infringed on the GPL (or have I - i'm no lawyer!).

    so if this neat application had an "open source patent" in that anyone infringing on the patent would not be liable for millions, but rather they would be liable and forced to open up the source code of their particular implementation.

  • by Anonymous Coward on Tuesday April 06, 2004 @08:32AM (#8778455)
    Well, upgrading will not automatically give you a faster computer, not for all hardware. On my old Compaq Armada laptop (450 mhz, 128 mb), Mandrake 9.2 using the 2.4 kernel and KDE 3.1 was slow but usable... same with Win2000.

    I upgraded to Mandrake 10.0 Community Edition (you know, post-beta but not officially released...). It has kernel 2.6 and KDE 3.2. Looks nice, but now it is slow enough to be unusable. Mozilla takes 20 seconds to start, HD swapping furiously.

    I believe I read that the new kernel does take up some more memory, perhaps my laptop has reached its limit?

    I am currently learning to compile the kernel, so I'm going to try to do a low-fat version with all unneccesary file systems, drivers et al removed. I should probably use just about anything than Mozilla and KDE also. Firefox plus IceWM perhaps.
  • Re:Amiga Disks (Score:3, Interesting)

    by MrFreshly ( 650369 ) on Tuesday April 06, 2004 @08:34AM (#8778467)
    I think windows loads slow because of all the damn spyware and un-necessary default drivers and services and IE preloading...etc...

    IMHO Default windows config is kinda like a Redhat with everything and then some.

    Start in safe mode and watch all the crap that tries to load - a ton of it is not needed.

    If you tighten your install by removing a lot of the extra services, spyware, and a few performance tweaks - you'll see a major speed increase over all.

    I use XP, but I don't like it much anymore...It's stable, but I'm really looking forward to a better desktop for Fedora and the new Core 2 release.
  • by hughk ( 248126 ) on Tuesday April 06, 2004 @08:43AM (#8778534) Journal
    One of the big things about databases is the reliable commit where all the crud you have done in a transaction either gets committed or backed out. The writes then become kind of important, and you really do want them to complete before continuing with anything else.

    This messing with the I/O queue may make things interesting for the journalling process which is kind of vital to integrity. File placement could become even more important for this (and also the placing of journal/log files).

    The rest seems to just effectively be a modified elevator (wait a bit before moving).

  • Re:Idea... (Score:3, Interesting)

    by cca93014 ( 466820 ) on Tuesday April 06, 2004 @08:48AM (#8778589) Homepage
    Doh! Was meant to include this quote in the above post - mods can ignore the above post please...
    You can tune your anticipatory scheduler to improve its functionality. There are five basic parameters you can alter to change the way the wait-before-seek times function: read_expire, read_batch_expire, write_expire, write_batch_expire, and antic_expire.

    Would it not be possible to write a very basic adaptive network that "learns" what the best values for these parameters are for each individual machine, based on a history of its workload?

  • by Doctor Crumb ( 737936 ) on Tuesday April 06, 2004 @09:01AM (#8778698) Homepage
    Firstly, the 2.6 kernel allows pre-emptive scheduling. Supposedly it was introduced because Linus got tired of his mp3s skipping while he compiled things.

    Second, Linux doesn't need a defrag utility. Linux filesystems (Ext2 and Ext3) allocate files properly, using clustering and inodes. The need to defrag comes from the bad design of FAT, which works great on a 8088 processor with tiny files on a 1Meg drive, but is terribly inefficient on anything past a 386.

    Of course, there does exist a 'defrag' utility for linux. It just won't gain you much at all.
  • Re:Anti-MS Patent (Score:1, Interesting)

    by Anonymous Coward on Tuesday April 06, 2004 @09:02AM (#8778706)
    Haha, this is totally stupid bullshit - since Windows 2000 already has this feature, it is Linux that copied the idea from Windows.

    So should Linux kernel benefit from this idea although it's copied from proprietary software, only implementation is different? I say sue their ass!

    Seriously, this is so typical of the open sores crowd that it goes on my nerves - all good ideas come from Linux, Windows is "lame" and "bloated", UNIX OS'es are slow, etc.

    If you look at Linux, there are few geniuine innovations, it's mostly coding in open source what already exists in closed source (that's why Sun's Joy said he never bothered with Linux 'cause there's nothing new in it).
  • Re:SCSI (Score:3, Interesting)

    by jcupitt65 ( 68879 ) on Tuesday April 06, 2004 @09:12AM (#8778780)
    Yes, Linux has always had (variations) on the elevator algorithmn.

    This is different: the scheduler isn't trying to minimise head movement for a list of pending read requests (which is what elevator does), it's gathering statistics about the IO behaviour of each process and trying to guess in advance without being asked what each process will ask for next.

    If it guesses right, the data will already be in cache when the process does a read() and the request will succeed instantly.

  • IO Accuracy (Score:2, Interesting)

    by fhafner ( 414503 ) <fhafnerNO@SPAMcentaursystems.net> on Tuesday April 06, 2004 @09:19AM (#8778833) Homepage
    so how does this effect IDE drives in terms of IO read/write accuracy? We use SCSI drives for low level mass data processing and mining because what you write to the disk is guaranteed to be what you can read from the disk in the future.

    IDE disks don't have the same guarantee. Does the new 2.6 kernel improve this?

    I also wonder if this reduces hard drive wear for longer lifetimes....
  • Re:_New_ Kernel? (Score:3, Interesting)

    by Allen Zadr ( 767458 ) <Allen.Zadr@nOspaM.gmail.com> on Tuesday April 06, 2004 @09:31AM (#8778948) Journal
    Funny, the 2.6 kernel has been out with this feature for months. It's old news. I've been running 2.6.4 on Slackware 9 for almost a month now. Yes, all the nifty features turned on. No, I really don't see much of a difference (beyond the standard improvements of a kernel compiled without all the crap I don't need).

    And if you look above to this [slashdot.org] post, you can all see a great deal of decent explanations of what 1000% increase actually means (11%).

  • Re:SCSI (Score:3, Interesting)

    by Rich0 ( 548339 ) on Tuesday April 06, 2004 @09:32AM (#8778954) Homepage
    The interesting thing is that modern elevators do this as well - at least the fancier ones do.

    If you have a 30 story building, you can either put in dumb elevators which fill 3/4ths of the building to meet demand, or you can put in a much smaller number of elevators using techniques like express elevators and using software which keeps track of usage patterns and puts elevators on floors before somebody even hits the button...
  • Re:Anti-MS Patent (Score:5, Interesting)

    by TheNetAvenger ( 624455 ) on Tuesday April 06, 2004 @09:40AM (#8779019)
    ok, i know this is evil and all - but lets say MS decide to implement this as a concept (so without "stealing" code)... the linux community will have given them something and received (probably) nothing in return.

    Not to burst your bubble, but the NT scheduler already implements predictive disk I/O concepts.

    Nice that Linux is finally catching up though...
  • Re:Amiga Disks (Score:4, Interesting)

    by LWATCDR ( 28044 ) on Tuesday April 06, 2004 @09:55AM (#8779157) Homepage Journal
    Actually even early versions of Novell used a system called elevator seeking. The system worked like an elevator the head moved in one direction of util it hit the lowest track/sector in the que then it changed direction. Not nearly a slick as the new system but a big improvment over a first come first serve system. Now that we have so much more memory and cpu power Linux and other OS can use more complex systems
  • If you compile GLIBC with NPTL support you'll see even more of the new kernel in action. I quote from LinuxJournal.com,

    NPTL brings an eight-fold improvement over its predecessor. Tests conducted by its authors have shown that Linux, with this new threading, can start and stop 100,000 threads simultaneously in about two seconds. This task took 15 minutes on the old threading model.
  • by PitaBred ( 632671 ) <slashdot@pitabre d . d y n d n s .org> on Tuesday April 06, 2004 @11:38AM (#8780244) Homepage
    Do you ever question what "boot" means"? When a linux system lets you log in, EVERYTHING is already started and running. When Windows shows you the desktop, there is still a ton of stuff getting started in the background (or the foreground even) and it's still unusable. Windows doesn't start any faster, it just shows you pretty pictures sooner.
  • The Renaissance (Score:4, Interesting)

    by EXTomar ( 78739 ) on Tuesday April 06, 2004 @11:58AM (#8780478)
    And we all would have benifited from this if they simply shared in the first place instead of spending 20-30 years "rediscovering" it.

    One programmer likened the 70-80s as The Dark Ages. There were cabals and secret voodoo that people sat on and didn't share and you ended up with an ignorant masses that only thought "this is as good as it gets". Hopefully this renaissance sticks because it doesn't matter how good or cool your technology is if you bury it for 20 years without another person knowing.
  • Re:Amiga Disks (Score:3, Interesting)

    by jesup ( 8690 ) * <randellslashdot&jesup,org> on Tuesday April 06, 2004 @02:40PM (#8782797) Homepage
    Back in the day (Amiga 3000 introduction circa 1990) we could boot an Amiga off a 40MB disk from power-on (including loading a replacement for the ROM image) to fully up (including mounting NFS mounts) in ~15 seconds; 7 seconds from a warm boot. Effectively we chunked the load of much of the OS (including GFX, Workbench (desktop), etc) as part of the softload of the ROM image into RAM. On top of that, on warm boot we checksummed the ROM image in RAM (as well as various major OS library structures), and if they were good we didn't reload them. (Remember, the Amiga ran without memory protection.) Some of the boot script that followed would cause overlap (anything tha spawned servers/processes), other parts were sequential but generally were very fast and often cached (like "ASSIGN XYZ: dh0:xyz" commands and the like).

    At the time, Win3.1 took Quite A While to boot. Getting past the BIOS alone usually took longer than the Amiga took to finish booting.
  • by ksp ( 203038 ) on Tuesday April 06, 2004 @03:42PM (#8783618) Homepage
    I know there is a boot-time switch for changing the I/O scheduler, but I still believe you are stuck with one for all devices. How about using different algorithms for different partitions? There is quite a lot of difference between a database device, a filesystem holding binaries, shared libaries, /tmp, spool directories etc. etc. etc. When I/O schedulers are so different in their theoretical foundations, why do you have to choose only one?
    This should be a mount option, not a boot option.
  • Re:SCSI (Score:3, Interesting)

    by the_skywise ( 189793 ) on Tuesday April 06, 2004 @11:29PM (#8788597)
    I worked for a phone company in a large downtown office building that employed thousands. The building needed a new elevator system so, to save money, they had an experimental elevator system installed.

    Instead of pusing an up or down button and waiting for an elevator, you had a number pad with an LCD display. You punched in the number of the floor you wanted to go to and the LCD would display the letter of the elevator you were assigned to. There were no floor controls inside the elevator. The system would cache people onto floors, maximizing elevator efficiency, right?

    Well, in theory... but not in practice.

    The building wasn't populated evenly on all the floors. Of a 20 story building, 4 floors were in heavy use (customer service departments) 2 were used only for storage, 2 were for the switching lines and the rest of the floors had typical light office usage.

    So in rush hour in the morning the system has a notoriously bad habit of maxing out one elevator at a time for the 4 customer service floors before allocating the next. Even MORE ironic was that the program would get into a loop of cycling the same 2 elevators to serve the same heavy use floors. (One would be going up as the other would be just finishing its cycle and the program wouldn't allocate a third elevator until the one coming down was filled.)

    So you'd walk into the building at rush hour in the morning (when everybody should be wanting to just go UP) and there's a bank of 10 elevators, 5 to a wall and there'd be about 40 people crowded in front of 2 elevator doors for about 5 minutes waiting to board.

    But it gets WORSE! Alot of people would see friends they knew who had already "punched in" and would just get in line with them without punching in themselves and screw up the whole count.

    Then you had the "smart" people who would "punch in" a floor many times to get the system to allocate a third and NOT cache them in with the other loads.

    At times it was alot of fun just playing with the elevator system than actually doing work.
    (one more interesting factoid... someone writing the program must've taken the above into account because there were times when I would work late and the coworkers and I would leave at 10pm from the 16th floor. We'd both punch in within seconds of each other and get TWO elevators.)

"Gravitation cannot be held responsible for people falling in love." -- Albert Einstein

Working...