Slashdot Mirror


Non-Deathmatch: Preempt v. Low-Latency Patch

LiquidPC writes: "In this whitepaper on Linux Scheduler Latency, Clark Williams of Red Hat compares the performance of two popular ways to improve kernel Linux preemption latency -- the preemption patch pioneered by MontaVista and the low-latency patch pioneered by Ingo Molnar -- and discovers that the best approach might be a combination of both."

178 comments

  1. co-op! by FigBugDeux · · Score: 2, Funny

    whats wrong with cooperative multitasking?

    1. Re:co-op! by Anonymous Coward · · Score: 0

      You can't trust other software to function correctly.

    2. Re:co-op! by clone304 · · Score: 1


      Uhh, that was either a joke or a troll. Either way you got caught!

      .

    3. Re:co-op! by Anonymous Coward · · Score: 0

      People really do have low expectations of others these days... *sigh*

    4. Re:co-op! by Anonymous Coward · · Score: 0

      hey - millions of macintosh users can't be wrong!

    5. Re:co-op! by Anonymous Coward · · Score: 0

      The same thing that is wrong if Co-op food.
      Its full of lentils.

    6. Re:co-op! by lightfoot+jim · · Score: 2, Insightful

      I hope you're kidding! In a co-op system, each program monopolizes all the resources of the machine until it voluntarily gives up control. If the instruction to return control to other processes is preceded by instructions which could result in an infinite loop or wait state, the machine is then inaccessible. Situations like this exist in preemptive systems as minor annoyances. For example, if you ssh from and openBSD machine to a sshd server and then pull the network cable from the sshd server, the tty on the openBSD machine will stop responding to input. Since the BSD kernel is preemptive, you can switch tty's and just kill the process of the frozen tty. In a coop setup, the key sequence to switch virtual consoles would be ignored and you'd have to reboot the machine.

      --
      The state is the great fiction by which everyone tries to live at the expense of everybody else. ~F. Bastiat
    7. Re:co-op! by Anonymous Coward · · Score: 0

      hey - millions of macintosh users can't be straight!

    8. Re:co-op! by Anonymous Coward · · Score: 0

      Hey.. Mac OS ain't Co-Op anymore..
      it was up until Mac OS 8.. but 9 and X are preemptive.

    9. Re:co-op! by fredrik70 · · Score: 1

      indeed, preemptive mt just feels to... rude!

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    10. Re:co-op! by Anonymous Coward · · Score: 0

      Linux already has preemptive usermode. It's kernel space that's co-op.

    11. Re:co-op! by Pussy+Is+Money · · Score: 1
      Uh. If the BSD kernel were not preemptive, then the sshd design would have been different, so that the situation you're describing would not have occurred. Plus most (all?) coop MT systems still have something called "hardware interrupt".

      The diffference between preemption/coop is very much like the difference between using threads and blocking I/O (i.e. On a general purpose system, the cost of preemption is masked by a) the high speeds of today's processors, and b) the fact that although preemption is locally suboptimal, it yields better results globally. Still, for precisely circumscribed domains, coop will deliver better performance.

      --
      Pushin' 'n dealin', shovin' 'n stealin'
    12. Re:co-op! by sharkey · · Score: 2
      Hmm. Let me count the ways:
      • Windows 3.0
      • Windows 3.1
      • Windows for Workgroups
      • Windows 95
      • Windows 98
      • Windows 98SE

      The list goes on...
      --

      --
      "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
    13. Re:co-op! by Anonymous Coward · · Score: 0
      That's only partially true. In the context of these patches, it's certain kernel threads that being made interruptable. This is good for SMP as well as low-latency. It's not really pre-emptive vs. cooperative though, it's pre-emptive vs. non-pre-emptive.


      In terms of multitasking you're correct. However it should also be pointed out that there are performance reasons for co-op multitasking in some domains. In fact the pthreads spec allows you to use kernel pre-emptable threads and co-op threads. The rationale is that if you know how different tasks are supposed to interoperate, you can probably schedule it better than the kernel can. Also, a kernel pre-emption means a security barrier is crossed and contexts are switched. For most apps that's a drop in the bucket performance wise but suppose you had a really high resolution timer and you wanted to switch between two tasks really quickly for some reason? User threads, aka co-operative threads can allow you to do that faster than trying to rely on the kernel to do it for you.

  2. The Linux kernel preemption project by BrianGa · · Score: 5, Informative

    Check out this
    comprehensive guide to Linux Latency.

    1. Re:The Linux kernel preemption project by Anonymous Coward · · Score: 1, Interesting

      Check out this story. It was posted several hours before Slashdot got around to it.

      Pretty shameful for /.

  3. The Right Reasons by Daveman692 · · Score: 0

    This is why I love open source software. Linux will push ahead as Windows is left in the dust.

    1. Re:The Right Reasons by Anonymous Coward · · Score: 0

      yeah , but its a better piece of shit than windows.
      if we wanted real OS's on real machines we would be using SUN or an IBM OS/390

    2. Re:The Right Reasons by clone304 · · Score: 0, Offtopic


      Swamp land in Florida!!?!? Like the kind I could build a really successful theme park on? Cool!!

      Wait.. Must stop feeding trolls... ahhh!! Can't help myself.. ARGGGHHH!!! AIYEEEE!!

      .

    3. Re:The Right Reasons by clone304 · · Score: 0, Offtopic


      Fsck IE! I'm using Lynx count me among the 5% and 30% respectively.
      Of course, I do feel kindof naked without all the pretty pictures.. Wait, what are we arguing about again? Ohh, you said something irrelevant and stupid, so I laughed at you. Then I posted this stupid message. Laugh at me.

      .

    4. Re:The Right Reasons by clone304 · · Score: 0, Flamebait


      Ohh yeah.. I forgot to tell you. Fsck IE. Any fucktard that uses slow ass IE when Opera is available is a fucking moron.

      .
      And it doesn't surprise me at all that 95% of desktop users are morons. Hell, you probably use IE, and you chose Archie Bunker as a nick. You MUST be a moron. Thanks for speaking up for your species. Now please sit down and let the IQ-enabled people talk.

    5. Re:The Right Reasons by Anonymous Coward · · Score: 0

      Yes, thats why Windows is used on most desktops .

      Thats why Windows has a db behind its fs, and alows sql statments to be proformed on it.

      While linux has a handfull of users and a default fs that much its like looking at FAT.

      Trolling fun... Go on, Mod down! MOD DOWN!

    6. Re:The Right Reasons by WNight · · Score: 2

      If you want a database for a file system they've been out for decades.

      However, it's debatable if this is a good thing. Providing transactions is good, but why write an SQL interface for the whole file system? And then have to massage files into specific data types, or a whole bunch of BLOBs which you can't perform any complex operations on...

      If MS does come out with this filesystem, they won't make it a default. It'd rock for some uses and suck for others. Much like NTFS.

    7. Re:The Right Reasons by Anonymous Coward · · Score: 0
      Thats why Windows has a db behind its fs, and alows sql statments to be proformed on it.

      That's a really stupid idea. The OS design community abandoned that idea 20 years ago. As usual, Microsoft is decades behind the state of the art. But, hey, what can you expect from a company whose technological expertise is based mostly on college dropouts and interns?

      What Linux does have is a number of powerful, efficient, and innovative file systems.

    8. Re:The Right Reasons by markyd · · Score: 0

      Thats why Windows NT has had a pre-emptable kernel since version 3.1? Linux is finally catching up with Windows NT in these areas, we've had a journaling filesystem (NTFS) for years as well.

    9. Re:The Right Reasons by fredrik70 · · Score: 1

      THey don't have a db as fs yet.. that's in the next version after XP(or the version after that)
      THis have however been done b4 as already stated, with various results. BeOS used to have it but they dumped it in order for a more normal fs...
      Mind you, if one is attracted to buzzwords this is probably the way to go.

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    10. Re:The Right Reasons by David+Rolfe · · Score: 1
      Be never 'dropped' their journaled file system. Maybe you are thinking of FAT compatibility of the "trial" Beos r5. It installs the BeFS as a giant file on the FAT partition. It's still journaled, it's just written on a non-native partition.

      (Even with the "trial" version of Beos r5 you can still setup and install it onto a native partition, btw.)

      --
      Read Heinlein's 1953 Revolt in 2100, now more than ever.
    11. Re:The Right Reasons by Anonymous Coward · · Score: 0
      Maybe you are thinking of FAT compatibility of the "trial" Beos r5.

      No, he's thinking of the database filesystem Be used before the current journalled/attributed fs. Be dumped it because perfomance sucked.

  4. Wow!, what an insightful conclusion. by Ignominious+Cow+Herd · · Score: 0

    Hmmm, let's see here. The Low Latency patch makes the slowest parts of the kernel faster or breaks them into smaller pieces. The Preempt Patch allows the kernel to be interrupted in lots of places. Exactly how could combining these NOT be a good idea?

    --
    Lump lingered last in line for brains, and the ones she got were sorta rotten and insane.
    1. Re:Wow!, what an insightful conclusion. by clone304 · · Score: 0, Offtopic


      Yeah.. When I read this on OSNews, I couldn't help thinking this was really old news.
      Now to see it on /. after OSNews, I'm starting to think there's a stupidity virus travelling amongst the IT groupie crowd..

      .

    2. Re:Wow!, what an insightful conclusion. by cs668 · · Score: 2, Informative

      I agree with you except there is a critical difference between assuming that this would be the case and demonstrating that the assumptions are true.

      Clark Williams did a lot of work to prove that the assumptions you would have when looking at combining the two patches hold.

    3. Re:Wow!, what an insightful conclusion. by 1155 · · Score: 0, Offtopic

      IT groupies?

      Do they like.. travel around with you, worshiping the ground you walk on, and fetch your beer while you hack the kernel?

    4. Re:Wow!, what an insightful conclusion. by clone304 · · Score: 0, Flamebait


      Know they're usually 13 yr old trolls who end up breaking their necks trying to suck their own dicks.. But, you can believe what you want..

    5. Re:Wow!, what an insightful conclusion. by Anonymous Coward · · Score: 0

      If you're going to try to comment on one's stupidity, at least try to spell properly!

    6. Re:Wow!, what an insightful conclusion. by clone304 · · Score: 0, Troll


      Know shit!! Wat teh fack waz I thincking? You got me.

      .

    7. Re:Wow!, what an insightful conclusion. by Anonymous Coward · · Score: 0

      Yes, when trying tricks like this you gotta be careful. Takes years and years of practice...

    8. Re:Wow!, what an insightful conclusion. by by+Linus+Torvalds · · Score: 2, Informative

      Well actually we have been discussing this recently on the kernel mailing lists. I am currently deciding whether this should be incorporated into the main tree, but am concerned that it may lower throughput.

      Alan has suggested I include both patches into the next 2.5 release (though there is quite a lot going on there so it may not make it in until the next one after that) and it will be fun to see the effects on latency and throughput, especially with the new I/O subsystem, in widespread use on various architectures; Clark Williams only compared the patches on single processor machines for example, where we have to pay special attention to the various SMP archtectures out there.

      But remember! Linux is not a RTOS and I have no intention of making it one, although there are forked kernels that do exactly that.

    9. Re:Wow!, what an insightful conclusion. by Anonymous Coward · · Score: 0

      Okay, who here thinks that "by Linus Torvalds" is really Linus Torvalds?

  5. Re:I preempted the current Linux kernel by clone304 · · Score: 0


    Lol!! Mod parent up for exhibiting L337 trolling skills!

    .

  6. More serious player in the shadows by CathedralRulz · · Score: 3, Interesting

    The article doesn't mention this, but something some folks aren't aware of is that MontaVista is a serious linux partner with IBM. If the technologies described in the white paper can be merged, then the real effect can have a more significant impact in the embedded application/ PowerPC products from the World's 9th largest corporation.

  7. Pioneers will always... by Anonymous Coward · · Score: 0

    ask...is it or is it not, a good read?

    #

  8. Oooooh by NiftyNews · · Score: 4, Funny

    Don't miss the thrilling link to the debate on whether it is PreemptAble or PreemptIble...

    1. Re:Oooooh by clone304 · · Score: 1


      Nah. I'll just wait for Taco to post the definitive answer once the debate is over.. ;)

      .

    2. Re:Oooooh by OpCode42 · · Score: 1

      If you're looking to Taco for spelling, you have more problems then we thought....

    3. Re:Oooooh by sharkey · · Score: 3, Funny
      Well, let's just make it definitive. Run it through the "CmdrTaco Ofishul Spalchukkar" and let's see what we get:
      • preumtailable
      Well, there...you...go!
      --

      --
      "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
  9. SMP Scheduling Latency... by MonkeyBot · · Score: 0, Offtopic

    ...definitely sucks ass in Linux. I don't know if it is better or worse in other OSes, but we have several dual processor machines and two quad Xeon machines at work running Linux, and it seems as though if the first processor is running at max capacity, then you're just kind of shit outta luck if you try to start a process--it sometimes takes as 5-10 seconds before it'll even notice you've tried to run something and assign it to another processor that isn't doing anything.
    Does anyone else have this problem? I'm hoping it's just some kind of dumbass configuration mistake on my part and not just the way it is...

    1. Re:SMP Scheduling Latency... by Anonymous Coward · · Score: 0

      I believe that is being adressed in with the O(1) scheduler. Hopefully it will be in 2.6, does anyone know for sure?

    2. Re:SMP Scheduling Latency... by CelestialWizard · · Score: 1

      It has been in the -ac (and subsequently in -mjc) tree for quite a while.

      2.5 merged it around 2.5.4 (IIRC)

  10. Non-deathmatch, eh? by zapfie · · Score: 0, Troll

    Non-deathmatch, eh? I think I smell a Preempt vs. Low-Latency Quake 3 mod in the works..

    --
    slashdot!=valid HTML
    1. Re:Non-deathmatch, eh? by sloanster · · Score: 1

      Sheesh, I've been running low latency and/or preemptive patches for over a year. It's the only way to quake - that, and a good 3d video card.
      (used to run voodoo3, now I run nvidia geforce)

    2. Re:Non-deathmatch, eh? by Anonymous Coward · · Score: 0

      How is this a troll? What is this trolling?

    3. Re:Non-deathmatch, eh? by |DeN|niS · · Score: 1

      The nVidia binary drivers wouldn't load in a 2.4 kernel with the preemptive patch. Did I miss something? Maybe I should try again :-)

    4. Re:Non-deathmatch, eh? by Vann_v2 · · Score: 1

      Yes, I'm using them right now. I even have the card (a TNT2) overclocked using nvclock.

    5. Re:Non-deathmatch, eh? by Ramadog · · Score: 1

      Give it another go. I am using the nvidia 2313 drivers with a pre-emptive 2.4.18 kernel

    6. Re:Non-deathmatch, eh? by be-fan · · Score: 2

      They load fine. Been using a preempt+lock-break+XFS + nvidia system for several months now. Works great.

      --
      A deep unwavering belief is a sure sign you're missing something...
  11. Re:I did better by Anonymous Coward · · Score: 0

    Stupid, we all get the Sun. Those who don't leave the house notwithstanding.

  12. Re:I did better by clone304 · · Score: 0, Flamebait


    You're an idiot.

  13. O(1) already integrated... by Anonymous Coward · · Score: 2, Informative


    Ingo Molnar's O(1) scheduler was integrated
    into the development tree back around Linux 2.5.4
    So it's already in there.

    Preemption was integrated about the same time.

    1. Re:O(1) already integrated... by Anonymous Coward · · Score: 0

      I won't be satisfied until there is an O(0) scheduler.

  14. One good way to reduce kernel latency.. by thesupraman · · Score: 5, Interesting


    One thing not mentioned so far is that one of THE largest scheduler latency problems comes from the driver for a PS/2 mouse, a very common item to be found plugged into servers which have no need for it. By removing the PS/2 mouse (and driver..) a significant latency improvement can be gained!

    It's a pity that most USB mice don't seem to provide quite the quality of use as the PS/2 items (although this is probably also a driver issue)

    Loy latency can be an advantage, but it is important that the cost of the lower latency is not an increase in total load, as in reality the lower latency does not provide a large gain in performance for most desktop or server roles, but rather is a measure more often used in real time systems, which it can make the difference between a system working or not.

    An example of this is in an ignition ECU for a V12 engine at 6000 RPM, a (pair of) plug is firing every 1/600th of a sceond (1.66ms), but the accuracy of the firing even must be in the order of 10us, which is not yet reachable be any 'standard' unix kernel, but quite easy to get on a much simpler ECU (I use an SH-2 at 24 MHz) than you would notmally find using a true real-time kernel.

    With some developments is may be possibly for a form of linux to reach this level, which would be fantastic, as a LOT of time is spent in embedded development providing 'operating system' level functionality around the actual application code, and with embedded processors getting faster, and memory getting cheap, embedding *nix has become much more of a possibility.

    1. Re:One good way to reduce kernel latency.. by clone304 · · Score: 4, Funny


      Honestly, I'm not trying to troll you here, but why would you WANT to run a *nix kernel on hardware that's responsible for engine timing? Especially when you apparently already have tech that works. Is the idea just to make vehicles that much harder for people to maintain? The day my mechanic keeps a sysadmin on duty so he patch my buggy Linux 4.5.3 ECU is the day I put a gun to my head and pull the trigger.

      Aside from that. Way to inform the masses.

    2. Re:One good way to reduce kernel latency.. by Anonymous Coward · · Score: 0

      It's a pity that most USB mice don't seem to provide quite the quality of use as the PS/2 items

      I use the Microsoft Wheelmouse Optical. You can find it for about $20, and it works flawlessly under Linux. (gpm has no trouble sorting out which buttons are which, and the scroll wheel works.) Use You can use it as a PS/2 mouse with an included adapter, but I always use it as a USB mouse.

      Get a KVM switch that will switch USB, and plug your mouse and keyboard into it. Then remove PS/2 support from your servers' Linux kernels, and you are good to go.

      ps. Here is my /etc/gpm.conf file. This is from Debian.

      device=/dev/usbmouse
      responsiveness=
      repeat_ty pe=raw
      type=imps2
      append=""
      sample_rate=

    3. Re:One good way to reduce kernel latency.. by Anonymous Coward · · Score: 0

      It's a shame that FreeBSD implemented both of these latency-reducing setups, as well a 1-order scheduler AND a working VM systems years ago, huh? What a toy...

    4. Re:One good way to reduce kernel latency.. by Anonymous Coward · · Score: 0

      What are you talking about?

      FreeBSD has terrible worst case latency, and is fully non-preemptable. Perhaps once SMPng is done, they can leverage that work to provide preemptability.

      FreeBSD also certainly does not include a multiqueue O(1) scheduler; there is no reason to, since only one process can be in the kernel at a time, there is no reason to have per CPU run queues.

      You idiot "advocates" who don't know what you're talking about, but are sure that everything that isn't your preferred system is crap do more harm to your preferred system than any competitor possibly could.

    5. Re:One good way to reduce kernel latency.. by Jah-Wren+Ryel · · Score: 2, Funny

      Forget about mechanics. Just let us telnet into the engine and we can fix it ourselves.

      --
      When information is power, privacy is freedom.
    6. Re:One good way to reduce kernel latency.. by Anonymous Coward · · Score: 0

      Its hard to put such a stringent lower bound on interrupt servicing with TLB's, many layers of caching, asynchronous DRAM etc etc. Hard to construct model's and proof's for, unlike with simple controllers where you can pretty much run through all the possible scenarios in your head.

      You wouldnt want to use a PC for something like that, wether linux was pre-emptable or not.

    7. Re:One good way to reduce kernel latency.. by iabervon · · Score: 2

      The performance tests that various people have run with these patches seem to show improvements in throughput on servers. The guess is that this is because the machine will respond more quickly to the completion of I/O (which is, of course, is the slow step on most applications), so it essentially arranges tasks so that the next I/O operation can get started sooner.

      Of course, you'd presumably get a higher load, since you're doing your task in less time, which means that the processor is busy more of the time.

      Additionally, latency is important for interactive tasks on desktop machines, because it determines how responsive the system feels under load. The user's experience is determined more by how quickly the system responds to simple requests (moving the mouse cursor, drawing menus, etc) than by the milliseconds place on more complex tasks. Furthermore, the user will instantly notice if sound or video is not handled on time.

    8. Re:One good way to reduce kernel latency.. by Junta · · Score: 2

      Interesting what you say about USB mice, in my experience a USB mice provides smoother use than PS/2. I don't have PS/2 at all in my kernel anymore. With my Logitech MouseMan+, it came as USB with a PS/2 converter. I had to use it because I played with BeOS and BeOS didn't like it unless it was on the PS/2 port. In any case, when using a USB port instead of PS/2, the mouse can be polled much more frequently, allowing for more precise movement (particularly of interest in, say, first person shooters). Plus, the ability to plug and unplug, and plug my mouse into any USB port I feel like is nice.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    9. Re:One good way to reduce kernel latency.. by Junta · · Score: 2

      What you say about desktop responsiveness being more of an issue for these patches than server applications is accurate. And I agree that mouse and audio responsiveness is very noticable to user (if audio skips, very loud popping is usually heard). However, with video there is a little more wiggle room if the decoder handles things gracefully. Even if interrupted for 2/30s to even a tenth of a second as an isolated incident, you can probably get away with it. Certainly 1/30th of a second will almost certainly not be noticed (single frame drop), 2/30ths (2 frames) probably will slip under the radar. 3 frames dropped and then you start getting into a perceptible skip if there is a decent amount of movement in the scene. Of course, 1/30th of a second is much higher than most all latencies you see even under the unpatched kernel.

      I personally haven't been able to tell between the pre-empt kernel and traditional, they both give the same 'feel' on the desktop level.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    10. Re:One good way to reduce kernel latency.. by cduffy · · Score: 2

      Having a Linux kernel doesn't mean having a Linux userland -- and almost all bugs that actually affect the end-user are userspace bugs, or kernel bugs that are only visible with a big userspace (ie. networking bugs -- if you don't need networking you don't compile it into your kernel, and so it never hits you). If you're doing a deeply enough embedded system, you don't need that userspace, so you don't *have* most of that userspace (heck, you can do without any of it if you like)... and there's only one application that the kernel runs (yours!) and only one set of hardware it runs on (yours!) and so it can be very thoroughly tested. Even when updates are needed, flashing a new kernel in (which happens to have an initrd with the one and only application it runs) isn't exactly rocket science, and certainly doesn't need a sysadmin.

      Do you really think that companies doing their own proprietary kernels come up with something more reliable? For the most part, they don't -- but once a deeply embedded system is out the door, the rule is that it'll Just Work the way it did in the lab, because for that embedded system nothing (the hardware, the software, the input, the output, whatever) ever changes from what it was designed and tested on -- or if it does, you've got bigger problems.

      That's less true for less deeply embedded systems... but those are where something like Linux is even more appropriate.

    11. Re:One good way to reduce kernel latency.. by cduffy · · Score: 2

      Under regular loads, yes.

      Under high loads, when playing audio, the difference can be quite remarkable.

      I'd be curious to know under what kinds of loads the tests documented here were run.

    12. Re:One good way to reduce kernel latency.. by Junta · · Score: 2

      I was just making blanket statements about visual percetption and how many frames can be dropped without being noticed. It's anecdotal, but I have seen some clips that can drop up to 40% of frames without much noticed (very low motion video). But if there is only enough of a glitch to interrupt a frame or two of video, then it will be smoothed over by the sensory system without it ever being missed, while with audio, any interruption will result in a waveform that has an undefined derivitave, a crack in the audio. Under very heavy loads, you'll drop more than 1-2 frames per second, you'll have probably up to 40-60% frame drop, and for almost any content that would indeed be noticable.

      In any event, low latency is good, and my entire point is irrelevant except as a nitpick.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    13. Re:One good way to reduce kernel latency.. by Anonymous Coward · · Score: 0

      I don't understand what you just said, but FreeBSD definitely does have the problem what that other guy said, whatever that meant.

    14. Re:One good way to reduce kernel latency.. by FlyingDragon · · Score: 2, Funny
      The day my mechanic keeps a sysadmin on duty so he patch my buggy Linux 4.5.3 ECU is the day I put a gun to my head and pull the trigger.

      If you use an early development kernel in a production engine, you deserve what you get.

    15. Re:One good way to reduce kernel latency.. by ivan256 · · Score: 2

      I certainly hope that your USB mouse driver is interrupt driven. There shouldn't be any polling going on, as that would be an enormous waste of system resources. Similarly the origional post was dubious at best, since PS/2 ports can also generate interrupts. A still mouse should use *zero* system resources. USB does have higher throughput then PS/2, so theoretically the mouse could send updates much more frequently then the PS/2 equivalent, and that would account for smoothness.

    16. Re:One good way to reduce kernel latency.. by ejasons · · Score: 1

      That depends on whether you are talking consumer or professional video.

      If your target is professional video, the customer will scream loudly if even a single frame is dropped (and they will check), or if any fields are reversed, etc.

      Though for these applications, you really need guaranteed real-time performance anyway, for which a RTOS or (possibly) Real-Time Linux is more appropriate. It could also possibly be done with a kernel thread...

    17. Re:One good way to reduce kernel latency.. by iabervon · · Score: 2

      That's interesting; I thought people would notice a dropped frame just because it would mean that one frame would be shown twice as long as any of the rest, so everything would stop for a moment and then jump forward to the right place. Of course, traditionally when a frame gets dropped, the person sees a blank frame or static or something unrelated to the scene; people don't notice these at all, because the brain is wired to ignore them (because you blink and so forth). But having a frame update dropped means you'll see the previous frame for twice as long, which appears as a change in the motions of objects, which the brain is tuned to see.

      I'm not sure exactly how many frame updates you can miss without people noticing, but it's got to be a lot fewer than frames you can blank without anyone noticing, especially if it's not consistent.

    18. Re:One good way to reduce kernel latency.. by Ed+Avis · · Score: 1

      Can you explain why the PS/2 mouse causes latency problems? Even when you're not moving it?

      --
      -- Ed Avis ed@membled.com
  15. Interrupt priorities by ChaosDiscord · · Score: 4, Funny
    Most RTOS's prioritize device interrupts so that important interrupts ("shut down the reactor NOW!") are serviced first and lower priority interrupts ("time to make the doughnuts") are serviced later.


    Clearly, most RTOS designers have their priorities backwards.



    Mmmm, donuts.

  16. Re:Mirror by Anonymous Coward · · Score: 0

    And some wonder why you post at -1. Oh well, at least it's an improvement on the "Alan Thicke is dead" posting.

  17. Re:I did better by (outer-limits) · · Score: 3, Funny

    The only real OS is MVS, aks OS/390 aka Z/OS. It is truly an operating system. It makes no concessions for mere mortals, it is made to run a machine. It hails from 1966. All bow down before it.

    --

    Microsoft - Where would you like to go today, Maybe Jail?

  18. liquidpc by blendin · · Score: 0, Flamebait

    you are a fuckin cheat...you will never defeat me

  19. What's up with the degrading performance? by A+Commentor · · Score: 2, Informative
    The low-latency patches had a maximum recorded latency of 1.3 milliseconds, while the preemption patches had a maximum latency of 45.2ms.

    A 2.4.17 kernel patched with a combination of both preemption and low-latency patches yielded a maximum scheduler latency of 1.2 milliseconds, a slight improvement over the low-latency kernel. However, running the low-latency patched kernel for greater than twelve hours showed that there are still problem cases lurking, with a maximum latency value of 215.2ms recorded. Running the combined patch kernel for more than twelve hours showed a maximum latency value of 1.5ms.

    So after only 12, the low-latency patch degraded by an ungodly amount (1.3 -> 215.2 ms)!! and even the combined patch had a 25% degraded performance(1.2 -> 1.5 ms)!

    Embedded systems must have a very high uptime, it's not acceptable to reboot the machine every day to maintain performance. Many embedded systems require a downtime of less than 5 minutes per year. That doesn't give you much time to reboot the machine just for performance issues.

    --

    Looking for any old 8-bit Heathkit/Zenith software/hardware - http://heathkit.garlanger.com

    1. Re:What's up with the degrading performance? by dmiller · · Score: 3, Insightful

      It has got nothing to do with how often the machine is rebooted and everything to do with the frequency of latency increasing events.

      The event which caused the 215ms even probably only happens once or twice per day. Perhaps it was some weird code path that the LL patch didn't touch, or some unlikely combination of events occuring "simultaneously"

    2. Re:What's up with the degrading performance? by tempest303 · · Score: 4, Interesting

      What's up with the degrading performance?

      It's called a bug - they'll figure it out. ;)

      it's not acceptable to reboot the machine every day to maintain performance

      Hey, it worked for NT4 admins, why not for embedded developers? *rimshot*

      Sorry. But seriously, anyone looking for hardcore low latency in Linux right now for systems that need that buzzword compliant "five 9's" should probably wait on using Linux until it's READY. Make no mistake, with as much interest and developer hours as are going into it, Linux WILL make it into this market, and it will succeed; it's merely a matter of time. (and hell, at this rate, it may not be long...)

    3. Re:What's up with the degrading performance? by Fluffy+the+Cat · · Score: 4, Informative

      So after only 12, the low-latency patch degraded by an ungodly amount (1.3 -> 215.2 ms)!!

      You're misinterpreting the figures. After a short benchmarking, the worst figure recorded was 1.3ms. After the machine had been left up for 12 hours (thereby allowing there to be much more time for something odd to crop up), the worst figure recorded was 215.2ms. That doesn't mean that the performance had degraded - it means that over the course of those 12 hours, something happened that caused latency to peak at 215.2ms. It might be something that happens once every 12 hours, for instance.

    4. Re:What's up with the degrading performance? by steveha · · Score: 5, Insightful

      Well, to be precise, the worst-case value "degraded". And I'm not sure "degraded" is the correct word. With a huge torture load put on the kernel, during a 15-hour interval, at least once the latency value was 215.2 msec. This could mean that there is a possible latency condition that happens under torture load approximately once every 15 hours. It could also mean that after 15 hours, your chance goes up so it could happen much more often than that, but we don't know that. It could even mean that there is a possible 215 msec latency condition that happens under torture load approximately once every 30 hours, and it happened to occur during the first 15 hours.

      Embedded systems must have a very high uptime, it's not acceptable to reboot the machine every day to maintain performance.

      True that. Which is why the author of that article made the point that combining the two patches is the best way to go, since he ran the torture test for 15 hours and it didn't go over 1.5 msec even once.

      Note that for many purposes, a worst-case latency of 1.5 msec is ample. I don't think there is any version of Windows that goes that low; I don't even think BeOS (legendary for low latency) goes that low. As the author noted, if you are driving a chemical processing factory or something like that, you need hard realtime and you should use something other than Linux kernel 2.4.x!

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    5. Re:What's up with the degrading performance? by rabidcow · · Score: 1

      It might even be something that happens just as often on with the combination patch as with the low-latency patch, except the combo got lucky.

    6. Re:What's up with the degrading performance? by SurfsUp · · Score: 4, Informative

      It might even be something that happens just as often on with the combination patch as with the low-latency patch, except the combo got lucky.

      If you'd actually read the article you'd know that this can't happen with the preempt patch + low-latency, not unless a spinlock gets jammed, then you have much worse problems. The preempt patch takes care of scheduling events that occur during normal kernel execution (and it does this much more reliably than the low latency patch) but since preemption isn't allowed while spinlocks are held, it can't do anything about latency due to spinlocks. This explains the apparently worse performance of the preempt patch - you're just seeing the spinlock latency there.

      The low latency patch breaks up the spinlocks with explicit scheduling points, which is pretty much the only approach possible without really major kernel surgery. That's why the combination works so well. In fact, the parts of the low latency patch that aren't connected with breaking up spinlocks aren't doing anything useful and should be omitted. The worst-case performance won't change.

      --
      Life's a bitch but somebody's gotta do it.
    7. Re:What's up with the degrading performance? by Anonymous Coward · · Score: 0

      Somehow I got a picture of a heavy-duty daily cron-job into my head. Like the update-db stuff.
      Embedded systems don't need that.

    8. Re: What's up with the degrading performance? by Luke+Marsden · · Score: 1

      Oh for an interquartile range.

    9. Re:What's up with the degrading performance? by rabidcow · · Score: 1

      Oh sure, bring reality into a good discussion of statistics...

    10. Re:What's up with the degrading performance? by lars_stefan_axelsson · · Score: 1
      Somehow I got a picture of a heavy-duty daily cron-job into my head. Like the update-db stuff. Embedded systems don't need that.

      On the contrary, testing for embedded systems needs just that, if that's what it takes to find the outliers. We're trying to find the worst case here you know.

      Sort of works most of the time, if you don't run any cron jobs, or a similar load, doesn't quite cut it in semi hard real time systems.

      --
      Stefan Axelsson
  20. Measuring latencies? by acordes · · Score: 3, Interesting

    Here's a question. How do you go about doing fine grained measurements of these latencies? Every time I've tried doing timings with Linux I've had problems being able to get accurate, fine grained results.

    1. Re:Measuring latencies? by Pussy+Is+Money · · Score: 1

      What kind of accuracy do you need? I find that gettimeofday() will give approx. ~5 ms accuracy (non-root, nice 0). Interfacing directly with the RTC on x86 gives you approx. ~10 usec accuracy (root, SCHED_FIFO, nice 0).

      --
      Pushin' 'n dealin', shovin' 'n stealin'
  21. It's all for not as long as HZ=100 on x86 by Anonymous Coward · · Score: 0

    We live in an age of multi GHz machines, yet we only have a timer that can go off 100 times per second on IA32. When can we join the real world (Alpha, Sparc) and get a 1024 HZ timer -- or even better -- get rid of HZ altogether. Realtime MIDI on Linux sucks unless it is the only process monopolising 100% of the CPU.

  22. Nice Try Montavista by Anonymous Coward · · Score: 0

    Unfortunately, the preemptable kernel was not pioneered by Montavista. The real developers were by the Real-Time Linux project. I believe there are several long-standing law-suits between the two. All of which the RTL people have won.

  23. No way can you reach it.. by Anonymous Coward · · Score: 0

    >"13 yr old trolls who end up breaking their >necks trying to suck their own dicks"

    "Do people actually try that??"
    "Yup, some do"
    "I tried once, I couldnt reach it."
    "Sick bastard."

  24. You can make a difference in the Linux kernel! by Anonymous Coward · · Score: 0

    You can start by submitting patches to the Linux Kernel Mailing List of code indented to 5 spaces, as is the standard in south america. The kernel maintainers always appreciate well indented code, and Linus usually integrates such patches almost immediately. But I must warn you - patches involving fewer than 50 files are rarely accepted by Linus. He wants to see a lot of effort on your part and weed out those "code indenter wannabees". Fortune 500 companies are always on the look out for industrious, self-starting code (re)indenters and are willing to pay big $$$. Get indenting today!

  25. Works very well here by robinjo · · Score: 1

    I've found SMP on Linux to work very well. There are definitely no delays on my dual cpu workstation and dual cpu server. I've even done some extensive bvenchmarks which show that Linux scales very well. At least compared to NT4/W2K where the results were dreadful.

    I'm sorry that I can't offer any help but I hope you find where the problem is.

  26. Re:More serious player in the shadows-IBM by Anonymous Coward · · Score: 0

    So in an indirect fashion, we have IBM to thank.

  27. Custom Redhat RPM's by nuintari · · Score: 2

    Anyone know if Redhat is planning on offering lower latency kernel RPM's for those of us who are loath to patch and recompile a kernel JUST to try something new out to see if we like it. Its kind of nice if I can drop in a quick RPM, decide weather I like it, and THEN compile a trimmed kernel properly if need be.

    I'm just lazy. :-)

    --

    --Nuintari

    slashdot : where an opinion can be wrong.

    1. Re:Custom Redhat RPM's by Anonymous Coward · · Score: 0

      Oh come on. It sounds like you just don't know how to compile the kernel. Spend the time and learn.

  28. la... by nickynicky9doors · · Score: 2, Funny

    ...tency

    --

    heuristic algorithm seeks stochastic relationship
    1. Re:la... by Ignominious+Cow+Herd · · Score: 0

      ....Wait for it........

      --
      Lump lingered last in line for brains, and the ones she got were sorta rotten and insane.
  29. A good paper, but... by software_non_olet · · Score: 2

    I'm missing on Clark Williams' paper how the patches influenced the OS overhead.

    1. Re:A good paper, but... by Spider[DAC] · · Score: 1

      Do you have a good suggestion on how this would be measured? Please, I'd love to try it out myself with the O(1)+preempt patches...

      --
      I didn't do this, now did I?
    2. Re:A good paper, but... by software_non_olet · · Score: 1

      Given the test-setup of Clark Williams the natural way to measure the impact of those kernel patches IMO would be to summarize the results of the different tests for each kind of test independantly.

      The differences between the unpatched kernel and the patched versions than would give an estimate how the patches influence the overall system behaviour.

      The CPU-intensive tests are then an indication what influences the patches have on pure OS overhead, while the IO-intensive tests show the (hopefully positive) effects of latency reduction.

      A rough and unscientific measurement method, but easy to implement (e.g. just counting the number of times each particular test was run during the test-period). Of course all the tests would influence each other, but that's not in opposition to the heuristic/stochastic test-setup and well in tune with the goal to improve the real-time behavour without changing the overall effiency of linux negatively.

      Just a dummies way to measure immeasurable things.

  30. NGPT in 2.4.19-pre3. by tyrr · · Score: 1
    On the related note Next Generation POSIX Threads (NGPT) made it into the official kernel (2.4.19-pre3). Kudos to the team.


    So many very good things happen to Linux kernel! I am impressed.

    1. Re:NGPT in 2.4.19-pre3. by wangi · · Score: 1
      On the related note Next Generation POSIX Threads (NGPT) made it into the official kernel (2.4.19-pre3). Kudos to the team.

      This must really piss off the folk who have worked hard on LinuxThreads (the thread support in glibc) over the years! A number of LinuxThreads shortcomings are due to kernel support not being forth coming...

      Interesting times ahead...

  31. QNX vs. Linux by Anonymous Coward · · Score: 1, Informative

    I would like to see similar response graphs for QNX or other RTOS's for comparisons sake.

    Anyway IMHO to make a real assesment for any 'hard' realtime tasks is much too much effort for most of the readers here. =)

    But here are more white papers than you can shake a stick at....

    http://www.ece.umd.edu/serts/bib/index.shtml

    1. Re:QNX vs. Linux by Anonymous Coward · · Score: 2, Interesting

      "Interrupt and process latency

      All times given below are in microseconds (sec).

      Processor_______Context____Interrupt Latency
      Pentium/133_____1.95_______4.3
      Pentium/1 00_____2.6________4.4
      486DX4__________6.75_______ 7
      386/33__________22.6_______15

      With nested interrupts, these interrupt latencies represent the worst-case latency for the highest priority interrupt. Interrupt priority is user-definable and the interrupt latency for lower-priority interrupt sources is defined by the user's application-specific interrupt handlers. "

    2. Re:QNX vs. Linux by RoosterT · · Score: 1
      Ask and ye shall receive...

      Thorough evaluations of several RTOS's can be found here. Free registration required.
      For those that choose not to read the report, the worst-case scheduling latency for QNX is about an order of magnitude better than a preemtive Linux kernel (actually Windows CE 3.0 appears to be considerably more deterministic than Linux too).

      More importantly the latency in QNX is deterministic, while the scheduling latency under Linux (IIRC) grows linearly with the number of threads in the system.

  32. Interrupt latency in Windows CE 3.0 by jawahar · · Score: 2, Informative

    Well, Windows CE 3.0 provides 50 ms latency response time running on a 166 MHz Pentium.

    1. Re:Interrupt latency in Windows CE 3.0 by Anonymous Coward · · Score: 0

      If WinCE ran on Pentium-based systems we would all know about it, or have I been running pentium CPU's in my pocket for the last 3 years???

    2. Re:Interrupt latency in Windows CE 3.0 by Anonymous Coward · · Score: 0

      Low latency is considered in the 1ms range, so WinCE is off by a factor of 5000% ! (or maybe that was your point?)

    3. Re:Interrupt latency in Windows CE 3.0 by MenTaLguY · · Score: 1

      It runs on 486+ x86 as well as a few other non-intel arches. Your PocketPC, however, is indeed most likely not intel-based.

      --

      DNA just wants to be free...
  33. Time to ease up. by Anonymous Coward · · Score: 0

    Look carefully at the history of the postings. I use to think that a lot of these bad postings were overzealous users, but I no longer think so. Slashdot use to be really interesting, but it is now controlled by trolls. But, I am really starting to believe that many of these trolls are paid ppl whose jobs are meant to destroy OSS esp. Linux. But other than that, thanks for the info. I get tired of all the FUD about who has what.
    Personally, I only run and code on linux these days so I no longer am aware of who has what.

    1. Re:Time to ease up. by Anonymous Coward · · Score: 0

      If Linux can be destroyed by AC and -1 posts on Slashdot, it's pretty much a lost cause anyway.

  34. There was a fight? by Anders · · Score: 2

    I never realized there was competition between the two. I did hear the low-latency crowd claim that it was lower risk due to its less invasive nature. However, that hardly says anything about the performance of either approach - or that they should be mutually exclusive.

    Two wrongs doesn't make a right, and vice-versa (but two Wrights make an airplane).

    1. Re:There was a fight? by Pussy+Is+Money · · Score: 1
      Linux has a long-standing "kernel code is not preemptible" tradition and quite a bit of design hinges on that presumption (see /usr/src/linux/Documentation/smp.tex for example). So naturally there has been some resistance against recklessly applying preemption whereever it appears (not) appropriate.

      In particular Alan Cox (perhaps not coincidentally also the author of the document referenced above) has been hammering on the fact that preemption can break code that needs to consider the timing requirements of the hardware itself; simply put, you do not want code that is busy interfacing with a device to be preempted for possibly long periods of time because the device might not have that kind of patience. So any kind of preemption patch would need to address these issues, and you end up touching lots of files just like the low-latency patch does.

      --
      Pushin' 'n dealin', shovin' 'n stealin'
  35. Low-latency and Preemptible on my Notebook by hazzzard · · Score: 3, Funny
    I am using a low-latency kernel on my notebook at the moment and I can report the following behavior:
    • In X (KDE), I can move windows around, load programs, webpages etc. without my MP3-player ever beginning to skip.
    • When doing massive file IO, the MP3-player begins to skip. tar cvzf file.tar.gz bla/ is still ok, but cp -R bla1 bla2 causes massive skipping.
    • When I use the notebook as a samba server, things get worse. Still, massive skpping. Additionally, the samba becomes dog-slow and even the mouse falls asleep.
    • Often times, after such phases of heavy load, the skipping and sound-distortion remains! So I have to reboot the machine from time to time to enjoy music again. Closing the player and opening it again is not enough. Somehow, under heavy load things get messed up enough to make a recovery impossible.
    I did use the preemptive patch before, but performance under heavy load was even worse and the similar problems with rebooting occurred. I was using kernel 2.4.12 for preemptive and I am using kernel 2.4.17 currently. The machine is a Celeron 466 with 128 megs of ram. Still, the low-latency patch makes sense for machines that are primary for playing MP3s and reading emails (that's what my notebook is), but not for desktops with a wider variety of usage patterns. It's just not ready for primetime yet, but it's promising and fun!
    1. Re:Low-latency and Preemptible on my Notebook by Adnans · · Score: 2

      Are you scheduling your MP3 player at a higher prioritary (*) than say, your cp command? It is very important that you do this. While this might not fix the massive skipping it could improve things a great deal. Given, there are still lots of problems with the disk I/O subsystem in Linux that neither the preempt or ll patches fix right now so the occasional skip under heavy load is guaranteed, especially since consumer grade audiocards are not really catering towards low latency.

      <plug>

      AlsaPlayer comes with a --realtime switch that enabled SCHED_FIFO scheduling for the audio thread, this eliminates skipping for most people, but requires the binary to be run as root (or be suid root)

      </plug>

      -adnans

      (*) scheduling something at a higher prio usually requires running the program suid root, or calling renice(8) as root with the programs pid. A better method is to sudo the nice command for the given user so he/she can nice the app at the start

      --
      "In short: just say NO TO DRUGS, and maybe you won't end up like the Hurd people." --Linus Torvalds
    2. Re:Low-latency and Preemptible on my Notebook by Pussy+Is+Money · · Score: 1
      There are four things you could look at.
      • VM swapping. Linux VM still has the propensity to hold onto cached stuff even after phys Mem has been depleted. Get more RAM or tune your VM.
      • Audio drivers. There are basically three alternatives for sound on Linux, the free OSS drivers, the for-pay OSS drivers, and the ALSA drivers. I've had very good results with the for-pay OSS drivers, but you should collect them all -- the sound distortion remaining even after closing/opening the sound device is a definite driver problem, possibly related to brain-damaged hardware getting DMA transfers wrong.
      • Disk speed or controller funkiness. Are there any known issues for your chipset/drive?
      • CPU speed. A mobile celeron 466 is simply not that fast, although your problem seems to be more I/O than CPU related.
      --
      Pushin' 'n dealin', shovin' 'n stealin'
    3. Re:Low-latency and Preemptible on my Notebook by spencerogden · · Score: 2

      Reports like these make me curious. I have a desktop with the exact same specs. Yet I have never experienced any skipping when using XMMS. Whether I am doing large file copies, compilation... nothing. This is under both Mandrake and Sorcerer. Is there a variable here which is being missed? I have never needed to renice anything.

    4. Re:Low-latency and Preemptible on my Notebook by Luke+Marsden · · Score: 1

      Your problem likely has little to do with the way the kernel handles CPU scheduling, but rather the interrupts from your hdd controller and soundcard. You might be able to test this to a degree by putting the mp3s into a ramdisk and trying the same operations.

      I had exactly the same kind of mp3 skipping problems on my desktop machine for a long time, until a friend introduced me to hdparm, which allows you to set your IDE controller to DMA mode. Try it. The difference is breathtaking. Combine that with 2.4.19-pre2 and preempt and you have a smoooth desktop system :)

      I just put the following in a startup script, and everything's highly froody.

      hdparm -d 1 -W 1 -u 1 /dev/hda

  36. Re:I don't understand by Anonymous Coward · · Score: 0

    I see you've been studying the Trolling FAQ and you seem to have put many of the key principals into effect in your post. It's a little too obvious though.

    Never mind, keep practicing.

  37. Weighted mid points by AntDaniel · · Score: 1

    Why the suprise? So many time I find that the best solution to a problem is a compromise between two or more extreme solutions.

    1. Re:Weighted mid points by Pussy+Is+Money · · Score: 1

      There is no surprise. Just published findings.

      --
      Pushin' 'n dealin', shovin' 'n stealin'
  38. Worst of both worlds by Anonymous Coward · · Score: 1, Funny

    To paraphrase the great philospher Hobbs, Linux is theworst of all possible worlds.

    1. Re:Worst of both worlds by Anonymous Coward · · Score: 0

      Firstly it is spelt Hobbes. Secondally the 'Best of all possible worlds' quote comes from the philosophy of Leibinz, and ridiculed by Voltaire.

      If you are going to try to be interllectual then at least be so!

    2. Re:Worst of both worlds by Anonymous Coward · · Score: 0

      Your intellectual prowess must not be as good as you think it is, because you totally got fished into that dude. Hook, line, and sinker.

    3. Re:Worst of both worlds by Anonymous Coward · · Score: 0

      LeibiNZ ?

  39. Good article, good contribution by mikera · · Score: 4, Informative

    Some very thoughtful analysis clearly went into this. It's well written up with explanations that hit the right balance of having the key technical details but focusing on the big picture of how to make applications run better under Linux. As a casual follower of kernel development, I now understand far more of the trade-off than I used to.

    I always think that tests and write-ups like this are a great way that people can contribute to Linux development without having to hack the kernel directly. There's no substitute for a thorough testing to help you improve your designs and theories.

    Nice job!

  40. No argument here, move along. by Chops · · Score: 4, Insightful
    From the article:
    Back in early November 2001, I started following a discussion between two factions of the Linux kernel community ... There were two main factions, the preemption patch faction and the low-latency patch faction. Both groups were very passionate (i.e. vocal) about the superiority of their solution.

    Er... while some misinformed folks have in fact been arguing over "which approach is better," both Robert Love (preemption) and Andrew Morton (low latency), the authors of the patches, have agreed since before November that a hybrid approach is probably correct, and it seems to me (though I don't speak for them) that they're faintly embarassed at the number of True Believers who have stepped up to champion one or the other's side in this nondeathmatch. They're attacking different sections of the same problem.
    1. Re:No argument here, move along. by Alsee · · Score: 3, Funny

      some misinformed folks have in fact been arguing over "which approach is better"

      They are both wrong. The correct solution is to remodulate the preemption and vent the latency through the Bussard collectors.

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  41. Low-lat patch does nothing if the task isnt schRT by Anonymous Coward · · Score: 0

    Hey, genius, your task needs to be SCHED_RT to get any advantage from the low latency patch.

  42. Re:Low-lat patch does nothing if the task isnt sch by Pussy+Is+Money · · Score: 0

    Nope, that's not true.

    --
    Pushin' 'n dealin', shovin' 'n stealin'
  43. Another article by Onan+The+Librarian · · Score: 2, Informative

    I wrote an article about low-latency for audio
    applications under Linux, you can read it here if interested:

    http://linux.oreillynet.com/pub/a/linux/2000/11/ 17 /low_latency.html

    It's more of a hands-on article, tells you how
    to do it yourself with Andrew Morton's patches.

  44. My take on the results and the future by sagei · · Score: 5, Informative

    First, I wanted to give my view of the results - what they mean and what that means. Note there are multiple notions of latency performance. Average latency and worst-case latency, among others, but those are most important. This test measured worst-case latency. Both are important - for user experience average case is very important and for real-time applications worst-case is very important.

    It is not a surprise the low-latency patches scored better, or that the ideal scenario was using both. The preemptive kernel patch is not capable of fixing most of the worst-case latencies. This is because, since we can not preempt while holding a lock, any long durations where locks are held now become our worst-case latencies. We have a tool, preempt-stats, that helps us find these. With the preempt-kernel, however, average case latency is incredibly low. Often measured around 0.5-1.5 ms. Worst-case depends on your workload, and varies under both patches.

    Now, the results don't mention average case (which is fine), but keep in mind with preempt-kernel it is much lower. The good thing about these results are that it does indeed show that certain areas have long-held locks and the preempt-kernel does nothing about them. Thus a combination of both gives an excellent average latency while tackling some of the long-held locks. Note it is actually best to use my lock-break patch in lieu of low-latency in combination of with preempt-kernel, as they are designed and optimal for each other (lock-break is based on Andrew's low-latency).

    So what is the future? preempt-kernel is now in 2.5 and, as has been mentioned, Andrew and I are working on the worst-case latencies that still exist. Despite what has been mentioned here, however, we are not going to adopt a low-latency/lock-break explicit schedule and lock-breaking approach. We are going to rewrite algorithms, improve lock semantics, etc. to lower lock-held times. That is the ease and cleanliness of the preemptive kernel approach: no more hackery and such to lower latency in problem areas. Now we can cleanly fix them and voila: preemption takes over and gives us perfect response. I did some lseek cleanup in 2.5 (removed the BKL from generic_file_llseek and pushed the responsibility for locking into the other lseek methods) and this reduced latency during lseek operations -- a good example.

    So that is the plan ... it is going to be fun.

    --

    Robert Love

    1. Re:My take on the results and the future by pabs · · Score: 1

      I've played around with both low-latency and preempt, and preempt "feels" smoother to me. Overall, the combination I like the most is preempt + lock-break.

      --

      Odds of being killed by lightning and winning the lottery in the same day: 1 in 2^55

    2. Re:My take on the results and the future by Nick+Barnes · · Score: 2, Informative
      Now, the results don't mention average case (which is fine), but keep in mind with preempt-kernel it is much lower.

      The results do mention the average latency. For the vanilla kernel it is 88.3 microseconds. For the low-latency patch it is 54.3 microseconds. For the preemption patch it is 52.9 microseconds. Is 52.9 much lower than 54.3?

    3. Re:My take on the results and the future by Anonymous Coward · · Score: 0

      I took him to mean 'are much lower than the worst-case'.

  45. "Man Versus System" by Anonymous Coward · · Score: 0

    according to the IBM (Immense Blue Monolith) dictionary...

    Sectors, we don't need no steenking sectors... your files should all be contiguous cylinders!

  46. Warning! Mediocre(bad) design follows. by Anonymous Coward · · Score: 0

    According to the article, low latency patches allows manufacturers to create low quality LoseModems, as the article indicates:

    'Another example is companies that are implementing DSL modems with minimal hardware. To reduce the cost of the device they want to do away with the Digital Signal Processors (DSPs) that are used to process the analog signals on a phone line into DSL cells or frames. They do this by offloading the signal processing algorithms to the main processor (similar to the things that the infamous WinModems do). To successfully implement this sort of scheme requires that the interrupt dispatch latency and thread scheduling latency be minimized in the kernel.'

    WE CANNOT ALLOW THIS TO HAPPEN! An high quality operating system should NEVER allow or encourage hardware manufacturers to dumb it down to Windoze levels of hardware mediocrity!! We MUST AGAINST LOSEMODEMS ON LINUX!!!

  47. Re:Warning! Mediocre(bad) design follows. by Anonymous Coward · · Score: 0

    It pisses me off when I hear brain-dead schemes like this. Offloading tasks to dedicated hardware is plain good engineering. It increases system performance. Give me a dedicated DSP any day. It's not like they are expensive. Less than 5 bucks for a high performance DSP. And the payback is amortized across thousands of hours of use.

  48. How much difference? by Jeppe+Salvesen · · Score: 2

    Low latency, pre-emptive. All nice and good. However, what I really want is to get a super-fast connection between my database server and my application server. How much will the lower latency patches affect the throughput, given that I operate in multiple small queries? (No way around it, at the moment. So please don't flame (too hard))

    Will Ethernet devices, TCP/IP stacks and the lot become more responsive? Will MySQL/PostgreSQL/SapDB/Oracle/DB2/Interbase be able to execute a small query even faster? How much?

    Actually, I hope to measure this sometime not too far into the future!

    --

    Stop the brainwash

    1. Re:How much difference? by Ramadog · · Score: 1

      It is something I want to look more closely at. I like the pre-emptive + lock-break kernel on the desktop so I tried it on a small server. With Postgreslql the initial results were that with a standard 2.4.18 kernel the database was slightly faster. A rebuild of the database from the raw data was about 3 seconds quicker over a 4 minute time period. The search I was doing normaly takes about 14 seconds. Using the pre-emptive kernel the search takes 16 seconds.

  49. I think the much bigger question is... by OneFix · · Score: 2

    When will this become stable enough for major distros to start using it?

    I don't think anyone doubts that this is a good approach. But, both patches are still being worked on right now. And while the preempt patch has already been merged with the 2.5 kernel, the low-latency patch is still nowhere to be seen.

    I certainly think that this would indeed have a great impact on Linux Multimedia, but not until a company like RedHat or SUSE is willing to include it at least as an optional kernel. The reason is, a vendor doesn't have to support patches until they include it in one of their pre-compiled kernels.

    This might not mean much to home users, but a company will not rely on an unsupported feature.

    Like it or not, business still drives the industry.

    1. Re:I think the much bigger question is... by Anonymous Coward · · Score: 0

      Red Hat ships the low latency patch with their 2.4.9-26-beta.31 that is part of their new advanced server stuff.

  50. Shimmer by Anonymous Coward · · Score: 0

    It's the best shine you've ever tasted.

  51. Actually co-op is useful in porting... by Beliskner · · Score: 1

    <karma hoard>
    This is quite a good thing when doing ports, e.g. Wux applications from Unix to Windows PDF here. Particularly insightful is "Chapter 3.2.2 Operating Systems Differences". This document can also serve as Unix to Windows porting 101. I wonder if the Win 3.1 stuff they are talking about is still valid in the non-MSDOS WinME,NT,2000,XP ?
    </karma hoard>

    --
    A caveman dreams of being us, the incalculable power and riches. We dream of being Q, then what?
  52. Clustering Implications by Anonymous Coward · · Score: 0

    How will these changes affect the performance of Beowolf clustering?

    Linux needs to tread carefully here, lest it loses ground in the fast-ramping clustering market - especially with the added intertia HP now has to move the market towards windows.

  53. I don't want to patch kernels arbitrarily anymore! by r6144 · · Score: 1
    Once I was a kernel-patching enthusiast, but a recent incident changed this.

    When I tried a kernel patched by some arbitrary person (i.e., not -ac or -aa, but rather someone appearing just several times a month on lkml) so that it contains all kinds of new things like the new scheduler (which DOES help) and preempt, I found that the system was very stable after two days of desktop use. Then I decided to try `nice -n 30 make -j' PRBoom, and the system is still as responsive as ever. I was happy and posted on Slashdot about how slick it is just after the compilation ended successfully. Wanting to verify my results, I `make clean' and retried. Guess what? Solid lockup without any logs. I hit the reset button and tried the compilation again in console mode with only `top' running. 2 out of 3 times the system locked up solid, Alt-Sysrq just shows messages without doing real things.

    I then rebooted and ran the kernel for another two days with constant fear that it may mysterically lock up at any minute. Luckily it didn't, and I then replaced the kernel with a -aa one, without most of the new features, but at least it is rock solid, hasn't crashed since. I think I will add the preempt (or ll) patches only after Marcelo or A.C. or A.A. incorporate it, or when I decide to do some kernel hacking.

    So my advice is that try arbitrarily patched (I mean putting patches together by yourself or by someone else who did not test it extensively) kernels only in deep-kernel-hack-mode, just like when you try a kernel in which you modified several lines by yourself. After all, many of us has been spoilt by Linux's stability, and our nerves are not quite prepared for a lock-up when facing a screen with WindowMaker (rather than Win98) on it.

  54. Somebody answer this, please by Anonymous Coward · · Score: 0

    Is it true that STREAM gets lower RAM throughput results when the box has USB devices attached to?

  55. Lameness has filtered me! by Anonymous Coward · · Score: 0

    Wide pages make baby jesus laugh.