Slashdot Mirror


The State of Linux IO Scheduling For the Desktop?

pinkeen writes "I've used Linux as my work & play OS for 5+ years. The one thing that constantly drives me mad is its IO scheduling. When I'm copying a large amount of data in the background, everything else slows down to a crawl while the CPU utilization stays at 1-2%. The process which does the actual copying is highly prioritized in terms of I/O. This is completely unacceptable for a desktop OS. I've heard about the efforts of Con Kolivas and his Brainfuck Scheduler, but it's unsupported now and probably incompatible with latest kernels. Is there any way to fix this? How do you deal with this? I have a feeling that if this issue was to be fixed, the whole desktop would become way more snappier, even if you're not doing any heavy IO in the background." Update: 10/23 22:06 GMT by T : As reader ehntoo points out in the discussion below, contrary to the submitter's impression, "Con Kolivas is still actively working on BFS, it's not unsupported. He's even got a patch for 2.6.36, which was only released on the 20th. He's also got a patchset out that I use on all my desktops which includes a bunch of tweaks for desktop use." Thanks to ehntoo, and hat tip to Bill Huey.

472 comments

  1. It sucks I agree by Anonymous Coward · · Score: 4, Interesting

    This issue got so bad for me I switched to FreeBSD.

    1. Re:It sucks I agree by Anonymous Coward · · Score: 4, Insightful

      We switched our dedicated web servers from Linux to FreeBSD and OpenSolaris. When we upload videos (usually 10GB or larger) over our 100Mbps internet connection to the server, or a client was downloading the videos, those who were accessing the server using the web server complained it took seconds serve each web page. The videos were on a magnetic hard drives, the OS and web server was on SSDs (which was mirrored in RAM). Server logs were fine, CPU utilisation was low, the servers have 1Gbps connection. We put it down to I/O scheduling. Switching the OS solved the problems.

    2. Re:It sucks I agree by dotgain · · Score: 1
      I'm just glad we're finally talking about this. For years I've wondered if it was just me; everyone I'd asked naturally denied any problems, when all I had to do was delete a 1GB file and I could kiss goodbye to my system for 20 seconds or so.

      Back then I ran Gentoo so fine tuning your kernel was the norm, and I genuinely believed the terrible performance was due to bad choices I made selecting kernel options. About six months ago I finally abandoned Gentoo and the entire practice of too-tooing with the internals, and switched to Ubuntu, accepting defaults all the way. No I/O improvements noticed. WinXP on the same machine kicks ass.

      Again, I'm glad this is no longer the 'elephant in the room' and we can finally discuss and hopefully fix this. Whodathunkit - Linux had its own Reality Distortion Field.

    3. Re:It sucks I agree by ObsessiveMathsFreak · · Score: 4, Interesting

      This is the number one problem with all Linux installations I have ever used. The problem is most noticeable in Ubuntu where, any time one of the frequent update/tracker programs runs, the entire system will become all but unusable for several minutes.

      I don't know if it's all that related, but swap slowdown is an appalling issue as well. If a single program spikes in RAM usage, I often have to reboot the whole system as it hangs indefinitely. As I work with Octave a lot, often a script will gobble up a few hundred megs of memory and push the system into swap. Once that happens, it's often too late to do anything about it as programs simply will not respond.

      --
      May the Maths Be with you!
    4. Re:It sucks I agree by Anonymous Coward · · Score: 0

      Deleting one file, however large it may be, takes a minimal amount of disk I/O, which will probably sit around in RAM for a few seconds before being flushed to the disk.

    5. Re:It sucks I agree by Lord+Byron+II · · Score: 3, Interesting

      That's exactly why I stopped using swap a couple of years ago. On my main machine I have 3 GB and I feel that if I reach the limit on that, then whatever program is running is probably a lost cause anyway. The next malloc/new causes the program to crash, saving the system.

    6. Re:It sucks I agree by lsllll · · Score: 3, Informative

      Such drastic change! I have seen this happen on numerous systems and I just change the elevator to "deadline" and poof! The problem is gone. See this discussion for some details. The CFQ scheduler is great for a Linux server running a database, but it completely sucks for desktop or any server used to write large files to.

      --
      Is that a roll of dimes in your pocket or are you happy to see me?
    7. Re:It sucks I agree by Anonymous Coward · · Score: 4, Informative

      swapoff -a && swapon -a

      will force everything back into memory

    8. Re:It sucks I agree by Anonymous Coward · · Score: 1, Insightful

      The malloc/new that fails causing a process to crash might not be the process that is consuming huge amounts of memory in the first place.

    9. Re:It sucks I agree by pegdhcp · · Score: 2, Insightful

      swapoff -a && swapon -a

      will force everything back into memory

      Exactly, and it is a very good solution when things get out of hand. At least once or twice a month I recycle swap in order to prevent an imminent freeze. Maybe every 4 or 5 months I lost the system state for I/O scheduling problems on my desktop. On the other hand, my servers usually reboot only during power maintenances and/or fried hardware cases...

    10. Re:It sucks I agree by amn108 · · Score: 1

      Depends on the filesystem, naturally.

    11. Re:It sucks I agree by dogsbreath · · Score: 2, Informative

      Solaris is still a terrific operating system. Every version has made advances in stability and performance, particularly with disk and network i/o. SMP, threading are very mature as well.

      I doubt that Oracle will be able to do anything with it except bury it. Too bad.

    12. Re:It sucks I agree by Sir_Lewk · · Score: 2, Informative


      [user@host] ~ % time rm Fedora-13-x86_64-Live.iso
      rm Fedora-13-x86_64-Live.iso 0.00s user 0.00s system 40% cpu 0.002 total

      Huh-wha?

      Deleting a file is no more intensive than renaming it. Both should complete in constant time.

      --
      "linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
    13. Re:It sucks I agree by daveime · · Score: 1

      Depends on the paranoia of the user. FTFY.

      Any "sane" filesystem will simply unlink that entry in the directory or table.

      The only reason to be physically overwriting the entire space occupied by the 1GB file is some "super secret secure" filesystem used by people scared of having their porn browsing habits discovered by the FBI.

    14. Re:It sucks I agree by ChipMonk · · Score: 4, Informative

      It's more than that. Since most Linux systems use ext{2,3,4}, CFQ is designed to behave very well with them. However, XFS and JFS do better with deadline or no-op. In fact, on my Athlon 64 X2 w/ 4G RAM, using XFS and CFQ at 2.5GHz did worse than XFS and deadline at 1GHz. Yes, CFQ and XFS clash that badly.

      (Site pimp: I did some of my own testing, and reported on it here. I also provide basic shell scripts, so others can do their own tests.)

    15. Re:It sucks I agree by fjgaude · · Score: 1

      This issue got so bad for me I switched to FreeBSD.

      What is it about FreeBSD that is better than Ubuntu :inux. It seems the issue is when copying large files all the memory is cached and then swap seems to be used... then we have an I/O drive delay which is very annoying.

    16. Re:It sucks I agree by Anonymous Coward · · Score: 0

      >I don't know if it's all that related, but swap slowdown is an appalling issue as well. If a single program spikes in RAM usage, I often have to reboot the whole system as it hangs indefinitely.

      Wow, I'm glad I'm not the only one who sees this. Any time I've ever tried to report it, I just get a bunch of zealots saying, "Well *I* have never seen that happen, so it must not exist!"

      This is a huge problem, and is the #1 cause of my having to reboot my machine. And my machine is nothing old: I have 6 GB RAM on it.

      It's an embarrassment to Linux overall and I keep waiting for the situation to improve, but so far it never has.

    17. Re:It sucks I agree by JohnRoss1968 · · Score: 1, Funny

      Right because as we all know PORN is the only thing to keep secret.

    18. Re:It sucks I agree by makomk · · Score: 4, Informative

      For years I've wondered if it was just me; everyone I'd asked naturally denied any problems, when all I had to do was delete a 1GB file and I could kiss goodbye to my system for 20 seconds or so.

      That's a very well known ext2/ext3 problem - they're really slow at deleting huge files, and the amount of disk access involved in doing so slows down any other application accessing the disk. ext4 should fix the issue. (There's also another subtle bug, finally fixed in 2.6.36, where heavy disk IO can cause processes that aren't doing any IO to become unresponsive.)

    19. Re:It sucks I agree by Yokaze · · Score: 4, Insightful

      Renaming is O(filename), usually a single table entry. Deleting is probably more along the lines of O(filesize).
      You have to keep track of the free blocks, too.

      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
    20. Re:It sucks I agree by julesh · · Score: 4, Informative

      Depends on the paranoia of the user. FTFY.

      Any "sane" filesystem will simply unlink that entry in the directory or table.

      The only reason to be physically overwriting the entire space occupied by the 1GB file is some "super secret secure" filesystem used by people scared of having their porn browsing habits discovered by the FBI.

      The problem isn't overwriting the data, it's adding the space previously used by the file to the free space bitmap/list. For a 1GB file on an FS with 1k blocks (not uncommon), you're going to be deallocating about a million blocks. Now, unless your system is fragmented horrendously, a lot of those are going to be hits to the same bitmap block (or similar), but you're still looking at writing about 5,000 or so blocks, probably scattered over several cylinders of your disk (=> more than one seek), so on a typical hard disk the process is going to take tens or hundreds of milliseconds at best. If badly fragmented, this could easily take over a second.

    21. Re:It sucks I agree by Anonymous Coward · · Score: 0

      Yeah, this is the famous long lasting bug 12309 on the kernel mail list. We used cent os 5 for a industry control database server, and this bug made the server very slow and generated a lot of heats-actually two PC servers' motherboard were destroyed by the heats. This bug vanished in 2.6.32.2, and then appeared again. I have not gotten chance to check if it is fixed in 2.6.36 yet.

    22. Re:It sucks I agree by ipozgaj · · Score: 1

      Why deadline and not anticipatory? Anticipatory I/O scheduler should behave much better than deadline when there are many streaming reads.

    23. Re:It sucks I agree by Carewolf · · Score: 1

      Depends on how you keep track of free blocks. It could be O(fragments) or O(filesize). Fragments are usually 1 in a well maintained or smart file-system.

    24. Re:It sucks I agree by hackstraw · · Score: 3, Informative

      I'm actually reading a book about filesystems with a focus on the BFS from Be Inc. The author in it actually says that renaming a file is the most complicated operation on a file. Before the file is renamed, lots of validation must take place in some implementations a rename locks the entire filesystem. The source and destination must be verified to be reachable and unused. The rename could go into another directory, so its must do the proper checks there as well. There are edge cases if the source or destination is a directory.

      Its still seems like an O(1) maybe with a big 1, but this author spent a considerable amount of time on renaming.

    25. Re:It sucks I agree by Sir_Lewk · · Score: 1

      Fair enough, but even so it still only takes fractions of a second in practice. The poster I was responding too was obviously assuming that deleting a file in unix involved also zeroing it out on disk. Anyone who's actually used linux can tell you it won't take you any human detectable amount of time to delete a file like that...

      --
      "linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
    26. Re:It sucks I agree by Anonymous Coward · · Score: 0

      try sync; time (rm Fedora-13-x86_64-Live.iso; sync)

    27. Re:It sucks I agree by Wyzard · · Score: 1

      Switching from ext3 to ext4 resolved this for me. Since ext4 allocates files in extents of up to 256MB, deleting even a very large file involves freeing just a handful of extents, rather than a huge number of individual 4k blocks.

      Another advantage of ext4 is much faster fsck times on large filesystems — minutes rather than hours.

    28. Re:It sucks I agree by Sir_Lewk · · Score: 1

      Why, is that how you delete files in your everyday usage pattern? Don't be silly.

      --
      "linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
    29. Re:It sucks I agree by nicedream · · Score: 1

      The anticipatory scheduler was removed from the kernel a few releases ago.

    30. Re:It sucks I agree by Waffle+Iron · · Score: 4, Interesting

      MythTV added a feature a while back to work around this issue. IIRC, they now keep a handle open to video files while they delete them. This causes the kernel to not actually do the delete, then over a span of about 10 minutes MythTV repeatedly shaves chunks off the end using truncate() until the file reaches 0 bytes.

      Prior to this, the system could get really bogged down right after deleting shows. I was careful not to delete too many shows at once; I had actually seen the back end lock up after telling it to delete a bunch of shows.

    31. Re:It sucks I agree by mehemiah · · Score: 2, Interesting

      Not to be combative, I bet you're right, but which IO scheduler were you using? There are three, if you were using a desktop distro like an Ubuntu desktop variant they were using the sense 2007 it was using cfq, otherwise it was using the deadline scheduler on a server distro. If it was 2007, I dont know which you might have been using.

    32. Re:It sucks I agree by mehemiah · · Score: 1

      Oh, no, they're playing the fence till they can find a viable use for it. Now SPARC, thats what needs adopting. I see uses in embedded if they can cool the bloody things. I just don't see Oracle pursuing that avenue, they can make some grate Routers with that. Routers, managed IB switches, thin clients. All they're going to do is sell it to HPC vendors for accelerating their databases for science and finance. Same goes for Solaris; all the hardware abstraction coolness (crossbow, ZFS, Zones) are too expensive to market alone. Until they can improve their marketing of the system as a whole infrastructure, (look at all the cool stuff we just did with this: Appel style) they will continue selling them as addons to OracleDB. Oracle didn't understand Sun completely.

    33. Re:It sucks I agree by rdnetto · · Score: 1

      After the last debacle with EXT4* I just switched to XFS. No problems, and the performance seems better too.

      *When EXT4 was first included in Ubuntu, it turned out there was a problem where deleting many small files could freeze the system. This was most commonly invoked by attempting to empty the trash folder, and had to be remedied by booting into the recovery mode(i.e. a root shell) and manually recursing through the folders and deleting their contents.

      --
      Most human behaviour can be explained in terms of identity.
    34. Re:It sucks I agree by Drinking+Bleach · · Score: 1

      My 1.5TB /home volume on ext4 takes about 50 seconds to fsck. Even faster than "minutes" :p

    35. Re:It sucks I agree by Anonymous Coward · · Score: 0

      In fact, on my Athlon 64 X2 w/ 4G RAM, using XFS and CFQ at 2.5GHz did worse than XFS and deadline at 1GHz. Yes, CFQ and XFS clash that badly.

      You're aware that the clock speed is almost totally irrelevant, right? The primary difference between the schedulers isn't how much CPU time they consume, it's how much time they cause the disk(s) to waste seeking back and forth vs. how much latency process B incurs because the scheduler is allowing process A to finish more of its operation.

    36. Re:It sucks I agree by mfearby · · Score: 0

      I set the Nautilus process to "best effort" using ionice as a startup application in GNOME. Problem solved. I don't care how long a large file copy takes, if I can still do my other stuff at the same time, so what? Nautilus really needs to be set to a lower priority by default. It's scary behaviours like this that drive away potential Linux converts (it almost drove me back until this was pointed out to me by a kind Tuxian in Adelaide, South Australia).

    37. Re:It sucks I agree by marsu_k · · Score: 1

      But this really depends on the file system - XFS or JFS are very good with quick deletions, I've never had to enable that feature when using XFS. Just make sure you mount the drive with a reasonably large allocsize, say 512m. (That is, provided that you have a drive dedicated for MythTV recordings. Such allocsize would obviously be wrong for a general file system. And when using XFS it doesn't hurt to defrag every now and then, it can be done while the drive is mounted and in use)

    38. Re:It sucks I agree by TheLink · · Score: 1

      For me I just use a smaller swap.

      Where: [seconds I'm willing to wait for response] > [swap size in megabytes]/ [typical swap device IO throughput in megabytes per second].

      I believe swap access is often not so sequential.

      I'd rather run out of memory than have everything start running from disk.

      I still keep swap, so that if my machine starts to swap and slow down a bit I know I have a problem, and maybe I might have time to kill the correct process(es) rather than wait for Linux to decide which process to kill :).

      --
    39. Re:It sucks I agree by dutchwhizzman · · Score: 2, Insightful

      Now put ten million files on it and try again. This is about actually used filesystems, not your stash of 500 ISO DVD rips, your bookmarks and your resume.

      --
      I was promised a flying car. Where is my flying car?
    40. Re:It sucks I agree by Anonymous Coward · · Score: 0

      Complicated doesn't mean slow. Quick sort is much more complicated than bubble sort. But don't tell me it's slower.

    41. Re:It sucks I agree by fnj · · Score: 1

      Yep, it sure sucks to run out of RAM.

    42. Re:It sucks I agree by Ingo+Molnar · · Score: 4, Informative

      Such drastic change! I have seen this happen on numerous systems and I just change the elevator to "deadline" and poof! The problem is gone. See this discussion for some details. The CFQ scheduler is great for a Linux server running a database, but it completely sucks for desktop or any server used to write large files to.

      I see that the bug entry you referred to contains measurements from early 2010, at which point Ubuntu was using v2.6.31-ish kernels IIRC. (and that's the kernel version that is being referred to in the bug entry as well.)

      A lot of work has gone into this area in the past 1-2 years, and v2.6.33 is the first kernel version where you should see the improvements. Slashdot reported on that controversy as well.

      If you can still reproduce interactivity problems during large file copies with CFQ on v2.6.36 (and it goes away when you switch the IO scheduler to deadline), please report it to linux-kernel@vger.kernel.org so that it can be fixed ASAP. (You can also mail me directly, i'll forward it to the right list and people.)

      Thanks,

      Ingo

    43. Re:It sucks I agree by the_womble · · Score: 1

      lower vm.swappiness

      If I reduce vm.swappiness from the default 60 to 10 the problem goes away, although I am not running anything as demanding as Octave.

    44. Re:It sucks I agree by Ingo+Molnar · · Score: 4, Interesting

      There's also the VM fix from Wu Fengguang, included in v2.6.36, which addresses similar "slowdown while copying large amounts of data" bugs.

      There were about a dozen kernel bugs causing similar symptoms, which we fixed over the course of several kernel releases. They were almost evenly spread out between filesystem code, the VM and the IO scheduler. And yes, i agree that it took too long to acknowledge and address them - these problems have been going on for several years. It's a serious kernel development process failure.

      If anyone here still experiences bad desktop stalls while handling big files with v2.6.36 too then we'd appreciate a quick bug report sent to linux-kernel@vger.kernel.org.

      Thanks,

      Ingo

    45. Re:It sucks I agree by xtracto · · Score: 1

      I doubt that Oracle will be able to do anything with it except bury it. Too bad.

      Wait a sec. Still we have OpenSolaris don't we?

      Even after dying such a terrible death, I love Sun. They took an arduous way to share the majority of their work with the community before being bought.

      (yeah I know some people here disagree with the type of open licenses, but for me it does not matter, it is available for free and it is open enough to use it and develop it)

      --
      Ubuntu is an African word meaning 'I can't configure Debian'
    46. Re:It sucks I agree by phtpht · · Score: 1

      Back then I ran Gentoo so fine tuning your kernel was the norm, and I genuinely believed the terrible performance was due to bad choices I made selecting kernel options. About six months ago I finally abandoned Gentoo and the entire practice of too-tooing with the internals, and switched to Ubuntu, accepting defaults all the way. No I/O improvements noticed. WinXP on the same machine kicks ass.

      I first noticed this problem around 2.6.30 where it would terrorize the owners of then-current mainline distros such as the already mentioned Ubuntu. I think there are 2 problems with I/O though:

      Lack of general responsiveness with I/O on the background - for example choppy mouse cursor movements, laggy response for keyboard typing - this can be remedied to some extent by using a preemptible kernel and clock at 1000hz and I think it's generally gone after the (proper) low latency hack since 2.6.33 or so.

      The other one is crappy work with disk request queues and/or bandwidth, usually when there is one big transfer then all the other stuff has to wait, and there is no way to tell the kernel to do otherwise. A lot of stuff needs disk these days - for example start typing URL in firefox, he has to go to on disk db to fetch completions - thus this one can be particularly annoying. I think this is hardware dependant bug (on some chipsets it bites more) and also there have been some tries to remedy it, namely the I/O stalling patch, which AFAIK has not been yet fully merged and is *maybe* going to go to 2.6.37.

      All in all I would call the past year as a pain in the ass of the linux desktop. Especially with distro kernels and their blind shoot in the dark style patches. Custom kernels are highly encouraged.

    47. Re:It sucks I agree by shellbeach · · Score: 3, Informative

      I don't know if it's all that related, but swap slowdown is an appalling issue as well. If a single program spikes in RAM usage, I often have to reboot the whole system as it hangs indefinitely. As I work with Octave a lot, often a script will gobble up a few hundred megs of memory and push the system into swap. Once that happens, it's often too late to do anything about it as programs simply will not respond.

      I'm surprised you're seeing this with a process taking up a few hundred Mb -- that suggests to me that you have very little RAM in your system. But if it really is the kernel's fault for being more swappy than it should be, doing something like

      echo 10 > /proc/sys/vm/swappiness

      (as root) should fix your problems fine. (Swappiness can be a value between 0 and 100; 0 means never swap out, 100 means swap out all the time; 60 is generally the default value). See Ubuntu's swap FAQ for lots more info.

      Of course, if you simply don't have enough memory in your system to support the RAM-intensive process and basic system functions, buying more memory might be the best solution ... :)

    48. Re:It sucks I agree by KZigurs · · Score: 1

      Not from command line. This is how a fair amount of serious 'no-data-loss allowed' software operates.

    49. Re:It sucks I agree by Carewolf · · Score: 1

      The great strength of the BFS are all the indexes which unix filesystems usually don't have. The indexes makes searching and ordering much faster bug makes changing meta-data much more difficult as each index needs to be updated atomically, essentially requiring either a large set of small locks or a big giant lock.

    50. Re:It sucks I agree by Anonymous Coward · · Score: 0

      So what you did was you changed the whole car engine (OS) instead you would have changed just the oil (I/O scheduler). So you needed to take care of the whole car (software system) because you changed the engine (OS) instead just changed the oil (I/O Scheduler).

      It is good if you have lots of time for that or that you get paid extra for such big job.

      I would have just restart the server (or remounted filesystem) with another scheduler or if demanded, patched the Linux OS, compiled it, added it to GRUB (or any other bootloader) and then restarted the server. This or that, time would have gone from 1 minute to 30.

    51. Re:It sucks I agree by swillden · · Score: 3, Informative

      The malloc/new that fails causing a process to crash might not be the process that is consuming huge amounts of memory in the first place.

      It might not, but it usually is. The probability that a given process will be the one that triggers the OOM killer is proportional to the amount of memory that process is allocating. If one process is allocating 99.9% of the memory, there's a 99.9% chance it will be the one that triggers the OOM killer.

      But, actually, Linux doesn't just pick the process with the failed allocation to kill. Instead, when a process makes a memory request which cannot be fulfilled, the OS runs a quick calculation of the memory usage "badness" of all processes. The base of the badness score is the processes resident memory, plus the resident memory of child processes. Processes that have been "nice'd" get a score boost (on the theory they're likely to be less important), but long-running processes get a score decrease (on the theory they're likely to be more important). Superuser processes have their score decreased. Finally, processes have their scores decreased by a user-settable value in /proc//oom_adj (default is no adjustment). Also, if /proc//oom_adj is set to the constant OOM_DISABLE, then the process is not killable.

      When memory runs out, Linux kills the process with the highest score. If a single ordinary user process, especially a short-lived desktop process, has consumed nearly all of the system RAM, and no one has messed with oom_adj for that process, then it WILL be the one that dies.

      Here's a (probably excessively long and complex; I'm no shell guru) one-liner that will show the current OOM scores for all of your processes, sorted from lowest to highest:

      find /proc -maxdepth 2 -name oom_score | while read i; do echo -n "$i "; cat $i; done | sort -n -k2

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    52. Re:It sucks I agree by ja · · Score: 1

      You mean "big one" like O(1^inf) ..

      --

      send + more == money? ...
    53. Re:It sucks I agree by badkarmadayaccount · · Score: 1

      Have you considered making the schedulers tunable by per application parameters? Setting IO, CPU, and RAM (swapiness) priority per process, for instance. Side question, I was always curious whether there exists a hypothetical situation in which a garbage collector is included in the kernel. What are you plans on record oriented interfaces for the vfs layer, and possibly a fs agnostic on-line defragmentator, possibly with some minimal interfacing with the fs - for improving DB performance, and enabling ports from z/VSE and VMS. Is being a mainframe migration target anywhere on the roadmap? Sorry for the ad-hoc interview, I hope you don't mind.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    54. Re:It sucks I agree by MidoriKid · · Score: 1

      Unfortunately, when the system gets to this state there's no way to open a terminal.

    55. Re:It sucks I agree by dogsbreath · · Score: 2, Insightful

      Yeah, and I hope it continues but I don't know any of our critical vendors who develop for it. Forgive me for marginalizing the open community on this particular item but a lot of the steam behind Solaris (by reflection OpenSolaris) was the industrial use of the o/s. Not just web servers but all kinds of specialized applications tied to command and control of the internet. Companies like Siemens, Alcatel-Lucent, Cisco etc all have or had Solaris based platforms. Our company has not installed a Solaris application system in two years. Everything is Linux, Windows, AIX and any vendor who comes to us with Solaris might as well save their breath. As well, we have not bought any Sun h/w in two years. Our h/w criteria is basically: how cheaply and reliably can we run VMWare?

      I fear that Solaris/OpenSolaris is becoming at best a niche operating system. Sun h/w and Solaris are the walking dead and I don't see Oracle being able to do anything about it.

      Too bad IBM didn't buy Sun. Solaris really would have had a chance to grow if IBM wanted to push it.

    56. Re:It sucks I agree by lsatenstein · · Score: 1

      I have the problem copying from one physical drive to another, as with a mounted (external) drive such as eSATA and the local SATA based ext4 stuff versus a fstab mounted SATA drive. Large file copies just suck. Copying is fast for the first 200-300k and then I wait. One needs to put the GUI interface at a higher priority to the priority assigned to copying disk files. I tried to change things using the nice command, but that did not bear any noticable results. I presume too, that copying to a network connection (socket) may also need some reviewing as it will suck. Test with /dev/null. Should it will yield some interesting results? If it is OK with /dev/null, then something is wrong with allocating blocks for the target file.

      --
      Leslie Satenstein Montreal Quebec Canada
    57. Re:It sucks I agree by cynyr · · Score: 1

      Trash folder? what is this a Mac? or did you mean Recycling bin, like windows.

      rm doesn't seem to save the crap i told it to delete for me...

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    58. Re:It sucks I agree by hasdikarlsam · · Score: 1

      Don't remind me. I still have nightmares of trying to implement rename() for a distributed filesystem.

    59. Re:It sucks I agree by hasdikarlsam · · Score: 1

      This would be why we use extents rather than pure bitmaps, these days.

    60. Re:It sucks I agree by Nutria · · Score: 1

      What are you plans on record oriented interfaces for the vfs layer

      That would be completely antithetical to the "every file is a byte-stream, just link to libdb" mantra.

      --
      "I don't know, therefore Aliens" Wafflebox1
    61. Re:It sucks I agree by Anonymous Coward · · Score: 0

      I do think that Canonical should port this patch back in Ubuntu Maverick 10.10 which use the 2.6.35 kernel release.

    62. Re:It sucks I agree by enoz · · Score: 1

      Ubuntu Desktop has a "Trash" folder on the Desktop. Has had for a long time now.

    63. Re:It sucks I agree by fractoid · · Score: 1

      Wow, thanks for the informative post!

      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
    64. Re:It sucks I agree by Anpheus · · Score: 1

      Microsoft actually thought otherwise, and found that if your fragments are sufficiently large (on the order of >64MB) then you can buffer and seek between consecutive reads in a way that makes it largely irrelevant. As a result, the NTFS defragger no longer attempts to consolidate files to chunks larger than 64MB.

      But you know, I think I might actually test that theory out myself if I get around to it. I'd really like to know if what they were getting at was accurate with today's hard drives, given how long seek times can be. Considering Microsoft uses NTFS for all of its needs, from the user OS to SQL Server and other "enterprisey" products, I'd say they may have some experience in the matter. I mean, even in the case of large database objects, if you're incrementally adding entries to a table, how likely is it that it and all its indexes are going to remain consolidated on disk even if the filesystem does its best to keep the database file intact?

    65. Re:It sucks I agree by badkarmadayaccount · · Score: 1

      The bytestream interface can be implemented as a EBML export of the file internal structure.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    66. Re:It sucks I agree by ChipMonk · · Score: 1

      If I didn't have my own testing results, I would be inclined to agree with you. Yes, spinning platter I/O is tremendously sloooooooow compared to CPU speed. But that actually means the quality of the I/O scheduler gets magnified by orders of magnitude, when its decisions are reflected in disk head movement. On both my systems with spinning platters, the XFS+CFQ clash is completely reproducible.

      That said, if you can spare a partition or two on your Linux system, I'd be happy to receive any feedback about how well, or badly, XFS+CFQ behaves for you. If you wish, contacting me privately is an option via the link in my earlier comment.

    67. Re:It sucks I agree by badkarmadayaccount · · Score: 1

      Not to mention the performance improvements for database clusters with record level locking, and improved IO scheduling because of higher IO transaction locality. Though the feature I wish for most is HP-UX style context-sensitive directories. Heck virtual dirs look so simple, I don't see why everybody bashes MS for WinFS delays, if the lnux guys can't hack up something similar in so much time. Both would be a boon to package managers for conflicting libraries.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    68. Re:It sucks I agree by Anonymous Coward · · Score: 0

      I had huge issues with IO to local disks when a big streaming writer would push the system over dirty threshold and starve small writes as well as reads (and thereby execs), producing priority inversion. CFQ improved the situation with regards to reads, which are synchronous, but not so much for writes, as those become pretty much anonymous as soon as the writer's dirtied a page and left.

      I don't think there'll be a stable solution until we can assign priorities and/or limits to IO that goes via VM subsystem. Now if you go through VM, all you have is a higher dirty threshold if you're a high priority process, and that's it. Just two classes, and lower priority writers can still dirty pages, eating away you share.

      I think some Google people are marrying dirty limits with c groups - we do need that.

      Alex Nekrasov

    69. Re:It sucks I agree by SharpFang · · Score: 1

      [click file icon in Gnome]
      [del] ...some 5s
      [Are you sure you want to delete...?]
      [yes] ...some 3s
      [deleting...]

      Nope. Not here.

      Worse, if I press del, THEN enter, then the file gets opened, then I get a dialog "the file cannot be deleted because it is in use." But it's Windows that loves to do that particular trick.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    70. Re:It sucks I agree by bored · · Score: 1

      Deleting requires what is effectively a heap merge of the free list against the newly freed blocks. The problem is the file-system code which is trying to actually do the merge, as part of the delete, rather than doing something simple like marking the file deleted, moving its list of blocks to the tail of the free list, and marking them as unmerged. Then later, when there is free IO/CPU time doing the merge. If a request comes in that requires the blocks you go ahead and use them unmerged, then later you consolidate them as part of a defragment/GC type operation. In a well written fully journaled system, this actually sort of fits the architecture because you have a process running behind that is committing the journal.

      All this is made more complex by the lack of a well defined prioritized IO fencing system that can be used by the filesystems to have some control over IO scheduling.

      Its stupid, but reading a lot of the kernel code it seems to me that its been written by people who don't seem comfortable in fully async delayed operational systems. Some of it may also be due to the evolved nature of the kernel, since SMP, and threading were basically bolted on after the initial code was reaching critical mass. This is also reflecting in how journaling was bolted on to ext2.

    71. Re:It sucks I agree by isolationism · · Score: 1

      Great tip, thank you!

    72. Re:It sucks I agree by bill_mcgonigle · · Score: 1

      ext4 should fix the issue.

      Yes, it does. I was very pleasantly surprised by this the other day on my Mythdora box. I had formatted my storage disk as ext4 when I upgraded it last time, hadn't noticed before, but an 'rm' returned almost right away on a really big video file. Yay.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    73. Re:It sucks I agree by isolationism · · Score: 1

      Very opportune timing as I have a brand-spanking new workstation where this problem has become surprisingly much more visible than it ever was on my older machine. I went from:

      • Core2 Quad @ 3GHz (overclocked)
      • 3ware 9500MI
      • 3x WD Raptor 150GB in RAID 0

      to:

      • 2x Xeon X5670 @ ~2.9GHz
      • 3ware 9690SA
      • 8x Seagate 15.7K in RAID 10

      ... And there was a whole lot of "freezing" -- mostly in the sub-1000ms range -- while copying files on 2.6.34-35 kernels (I haven't tried any lower versions for comparison, sorry). On your advice I switched to 2.6.36 which I had compiled but not used as it requires a more "bleeding edge" nVidia driver -- but interestingly enough, my entire konsole session freezes up for 10-20 seconds at a time while trying to do an `ls` during a big file copy to an NFS share which it didn't do before -- but the mouse cursor is completely unaffected, as is surfing in Firefox. So I'm guessing whatever commits were made did make a difference in making the machine more usable Thank you for telling us!

      Anyone else tried switching from 2.6.36 and see any difference?

    74. Re:It sucks I agree by ploxiln · · Score: 1

      I can relate to the grand-parent poster... the issue isn't about how much it's swapping when it can choose whether to swap or not, it's about what happens when you do run out of ram.

      This happened to me when I tried to convert an svg of a microchip design to a png using inkscape (generated from a cadence export with millions of rectangles). When linux really runs out of memory and begins running things off of a gig of swap on a rotational disk, you have serious problems. It took 30 minutes for me to open a terminal and kill it.

      Amusingly enough, the execution slows down so much that it can take hours for the runaway process to finally exhaust all of swap as well, and finally trigger the OOM, and until then the entire computer is useless. This is what motivates people to get rid of their swap partition, so the OOM will kill a runaway process when it happens, instead of after your computer has been frozen for a couple of hours.

      I've heard that havings some swap makes the vm happier under normal circumstances, so I use a 256 MB swap partition.

    75. Re:It sucks I agree by shellbeach · · Score: 1

      I can relate to the grand-parent poster... the issue isn't about how much it's swapping when it can choose whether to swap or not, it's about what happens when you do run out of ram.

      But when that happens, you're going to be screwed no matter what OS you're using. If you need to use disk IO to access the memory you need, then it doesn't matter how that IO is scheduled -- you're going to be soundly fscked whatever you do. Opening a new process (i.e. in your case a terminal), when there's a rogue process constantly trying to grab more memory, will take forever.

      I generally find the best thing to do in those situations is to switch to a VT (which doesn't need much memory to run) and kill the offending process from there. It doesn't take very long.

    76. Re:It sucks I agree by Anonymous Coward · · Score: 0

      > 1GB file
      > you're going to be deallocating about a million blocks
      > you're still looking at writing about 5,000 or so blocks

      but this could/should be really low down on the priority list

  2. what about servers? by StripedCow · · Score: 3, Insightful

    Isn't this also relevant when using Linux on a server? I mean, if one process or thread is copying a large file, you don't want your server to come to a crawl.

    It doesn't sound like just a "desktop" issue to me.

    --
    If Pandora's box is destined to be opened, *I* want to be the one to open it.
    1. Re:what about servers? by e065c8515d206cb0e190 · · Score: 1

      I use linux for desktop and servers. Never saw noticed the issue OP is referring to... maybe OP could be a little more specific about what he's doing and on which hardware?

    2. Re:what about servers? by Anonymous Coward · · Score: 2, Interesting

      On IO intensive server: this is also a real issue. 20-30% of processors and cores stuck with a 99% iowait for hours, while the rest tries to cope. Total CPU load does not go above 20%. No solution yet after months of study and experimenting. Linux is indeed really bad at IO scheduling in general, it seems.

      Notw think of that situation and a heavy database system. A no-no solution.

    3. Re:what about servers? by Anonymous Coward · · Score: 0

      What if copying that large file quickly is very important and your server is only used for non-latency-sensitive stuff? In that case you might prefer your server to come to a crawl.

    4. Re:what about servers? by Anonymous Coward · · Score: 5, Informative

      There are some interactive-response fixes queued up for 2.6.37 that may help (a lot!) with this stuff.
      Start reading here: http://www.phoronix.com/scan.php?page=news_item&px=ODU0OQ

    5. Re:what about servers? by man_of_mr_e · · Score: 2, Interesting

      How does this happen? Every year it seems I read about how this problem has been fixed in the latest kernel, and then it's like those fixes mysterious vanish?

    6. Re:what about servers? by fishbowl · · Score: 2, Interesting

      This problem is highly visible in VMs. When you have one VM doing write-heavy disk IO, the other VMs suffer.

      I don't think it's a Linux problem as much as a general problem of the compromises that must be made by any scheduling algorithm.

      What about you Linux mainframe guys? You have unbeatable IO subsystems. Do you see the same problems?

      --
      -fb Everything not expressly forbidden is now mandatory.
    7. Re:what about servers? by Lord+Byron+II · · Score: 2, Interesting

      It's been a big issue for me. Go to a directory with a couple of large files (say a dvd rip) and do a "cat * > newfile". Watch your system come to a crawl.

    8. Re:what about servers? by joaosantos · · Score: 5, Informative

      I just did it and didn't notice any slowdown.

    9. Re:what about servers? by hedwards · · Score: 1

      It's not Linux specific, although he's complaining about it on Linux. I've seen similar behavior on Windows and FreeBSD as well as Linux. If I'm not mistaken, MS added IO scheduling of some sort to Vista and 7 likely has it as well. And FreeBSD has its own effort for that as well.

      It's not something which one notices all the time, but I have noticed it and it is annoying. Not personally sure what exactly causes it except in the case where multiple programs want to access different portions of the hard disk at the same time.

    10. Re:what about servers? by inode_buddha · · Score: 1

      I'm not the kinda guy you're looking for, with litle or zero mainframe experience. But with that said, I honestly think that you'd be better off to ask that on the kernel mail-list. Chances are that questions like that would actually do everyone some good.

      --
      C|N>K
    11. Re:what about servers? by PsychicX · · Score: 1, Insightful

      Funny how the miraculous solution to every problem anyone has with Linux is always just about to go in with the next version. Sure the current one sucks, but we promise the next one is totally different! Sigh.

    12. Re:what about servers? by b4dc0d3r · · Score: 2, Informative

      Vista's I/O priority is linked to the process priority. Requests for high-priority tasks are high priority i/o requests. Unfortunately this borks things like virus scan, which give themselves boosted priority thinking that the user wants a file on-access-scanned and ready to use. Background tasks run, open a file, get scanned on access, and suddenly you have a high-priority process reading the file. And then once it's scanned it's probably in the disk cache so the low priority process/thread reads it instantly. Now that everything is high priority, nothing is, and we're back where we started.

      http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/Priorityio.doc

      SetPriorityClass() and SetThreadPriority() adds a new option that says "I'm in the background now" and "I'm no longer in the background", but few apps use this. Certainly no XP apps did, because it didn't exist, so it would have to be Vista-onwards apps. SetFileInformationByHandle() I think is new, allowing you to specifically set i/o priority for each file handle. Who is going to voluntarily set themselves low priority? Not many apps. There are some other calls to reserve bandwidth, and driver-level calls, but it not very much. Windows 7 does not make any significant changes to this model. And although you can set priority in the task manager, there is no way without a third party tool (I still consider sysinternals to be third party) to change priority. I think it uses SetFileInformationByHandle.

      I first noticed this on Windows NT 4, probably on a machine without enough ram. I watched each control paint itself. Today, on a core 2 duo 2.5 ghz with 2GB of ram, Vista occasionally still paints individual controls at watchable speed. This is a work computer, so no torrents or large file copying, but enforced virus scan. I have two VBScripts to control this - one sets certain apps to low priority (setting their i/o priority accordingly). The other disables several services including virus scan. When I need to debug a .NET website, virus scan gets turned off. It's still not snappy enough, but it's a vast improvement. Still unacceptable.

    13. Re:what about servers? by _Sprocket_ · · Score: 1

      Isn't that the nature of the beast? Every software project (proprietary or otherwise) always has something in the works to address current complaints (assuming said complaints aren't dismissed). Whether it works or not tends to take release and implementation to determine.

    14. Re:what about servers? by hitmark · · Score: 1

      I guess it could be that one patch set overrides another and one end up with reversion. Or things never made it from staging point to the main source. At ever level there are humans, and humans inevitably makes mistakes.

      --
      comment first, facts later. http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm
    15. Re:what about servers? by ksandom · · Score: 4, Interesting

      Sorry dude, it looks like it's a hardware specific problem. I did that on nearly 700G of large files and then fired up the flight sim while it was still going. The only slow down was on file related activity, which is totally what you'd expect. I had it running full screen across two monitors without any drop in frame rate. AND I'm using economy hardware.

      --
      Funnyhacks - Wierd, unusual, and fun hacks
    16. Re:what about servers? by Anonymous Coward · · Score: 0

      Got the same problem here (Ubuntu Desktop). If I copy a medium-sized file (1-2gb) from one partition to another (usually ext to ntfs) it pretty much locks up my system and transfers at abysmal speeds. Could possibly be related to the fact that both partitions are on the same physical harddrive. No issues on Win XP though.

    17. Re:what about servers? by Ingo+Molnar · · Score: 5, Informative

      I think the Phoronix article you linked to is confusing the IO scheduler and the VM (both of which can cause many seconds of unwanted delays during GUI operations) with the CPU scheduler.

      The CPU scheduler patch referenced in the Phoronix article deals with delays experienced during high CPU loads - a dozen or more tasks running at once and all burning CPU time actively. Delays of up to 45 milliseconds were reported and they were fixed to be as low as 29 milliseconds.

      Also, that scheduler fix is not a v2.6.37 item: i have merged a slightly different version and sent it to Linus, so it's included in v2.6.36 already: you can see the commit here.

      If you are seeing human-perceptible delays - especially in the 'several seconds' time scale, then they are quite likely not related to the CPU scheduler (unless you are running some extreme workload) but more likely to the CFQ IO scheduler or to the VM cache management policies.

      In the CPU scheduler we usually deal with milliseconds-level delays and unfairnesses - which rarely raise up to the level of human perception.

      Sometimes, if you are really sensitive to smooth scheduling, can see those kinds of effects visually via 'game smoothness' or perhaps 'Firefox scrolling smoothness' - but anything on the 'several seconds' timescale on a typical Linux desktop has to have some connection with IO.

      Thanks,

      Ingo

    18. Re:what about servers? by Anonymous Coward · · Score: 0

      it's called "write cache poisoning". dd if=/dev/random of=anyfile.
      Wait for a couple of seconds(about 30) and try open any file on filesystem.

    19. Re:what about servers? by Anonymous Coward · · Score: 0

      Huge issue for me too. I've been seeing this for forever on Linux. I was really glad when they introduced different I/O schedulers, which you could switch out, but none of them actually ever solved the issue for me. However, I have had some success with the deadline scheduler. It at least makes the waits shorter it seems, which to me seemed more responsive than the other I/O schedulers.

      Another thing that does work on my MythTV box is ionice'ing processes accordingly, i.e. mplayer gets higher priority, commflag etc. get lower priority. So even if something else is working on the system (the box is also a file server, so someone might make samba do a lot of I/O), I can still watch TV.

    20. Re:what about servers? by AvitarX · · Score: 1

      Probably this:
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/131094

      It's the first thing I thought, and somebody posted to it that it hit /.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    21. Re:what about servers? by rubycodez · · Score: 1

      I do that all the time as well as unrar-ing massive archives, never had nor heard of this problem. maybe some people are just doing something wrongly?

      I don't use brain-dead filesystems such as ext2/ext3/ext4 for my data volumes of course, just for boot and root for ease of recovery and max amount of choices for recovery.

    22. Re:what about servers? by Pinky's+Brain · · Score: 1

      It's more than that ... it's about the reclaimable memory, often it will chose to throw much more recent data to swap because it's priority algorithms think that is a better idea than reclaiming (which costs CPU). Linux's VM developers seem to me to be a very myopic bunch ... leaving me with no other choice than not letting their code not make too many decisions ... ie. turn off swap.

      https://bugzilla.kernel.org/show_bug.cgi?id=12309

      PS. why the hell was drop_caches dropped, it almost feels like the VM developers just couldn't stand the plebian end users second guessing their brilliant code.

    23. Re:what about servers? by mcneely.mike · · Score: 1

      Nope... no slowdown at all.

      --
      soylentnews.org Go there to enjoy the people!
    24. Re:what about servers? by JohnRoss1968 · · Score: 0

      while this post may be flamebait....its true.

    25. Re:what about servers? by ThePhilips · · Score: 1

      No. In administration, monitoring is very important. Because one wants to know the status of the on-going operations. Last thing you want is to wait a day for task to finish only to find that the operation actually hanged.

      Linux server slowed down to crawl by heavy I/O in my past experience was exhibiting all the symptoms of the DDOSed system. With 2.6 it got considerably better, but still far from being ideal. Probably because Linux is heavily optimized for Oracle servers where you generally have only single smart process writing to disk, while on desktop one normally has bunch of application simultaneously doing something with files.

      I always liked how *BSD did the I/O. At times it is slower than on Linux, but I have never seen *BSD being rendered unresponsive due to I/O.

      --
      All hope abandon ye who enter here.
    26. Re:what about servers? by ShakaUVM · · Score: 1

      >>Delays of up to 45 milliseconds were reported and they were fixed to be as low as 29 milliseconds.
      >>Sometimes, if you are really sensitive to smooth scheduling, can see those kinds of effects visually via 'game smoothness' or perhaps 'Firefox scrolling smoothness' - but anything on the 'several seconds' timescale on a typical Linux desktop has to have some connection with IO.

      Ingo, I find delays of 29-45ms to be pretty noticeable. To put it another way, if you had a delay of 10ms before, and you're now getting a delay of 50ms due to some background copy, all of your applications went from running at 100fps to 20fps, which I think even non-sensitive people can pick up on, even outside of games and smooth scrolling. VIM feels different over a 10ms LAN connection vs. a 45ms connection from my home.

      But hasn't Linux supported temporary priority boosting for applications getting key presses since the 90s, though? How hard would it be to do something similar for GUI apps and renice foreground processes?

    27. Re:what about servers? by fast+turtle · · Score: 1

      Windows I/O scheduling is linked to the Advanced setting (Background/Programs) These can be found in XP on the System Properties, Advanced/System Performance/Advanced Tabs.

      --
      Mod me up/Mod me down: I wont frown as I've no crown
    28. Re:what about servers? by chrb · · Score: 1

      To put it another way, if you had a delay of 10ms before, and you're now getting a delay of 50ms due to some background copy, all of your applications went from running at 100fps to 20fps, which I think even non-sensitive people can pick up on, even outside of games and smooth scrolling.

      The delay talked about is in scheduling a process on a CPU. Once the process is running there is no delay. If all applications were running at 20% of full speed due to some kernel bug it would've been noticed a long time ago.

    29. Re:what about servers? by RedBear · · Score: 1

      The very sad thing about this article is this: I was desperately chasing after better desktop Linux performance at least twelve years ago, and twelve years later there are still comments like yours (the same ones I saw constantly so long ago) alluding to the fact that there should be some patches in (wonder of wonders!) THE VERY NEXT VERSION of the kernel that will damn near solve the problem. Oh, and the next version of the Ext filesystem (which is still in development) will help a lot too!

      With Linux, unfortunately, it's always about "we'll fix that next week, don't worry". Which is why I finally gave up and became one of the millions who switched to Mac. It still bums me out to this day how little _apparent_ progress the Linux world seems to be making in many of these essential areas that are crucial to competing with other platforms. I continue to try out the supposedly "best" desktop Linux distros every year or so and continue to be exceedingly unimpressed despite all the invisible technical triumphs that I know have been achieved by Linux over the intervening years. It just never seems to add up to much in the big scheme of things.

      The fact that people in this community are still telling Linux users to apply kernel patches to get better desktop performance just pretty much sums up the whole Linux world and the reason it is still making very few inroads into the general computing market. In the end, even the best Linux "desktop oriented" distros are made by developers and geeks FOR developers and geeks. And yet, making a simple true statement like this is met with derision and idiotic comments about how Linux is actually perfect or somehow much better than everything else. And you guys think the Mac world has some sort of reality distortion field. Join the club.

    30. Re:what about servers? by Anonymous Coward · · Score: 0

      Sometimes, if you are really sensitive to smooth scheduling, can see those kinds of effects visually via 'game smoothness' or perhaps 'Firefox scrolling smoothness' - but anything on the 'several seconds' timescale on a typical Linux desktop has to have some connection with IO.

      Who cares what's causing! FIX IT, INGO!

    31. Re:what about servers? by Ingo+Molnar · · Score: 4, Informative

      Sorry dude, it looks like it's a hardware specific problem. I did that on nearly 700G of large files and then fired up the flight sim while it was still going. The only slow down was on file related activity, which is totally what you'd expect. I had it running full screen across two monitors without any drop in frame rate. AND I'm using economy hardware.

      It may also be kernel version dependent - with older kernels still showing this bug.

      A lot of work has gone into the Linux kernel in the past 2 years to improve this area - and yes, i think much of the criticism from those who have met this bug and were annoyed by it was fundamentally justified - this bug was real and it should have been fixed sooner.

      Kernels post v2.6.33 ought to be much better - with v2.6.36 bringing another set of improvements in this area. The fixes were all over the place: IO scheduler, VM and filesystem code and few of them were simple.

      This Slashdot article from 1.5 years ago shows when more attention was raised to this category of Linux interactivity bugs.

      Thanks,

      Ingo

    32. Re:what about servers? by Ingo+Molnar · · Score: 3, Informative

      Ingo, I find delays of 29-45ms to be pretty noticeable. To put it another way, if you had a delay of 10ms before, and you're now getting a delay of 50ms due to some background copy, all of your applications went from running at 100fps to 20fps, which I think even non-sensitive people can pick up on, even outside of games and smooth scrolling. VIM feels different over a 10ms LAN connection vs. a 45ms connection from my home.

      Yes i agree with you that if a 45 msecs latency happens on every frame then that will snowball and will thoroughly ruin game interactivity - but note the specific context here:

      you can see the commit referenced by Phoronix here

      (hm, my first link above was broken, sorry about that.)

      Those 45 msec delays were statistical-max outliners - with the average latency at 7.3 msecs. This got cut down to 25 msecs / 6.6 msecs respectively via the patch. Note that it's also a specific, CPU overloaded workload that was measured here, so not typical of the desktop unless you are a developer running make -j build jobs.

      We care about optimizing maximum latencies because those are what can cause occasional hickups on the desktop - a lagging mouse pointer - or some other non-smooth visual artifact.

      Thanks,

      Ingo

    33. Re:what about servers? by BestNicksRTaken · · Score: 1

      This problem is highly visible in VMs. When you have one VM doing write-heavy disk IO, the other VMs suffer.

      yes, this is the only time i've ever seen the problem myself - apply a patch cluster to a solaris vm or compile xbmc in a win2003 vm and watch the other vm's just crawl. doesn't affect the host though, so i assumed it a virtualbox bug.

      --
      #include <sig.h>
    34. Re:what about servers? by F.Ultra · · Score: 1

      Probably the problem has many different causes and each new version of the kernel fixes some of them. Perhaps some day all will be fixed :)

    35. Re:what about servers? by Anonymous Coward · · Score: 0

      Right, mod me flamebait, too, but this "has to be a hardware problem" for years...

      I agree with many others here in that it is the single biggest problem the kernel has, and it's freaking annoying. I have to use the magic SysRq key on a daily basis once my system even just starts swapping and had this behaviour on every single machine yet. There were tons of official patches, none of them worked.

      And people like you still keep denying the problem...

    36. Re:what about servers? by Ingo+Molnar · · Score: 2, Informative

      Yeah, that's what the discussion was about - we improved that particular case, see this commit (which can be found in v2.6.36), and Phoronix reported about that upstream fix.

      Thanks,

      Ingo

    37. Re:what about servers? by KZigurs · · Score: 1

      I use both. (And more) ...for their respective uses. Windows for GUI and day to day use, linux for getting number crunching work done.

      If only X11 would be finally killed...

    38. Re:what about servers? by Anonymous Coward · · Score: 0

      Well, in that case it's wrong to say that it has been fixed until all of the causes have been fixed.

    39. Re:what about servers? by cynyr · · Score: 1

      Same on linux with CFQ and 2.6.34+ (earlier maybe as well).

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    40. Re:what about servers? by cynyr · · Score: 1

      what patches? 2.6.36 should be just fine. If your distro doesn't provide one pre-built for you roll your own, or wait.

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    41. Re:what about servers? by ksandom · · Score: 1

      It may also be kernel version dependent - with older kernels still showing this bug.

      Good point. I do keep everything very up-to-date. I have come across the problem in the past, so I definitely wasn't wasn't meaning to be dismissive. However some machines were affected by it, and some weren't (using equivilent installs).

      My point was that the problem isn't as universal as I felt was being implied. But yes, it totally does need to be addressed 'cause it's a royal pain in the bum when it affects you.

      If you feel it's relevant in some way, I've been using linux for over 10 years... As I write that realise how old linux is... then how old I am. D'oh!

      --
      Funnyhacks - Wierd, unusual, and fun hacks
    42. Re:what about servers? by ksandom · · Score: 1

      It's a shame it was marked as flamebait because it was a good test. And I agree that it needs to be fixed. However, to quote my reply to someone else's reply:

      I have come across the problem in the past, so I definitely wasn't wasn't meaning to be dismissive. However some machines were affected by it, and some weren't (using equivilent installs).

      My point was that the problem isn't as universal as I felt was being implied. But yes, it totally does need to be addressed 'cause it's a royal pain in the bum when it affects you.

      So:

      And people like you still keep denying the problem...

      Appologies. That wasn't the intention, although I can see how it could have come across that way

      Peace :)

      --
      Funnyhacks - Wierd, unusual, and fun hacks
    43. Re:what about servers? by Anpheus · · Score: 1

      I'd switch your antivirus to something like Microsoft Security Essentials, which doesn't seem to have the nasty egregious behavior yours does.

      It's a running joke that Symantec's goal is to choke your system for resources so bad the virus will [delete itself, be unable to accomplish anything, &c.]

    44. Re:what about servers? by Anpheus · · Score: 1

      It's the same as how you constantly hear about how the latest Firefox fixes The Dreaded Firefox Memory Leak.

      I figure they'll get it eventually.

    45. Re:what about servers? by Something+Witty+Here · · Score: 1

      > And FreeBSD has its own effort for that as well.

      Could you point me toward this effort please?

      Unix grew up on machines where CPU was nearly
      always the bottleneck. But over the years CPUs
      have increased in speed more than i/o has, so
      now i/o is often the bottleneck.

      I am convinced that a process that generates
      data faster than a device can sink it will
      fill up memory, starving other processes.

      BTW, most web forums provide a way to send
      someone a "private message", but I can't find
      one on slashdot. Does /. have a similar facility,
      or if not, why not?

    46. Re:what about servers? by F.Ultra · · Score: 1

      Not if the fix fixed it for the particular case that the user experienced. That there are other users experiancing lags due to different use cases is another issue.

    47. Re:what about servers? by Anonymous Coward · · Score: 0

      Therefore it can't possibly be a problem at all! +5 insightful

    48. Re:what about servers? by Anonymous Coward · · Score: 0

      because it's priority algorithms

      "its".

      memory, often
      dropped, it

      ";".

  3. have you tried ionice? by larry+bagina · · Score: 5, Informative

    have you tried ionice?

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

    1. Re:have you tried ionice? by Anonymous Coward · · Score: 0

      They should put that in the file transfer box gui maybe in a pull down with three priority levels.

    2. Re:have you tried ionice? by atrimtab · · Score: 5, Informative

      ionice works great in a terminal window, but isn't integrated into any of the Desktop GUIs.

      I suppose you could prefix the various file transfer commands used by the GUI with an added "ionice -c 3", but I haven't bothered to look.

      Using ionice to lower the i/o priority of various portions of MythTV like mythcommflag, mythtranscode, etc. can make it quite snappy.

      --
      Facebook is billions of individual "Skinner Boxes." And if you use it you are the pigeon!
    3. Re:have you tried ionice? by fishbowl · · Score: 1

      I thought this article was pretty good.

      http://www.askapache.com/linux-unix/optimize-nice-ionice.html

      --
      -fb Everything not expressly forbidden is now mandatory.
    4. Re:have you tried ionice? by jedidiah · · Score: 1

      Perhaps the appalling lack of storage space on most Macs is why you don't ever see this sort of problem.

      --
      A Pirate and a Puritan look the same on a balance sheet.
    5. Re:have you tried ionice? by Anonymous Coward · · Score: 0

      Too bad Apple doesn't offer 1TB drives as an option Oh wait, they do

    6. Re:have you tried ionice? by Spaham · · Score: 0, Troll

      what do you mean exactly ???
      I have 4.5 Tb inside my macpro and some more externally, and more on my LAN...
      how can this be scored 2 ???

    7. Re:have you tried ionice? by daveime · · Score: 1

      Perhaps because the parent said "most Macs", and not "Spaham's Mac" ?

      Really, it's a valid comment. Just because it's about something Apple, you DON'T have to take it as a personal attack, no matter what they told you at the last I-meter test session.

    8. Re:have you tried ionice? by daveime · · Score: 3, Funny

      Unfortunately, due to the global recession, the only person who can currently afford to buy one is the Sultan of Brunei.

    9. Re:have you tried ionice? by LordMyren · · Score: 1

      let's add in some perspective: no matter what io scheduler you are using, that scheduler relies upon the user and the user's applications to tell the scheduler what priority to run things at. ionice is that program. if you dont use ionice or something equivalent, io intensive ops will starve other applications, because the scheduler wont know that it's a low priority job. that said, if you are experiencing programs utterly freezing, you might consider the Deadline scheduler, which uses response time for a request as it's performance metric. by default, it tries to insure all reads are satisfied within 500ms and all writes are satisfied within 5s, and this is tunable.

    10. Re:have you tried ionice? by Anonymous Coward · · Score: 0

      > Perhaps the appalling lack of storage space on most Macs is why you don't ever see this sort of problem.

      Hehe I see what you did! You turned this into a Mac problem! Congratulations!

      Funny how when a legitimate concern for a long-time Linux user is mentioned, some Linux pundits try to distract from the problem by blaming other platforms. Why not try to provide something constructive instead of whining like a little bitch.

    11. Re:have you tried ionice? by JohnFluxx · · Score: 4, Informative

      Poor me! I added ionice integration into KDE since pretty much the dawn of time.

      In KDE, just press ctrl+esc to bring up my System Activity, right click on a process, then chose renice. You get a really pretty (imho heh) dialog letting you change the CPU or hard disk priority, scheduler, and so on.

    12. Re:have you tried ionice? by julesh · · Score: 1

      . if you dont use ionice or something equivalent, io intensive ops will starve other applications, because the scheduler wont know that it's a low priority job.

      CPU schedulers have had a heuristic since just about the dawn of time that states that processes using a lot of CPU should be automatically deprioritized in favour of those who use it sporadically. Why not use a similar heuristic for I/O schedulers?

    13. Re:have you tried ionice? by Anonymous Coward · · Score: 0

      ionice works great in a terminal window, but isn't integrated into any of the Desktop GUIs.

      It is in kde4

    14. Re:have you tried ionice? by amn108 · · Score: 1

      Let's add even more perspective: I think we can fairly assume that 99% of all "desktop" Linux users would prefer GUI responsiveness to boosting file copy speeds even up to 20%. As I mentioned elsewhere in this discussion, there are case studies that point out this fact - that for desktop users it's all about perceptive performance - how fast their buttons click back when they click on them and so on. Now, where am I going with this? Well, this means 'ionice' will not help them, and the analogy here is that 'ionice' is like a scalpel in a situation demanding a brain controlling a hand holding a scalpel. Which happens to be... the OPERATING SYSTEM kernel. Part of the reason we have computers is for them to aid us in our lives, often give us more free time. Today, 50% of those 99% of "desktop" Linux users have too little clue and/or time/desire to fiddle with 'ionice' on a case-by-case basis. In any case, 'ionice' is an ADDITION to, not a SUBSTITUTION for a solution to this problem. I don't mind 'ionicing' now and then, but I often want to spend my focus on things only human can do.

    15. Re:have you tried ionice? by PhrstBrn · · Score: 1

      If ionicing userland applications over system applications fixes this issue on the desktop then developers should fix the packages to do it by default.

    16. Re:have you tried ionice? by dangitman · · Score: 1

      have you tried ionice?

      Yes, I didn't just try ionice, I tried twiice.

      --
      ... and then they built the supercollider.
    17. Re:have you tried ionice? by Anonymous Coward · · Score: 0

      ionice doesn't help much when you're using FUSE filesystems such as ntfs-3g or zfs-fuse.

    18. Re:have you tried ionice? by amn108 · · Score: 1

      If you let application developers (one of the least experienced group of developers out there) be responsible for responsiveness of desktop GNU/Linux, it is doomed. You need to enforce this from bottom-up, not top-to-bottom. The reality is that application code quality depends on the development environment. It's bad enough a lot of Linux applications are completely unmanaged and require decent knowledge of C in order not to suck. THe bold mission to educate those developers about how THEY need to account for responsiveness issues in THEIR application code is suicide. You can't expect the entire ecosystem to start shifting towards better I/O code. Just look at the state of network programming on Linux - it's VERY hard to develop a server for instance - there are so many things one needs to grok well - lingering sockets, thread synchronization, event handling using poll/epoll (entire libraries are written abstracting these for ease of use). You don't want the same level of difficulty programming file I/O, that's a step back, not forward. Like I said earlier, the proper focal point where this needs to be fixed is the kernel.

      If you are talking about fixing the standard C library (which includes the 'read' I/O routines) then that's the wrong place too, because the library only contains the wrappers, it's again the kernel doing the actual job, so it's again the kernel you need to patch in that case. You can of course introduce a level of abstraction on top of stdlib, which makes the I/O scheduling issue go away by means of intelligent/heuristic reading/writing, and that's the least of all evils here. But I would still rework the scheduler instead, everything else is beating around the bush.

    19. Re:have you tried ionice? by bollucks · · Score: 1

      have you tried ionice?

      ionice has no effect on disk writes, and writing is where the problem occurs.

    20. Re:have you tried ionice? by Anonymous Coward · · Score: 0

      Really, it's a valid comment.

      No, it's really not. It's just an ad hom attack, in this case the less common circumstantial version of ad hom rather than the usual abusive. And it doesn't make a lick of sense, even as an ad hom. The amount of storage isn't what causes IO scheduling / interactivity problems, it's the fact that there's a lot of IO to schedule and slow disks serving the requests.

      As a matter of fact, all those Mac models with only a single internal disk bay are MORE likely to encounter IO scheduling pressure than a Mac with more disks because there's no chance the IO load will be spread across several disks, which generally tends to speed things up, as every good DB admin knows.

    21. Re:have you tried ionice? by badkarmadayaccount · · Score: 1

      Per application (type?), per job type, settings, persistent across the system? SELinux style application profile setting integrated in the package by maintainers would be a better solution. Hell, I run Fedora 13 with SELinux on full blast, and having no issues so far, except for one quickly resolved bug. Keep in mind the SEL has been running since the box was a fresh of the repo FC12 install.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
  4. Perhaps you should.. by Anonymous Coward · · Score: 3, Insightful

    ..download and compile the 2.6.36 kernel. A feature of the changes can be found at http://www.h-online.com/open/features/What-s-new-in-Linux-2-6-36-1103009.html

    A very very easy to follow guide can be found at http://kernel.net/articles/how-to-compile-linux-kernel.html

    Sidenote - What is up with not being able to paste links? That's annoying.

    1. Re:Perhaps you should.. by biryokumaru · · Score: 0, Troll

      Actually, I much prefer Slashdot's HTML style comment system. Maybe you should just not be lazy.

      --
      When you're afraid to download music illegally in your own home, then the terrorists have won!
    2. Re:Perhaps you should.. by Qzukk · · Score: 3, Interesting

      Theres a bug in chrome that causes it to usually be unable to paste into slashdot's comment box once you've placed an < character in the box. (Slashdot, specfically. It does fine on all sorts of other sites with even fancier ajaxy textareas like the stackoverflow sites)

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    3. Re:Perhaps you should.. by biryokumaru · · Score: 1

      That's odd. I use Chrome and I've never had that issue. I'm on Windows 7, what's your OS?

      --
      When you're afraid to download music illegally in your own home, then the terrorists have won!
    4. Re:Perhaps you should.. by No.+24601 · · Score: 1

      That's odd. I use Chrome and I've never had that issue. I'm on Windows 7, what's your OS?

      I have observed this problem on Chrome for Mac and Chrome for Linux (Ubuntu). Chrome 6 & 7 (the latest).

    5. Re:Perhaps you should.. by SirThe · · Score: 1

      I use Chromium on Ubuntu 10.04, but I didn't use any <, so not sure what happened. Also, HTML comment style? Why would that prevent me from pasting a link?

    6. Re:Perhaps you should.. by Anonymous Coward · · Score: 1, Insightful

      Lazy? Why would I want to type html ever? Have a mode for nerds who want to type their newlines and bold for no reason, and a mode for normal people who would just click the button for it like on any good forum for bbcode.

    7. Re:Perhaps you should.. by HeronBlademaster · · Score: 1

      I've been wondering why I can't paste into Slashdot comment boxes...

    8. Re:Perhaps you should.. by Dahamma · · Score: 1

      Yup, happens to me with Chrome for Linux (Fedora) as well as Windows XP and 7. Pretty annoying...

    9. Re:Perhaps you should.. by Anonymous Coward · · Score: 0

      I've never seen it on Chrome on Linux (multiple Ubuntu variants and Gentoo), either...

    10. Re:Perhaps you should.. by hasdikarlsam · · Score: 1

      Are you quite sure that's actually Chrome? Slashdot's javascript does rather suck.

    11. Re:Perhaps you should.. by cynyr · · Score: 1

      http://www.greencarreports.com/blog/1050675_next-gen-mazda2-will-return-70-mpg-without-an-electric Ignore this link, i was testing pasting.

      Wow... is there a bug open for that? because it's really annoying...

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    12. Re:Perhaps you should.. by cynyr · · Score: 0, Troll

      Because using gvim and then pasting that is faster/easier than trying to format a long post in the stupid textarea on most forums.

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    13. Re:Perhaps you should.. by Anonymous Coward · · Score: 0

      You probably suck at using forums, then. All of the major forums have proper facilities now.

  5. BFS Isn't Unsupported by ehntoo · · Score: 5, Informative

    Con Kolivas is still actively working on BFS, it's not unsupported. He's even got a patch for 2.6.36, which was only released on the 20th. http://ck.kolivas.org/patches/bfs/ He's also got a patchset out that I use on all my desktops which includes a bunch of tweaks for desktop use. http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/

    1. Re:BFS Isn't Unsupported by emergentessence · · Score: 2, Interesting

      I had been wondering about this myself, for some reason I was under the impression that the BFS was no longer being maintained.

      It turns out there is an up-to-date package for Ubuntu (I'm running 10.10) as well: http://launchpad.net/~chogydan/+archive/ppa

      I thought I'd try it out as the installation was much more straightforward than I'd expected.

      'uname -r' now reveals "2.6.35-22ck-generic" and, while this is just my subjective assessment, a few of the quirks I had noticed before on my own system where things would get sluggish when switching between apps / opening closing apps while running things that read/write to the disk, seem to have been ironed out.

      I would love to test this in a more empirical manner, as I can now boot into either kernel to do comparisons, but I don't know of any software that would allow me to benchmark performance in a way that is sensitive to the optimizations the BFS allegedly implements.

    2. Re:BFS Isn't Unsupported by Spewns · · Score: 1

      Con Kolivas is still actively working on BFS, it's not unsupported. He's even got a patch for 2.6.36, which was only released on the 20th.
      http://ck.kolivas.org/patches/bfs/

      He's also got a patchset out that I use on all my desktops which includes a bunch of tweaks for desktop use.
      http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/

      No kidding. Talk about misinformation. An editor should really fix the summary.

    3. Re:BFS Isn't Unsupported by pinkeen · · Score: 1

      I didn't check now, but last time I checked (around the time when CK mentioned in an interview that he gives up kernel hacking) he was quite a few releases behind. Maybe I was checking in the wrong place or something. Nevertheless, my bad.

    4. Re:BFS Isn't Unsupported by sznupi · · Score: 1

      And apparently used also by some of the more popular Android "community" firmware releases (*). Makes sense on such machines / one might think Google would want to push now also improvements of performance which aren't mainly about servers?

      (*)BTW, /. should know this one - what would be the best central hub of such activities, helping to determine which phones have the best chance of remaining well supported into the future?

      --
      One that hath name thou can not otter
    5. Re:BFS Isn't Unsupported by Anonymous Coward · · Score: 0

      Do you have any idea why Ubuntu is not using this for their desktop OS flavour? I understand this (may) not be suitable for Ubuntu Server edition.

    6. Re:BFS Isn't Unsupported by ehntoo · · Score: 1

      You're probably thinking of when CK gave up kernel hacking back during the Staircase Deadline days. That was /many/ years ago, though, and his ventures with BFS signified him picking kernel hacking back up.

    7. Re:BFS Isn't Unsupported by TehClaws · · Score: 1

      I installed the BFS with 2.6.34 and I have not looked back since - I can wholeheartedly recommend this scheduler, it WILL make up for the time spent figuring out how to recompile a kernel if you're a newbie. Lag is not acceptable on a modern desktop.

  6. Perhaps if Con Kolivas named his scheduler .. by Anonymous Coward · · Score: 1, Insightful

    Perhaps if Con Kolivas named his scheduler ...named his scheduler something else, it might gain more traction ...

    x

    1. Re:Perhaps if Con Kolivas named his scheduler .. by ScrewMaster · · Score: 1

      Perhaps if Con Kolivas named his scheduler ...named his scheduler something else, it might gain more traction ...

      x

      Maybe it's like the BFG9000 in the original DOOM.

      --
      The higher the technology, the sharper that two-edged sword.
    2. Re:Perhaps if Con Kolivas named his scheduler .. by m50d · · Score: 3, Informative

      He tried that before. I think he's given up on getting his scheduler (though perhaps not a suspiciously similar one written by Inigo) in the kernel after what happened with CFQ.

      --
      I am trolling
    3. Re:Perhaps if Con Kolivas named his scheduler .. by Ingo+Molnar · · Score: 4, Informative

      He tried that before. I think he's given up on getting his scheduler (though perhaps not a suspiciously similar one written by Inigo) in the kernel after what happened with CFQ.

      One reason for why the principle of CFS may seem to you so suspiciously similar to Con's SD scheduler is that i used Con's fair scheduling principle when writing the initial version of CFS. This is credited at the very top of today's kernel/sched.c [the scheduler code]:

        * 2007-04-15 Work begun on replacing all interactivity tuning with a
        * fair scheduling design by Con Kolivas.

      It was added in this commit.

      The scheduler implementations (and even the user visible behavior) of the schedulers was and is very different - and there is where much of the disagreement and later flaming came from.

      Note that this particular Slashdot article is about IO scheduling though - which is unrelated to CPU schedulers. Neither Con nor i wrote IO schedulers.

      There are two main IO schedulers in Linux right now: CFQ and AS, written by Jens Axboe, Nick Piggin, et al.

      What adds fuel to the confusion is that it is relatively easy to mix up 'CFQ' with 'CFS'.

      Thanks,

      Ingo

    4. Re:Perhaps if Con Kolivas named his scheduler .. by IainCartwright · · Score: 1

      Do you mean more discrete, or do you mean 'Kolivax'?

  7. Linux I/O scheduling by Animats · · Score: 5, Insightful

    If the CPU utilization is that low, it's an I/O scheduling problem. See Linux I/O scheduling.

    The CFQ scheduler is supposed to be a fair queuing system across processes, so you shouldn't have a starvation problem. Are you thrashing the virtual memory system? How much I/O is going into swapping. (Really, today you shouldn't have any swapping; RAM is too cheap and disk is too slow.)

    1. Re:Linux I/O scheduling by Khyber · · Score: 1

      "RAM is too cheap and disk is too slow"

      Your disks might be too slow, but OUM-based MLC flash drives are so fast most current SSDs would look like 80's tech.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    2. Re:Linux I/O scheduling by pinkeen · · Score: 1

      I doesn't swap, in fact I don't even have a swap partition. The issue was present on all of the boxes I've had in the past few years so it isn't hardware specific I think.

    3. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      UNIX going back to 1983 at least in my experience ALWAYS hugely jacks up the priority of any process doing a LOT of I/O. When I had a computing lab assignment and I, along with 20 others, was logged into a VAX 750 running BSD, and I was up against a deadline, I used to issue a shell command to duplicate a 1MB file, I would see my priority jump way up. Then I could run my program quickly. After a few moments, my priority would be back to normal and my program would take much longer to run.

      When I have asked about the unix and linux schedulers acting this way, most people would tell me it was a feature, not a bug. Try it! You'll see that a huge copy gets its priority increased hugely, along with its parent process and that of further children.

    4. Re:Linux I/O scheduling by Compaqt · · Score: 1

      Just for curiosity's sake, you can't hibernate without a swap partition, can you?

      --
      I'm not a lawyer, but I play one on the Internet. Blog
    5. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      Your process can get an utterly fair allocation of block reads and still perform horribly if other IO is thrashing the buffer cache. Generally when I get complaints about IO concurrency, its not because an individual process is "hogging" the block device, but rather because concurrency is up, cache hits are down, and hence the total number of request hitting the block device are shooting up.

      On an idle system with 1G of free memory, doing a random walk through a couple of 100M files is going to be memory mapped in no time and you won't be limited by the disk at all.
      Do the same thing on a busy system with other processes pushing your files out of buffer cache though, and suddenly you *need* the disk.

      The fundamental issue isn't a scheduling algorythm problem. The fundamental issue is that modern application run *horribly* without massive memory buffers between the app and the disk.

    6. Re:Linux I/O scheduling by SwashbucklingCowboy · · Score: 1

      It probably has to do with the queue depth on the disk drives.

      With a write task in the background it could easily fill the queue on the disk drive. Drives often use an elevator algorithm to fulfill I/Os. So, if the file being written by the background task is written sequentially on disk all of those I/Os will be completed before a read from another location on the disk gets performed. It potentially is much worse than that, suppose the write task fills the queue (e.g. 32 sequential I/Os). One of those gets completed and a read from the foreground process gets inserted into the queue. It very well could be for a location with a lower LBA on the disk than the writes so it's not going to get processed right away because of the elevator algorithm. The drive completes another write from the background task --- and guess what? Another write comes down for the same file. Because it's got a higher LBA it's going than the read it's going to be processed before the read because of the elevator algorithm. Another write comes down, same thing. Another write, same thing.

      If the data from the file being written is on the same disk then there's a good chance that a read for that file will break this chain and the read from the foreground process will be performed. However, if the file data is coming from another disk or from a network then that foreground process could be starved.

      Variations of the elevator algorithm can prevent total starvation, but it is designed to be maximize total throughput.

    7. Re:Linux I/O scheduling by ion.simon.c · · Score: 1

      Correct.

    8. Re:Linux I/O scheduling by ne0n · · Score: 1

      I've used Linux for years and this has been a problem as long as I can remember. CPU usage is low (I've got six cores anyways) but the desktop on my Ubuntu 9+ nearly halts while large files transfer in the background. I transfer a few DVD-sized files daily so it's a noticeable problem. No swap in use, only Nautilus and Chromium open, and a file transfer bogs down the system until it's completely finished.

      No swap used.
      Files are being transfered between separate physical non-RAID disks.
      Plenty free space on all disks.
      I've tried ext2/3/4 without any improvement.

      Now with the latest Ubuntu I've got a disk queued up for btrfs and can't wait to test that next. In the meantime, my crappy old XP machine has no such trouble copying the exact same files.

      --
      $ :(){ :|:& };:
    9. Re:Linux I/O scheduling by javabsp · · Score: 1

      What I have done for a while is have a swap partition that I disable normally, but have a wrapper script that swapon it and then hibernate. Eventually I don't care about it enough to use it.

    10. Re:Linux I/O scheduling by TheTrueScotsman · · Score: 1

      On the exact same hardware, I see the problem on Linux but not Windows 2008. I don't think it's down to disk queueing.

    11. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      it is possible to use tuxonice which does not require a swap part to hibernate

    12. Re:Linux I/O scheduling by HeronBlademaster · · Score: 1

      What does swap have to do with hibernation? It couldn't use the swap partition to save state, because the swap might contain state.

    13. Re:Linux I/O scheduling by julesh · · Score: 2, Insightful

      Your disks might be too slow, but OUM-based MLC flash drives are so fast most current SSDs would look like 80's tech.

      MLC flash has a life cycle of only around 10,000 writes, though, which for swap is way too small to be useful. Your lifespan on that SSD is likely to be only a couple of years, or even less for demanding applications, and the pricing on them is still high enough that DRAM isn't actually that much more expensive (I see about $4/GB for SSDs compared to about $16/GB for DRAM), at which point more RAM is probably the better way to go.

    14. Re:Linux I/O scheduling by Khyber · · Score: 2, Informative

      OUM MLC is FAR different than anything in typical use.

      Try 10^8 read/write.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    15. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      And yet the reality is that hibernation on Linux uses a swap partition. WTF are you going on about?

    16. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      Remember that it's the OS that fills the hardware queue.

    17. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      Hibernate works by swapping out everything so that you can turn off the computer and lose everything in RAM without losing state. Obviously that means if you can't fit all of state in your swap area you can't hibernate, but where else are you going to put it? Creating a file specifically to hibernate would do you no better than just making your swap that much bigger, and making it swap gives you extra swap space for free.

    18. Re:Linux I/O scheduling by Anonymous Coward · · Score: 0

      "RAM is too cheap and disk is too slow"

      Your disks might be too slow, but OUM-based MLC flash drives are so fast most current SSDs would look like 80's tech.

      They also don't exist yet, so who cares? And what does it have to do with the parent post?

  8. Not had the slightest problems with this by Giant+Electronic+Bra · · Score: 1

    Using Mandriva 2010.0 (or on any earlier builds for that matter). Not sure if their stock kernel is using scheduling patches or not but the only time I've ever seen slowdowns on my wimpy P4 machine is with really serious oversubscribing to memory, which obvious will turn it into a dog. IO seems to have little to no effect however.

    So maybe you just need a better desktop distribution? A newer one perhaps? Don't expect that if you slap just any old distro on a machine and call it a workstation that you get something beyond garbage. I'd expect Suse and/or Fedora to work equally well. Ubuntu is probably doing OK but I wouldn't know. Most of the smaller/less mainstream distros however are quite random, and running something like CentOS on a desktop is just asking for a crappy desktop.

    --
    "Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
    1. Re:Not had the slightest problems with this by frisket · · Score: 2, Informative

      I'm using Ubuntu 10.4 on an old Dell and big copies don't seem to slow it down any more than I'd expect on an old machine, either when copying to an external USB backup (with rsync) or over the net to my office systems (via scp). Serious slowdown would seem to indicate something deeper is wrong.

    2. Re:Not had the slightest problems with this by Rockoon · · Score: 0

      I'm using Ubuntu 10.4 on an old Dell and big copies don't seem to slow it down any more than I'd expect on an old machine

      Your expectations are screwed up. A copy of any size should not impair the responsiveness of the system. Even for very old systems (80386), the CPU is so much faster than the hard drive that the amount of CPU cycles consumed by a copy process should be well within a rounding error that will show 0% usage. If this is not the case, then something is wrong with either the scheduler or the copy algorithm.

      --
      "His name was James Damore."
    3. Re:Not had the slightest problems with this by Rob+Y. · · Score: 1

      Am I a spoilsport to point out that any distro version named 2010.* is not so old as to excuse a serious performance problem...

      --
      Posted from my Android phone. Oh, I can change this? There, that's better...
    4. Re:Not had the slightest problems with this by Rick17JJ · · Score: 1

      I use Kubuntu 10.04 Linux at home, but have not noticed any obvious slowdown when copying large amounts of data in the background. At the moment I am using rsync to back up the files from my SATA hard disk to an external USB hard drive. I also have several other programs such as OpenOffice, Firefox, Inkscape, Dolphin and the system monitor open at the same time.

      I have a several year old dual core AMD-64 with 2 GB of memory. I also have a 2 GB swap file on the hard drive. The computer is probably about 4 years old. While backing up my files with rsync, right now, one CPU is running at about 94 %, the other CPU is varying between 30% and 80 %. Right now, the CPU speed for each processor is varying between 1 GHz and 2.2 GHz, with both CPUs taking it easy, and saving electricity, by running at just 1 GHz most of the time.

      I am not noticing any obvious slowdown while backing up my data with rsync.

  9. Perhaps you should... by SirThe · · Score: 1

    ..download and compile the 2.6.36 kernel. A feature of the changes can be found at http://www.h-online.com/open/features/What-s-new-in-Linux-2-6-36-1103009.html A very very easy to follow guide can be found at http://kernel.net/articles/how-to-compile-linux-kernel.html Sidenote - What is up with this comment not showing up when I wasn't registered. That's stupid and annoying.

    1. Re:Perhaps you should... by biryokumaru · · Score: 2, Funny

      Sidenote - What is up with this comment not showing up when I wasn't registered. That's stupid and annoying.

      It did. Now who's stupid and annoying? I mean, besides me.

      --
      When you're afraid to download music illegally in your own home, then the terrorists have won!
    2. Re:Perhaps you should... by SirThe · · Score: 1

      Heh, it wasn't there when I first refreshed, nor after I registered and came back. Not sure why it was hidden, my bad.

  10. May be Fixed by IQgryn · · Score: 1

    The 2.6.36 kernel supposedly has a fix for this issue. I haven't been able to test it yet myself, but it sounds like they finally tracked it down. See here for more information.

    1. Re:May be Fixed by IQgryn · · Score: 1

      The link I posted looks broken from here. If it is, the full text of it is: http://kernelnewbies.org/Linux_2_6_36#head-738bffb3415051b478ecdfd2eabb0294e35146a9

  11. Is it really only a matter of scheduling? by mrjb · · Score: 4, Interesting

    I've wondered on occasion if this problem is really only due to scheduling. After all, most of us still write our file access code more or less as follows: x=fopen('somefilename'); while ( !eof(x)) { print readln(x,1024); /* ---- */ } fclose(x); Point being, there's nothing that tells the marked line that the process should gracefully go to sleep while the drive is doing its thing, and there's no callback vector defined either- nothing that indicates we're dealing with non-blocking I/O. I'd like to think that our compilers have silently been improved to hide those implementation details from us, but I have no proof that this is the case. Unless the system functions use some dirty stack manipulation voodoo to extract the return address of the function and use that as callback vector?

    --
    Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
    1. Re:Is it really only a matter of scheduling? by Anonymous Coward · · Score: 5, Informative

      The kernel will preempt the process calling "readln", in other words putting it to sleep.
      The kernel will make sure the I/O happens, allowing other processes to work at the same time.
      You only need non-blocking code if your own process needs to other things at the same time.

    2. Re:Is it really only a matter of scheduling? by Anonymous Coward · · Score: 4, Informative

      The process will go to sleep inside the read() system call (inside readln() somewhere presumably). Other processes will be able to run in the meantime. It works by interrupting into kernel code, and the kernel changes the stack pointer (and program counter, and lots of other registers) to that of another process. When the data comes back from the disk, the kernel will consult its tables and see that your process is runnable again, and when the scheduler decides it's its turn, in a timer interrupt, the stack pointer will be switched back to your stack. (So yes, dirty stack manipulation voodoo.) Every modern OS works this way.

    3. Re:Is it really only a matter of scheduling? by SuricouRaven · · Score: 1

      Depending on the drive, sometimes application behavior can be an issue. A program that calls fwrite 1024 times with a kilobyte buffer will act quite differently to one that calls it just once with a megabyte buffer. The former will promote fragmentation, and often cause the drive to thrash around (unless it's an SSD) if there is other IO going on simutainously, which really kills performance. A single large write completes faster than a thousand small ones.

    4. Re:Is it really only a matter of scheduling? by Anonymous Coward · · Score: 0

      That really isn't anything that you're supposed to write code to do.

      The kernel itself is what is doing the scheduling, you see. Programs that aren't I/O intensive should not have to come to a stand-still when programs that are I/O intensive run.

    5. Re:Is it really only a matter of scheduling? by onefriedrice · · Score: 1

      ... nothing that indicates we're dealing with non-blocking I/O ...

      Because it typically isn't non-blocking IO. The process can obviously request non-blocking, but the default (and most used) is blocking. So the process actually will sleep as it is supposed to if it's written correctly. It would not be the kernel's fault if a process requests a non-blocking fd and enters into a tight loop which spends more time looping than writing.

      --
      This author takes full ownership and responsibility for the unpopular opinions outlined above.
    6. Re:Is it really only a matter of scheduling? by dotgain · · Score: 1
      Blocking I/O is hardly a new phenomenon. The first thing that happens to any process that needs a read from disk is to get knocked out to sleep. In terms of CPU clock cycles, a hard drive seek is like an entire season.

      What's more - processes that are put to sleep in this manner usually wake with a higher priority than usual, on the assumption they're more I/O bound than CPU bound.

    7. Re:Is it really only a matter of scheduling? by seebs · · Score: 0, Offtopic

      I sincerely hope that most of us don't write our code like that, because EOF is a past-tense check, not a future-tense check. The usual idiom is:

      while (fgets(stream)) /* do something */

      because feof(f) tells you whether the LAST read ALREADY FAILED due to EOF.

      --
      My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    8. Re:Is it really only a matter of scheduling? by WetCat · · Score: 1

      Hm. I afraid you are not correct.
      When in this part of code "drive is doing its thing" ?I
      It happens only in readln () and in readln process yields control to the kernel, which is doing scheduling and io.
        So it's up to kernel what to do in this case.

    9. Re:Is it really only a matter of scheduling? by Ingo+Molnar · · Score: 5, Informative

      Yes. Here there is another problem at play: cp reads in the whole (big) file and then writes it out. This brings the whole file into the Linux pagecache (file cache).

      That, if the VM is not fully detecting that linear copy correctly, can blow a lot of useful app data (all cached) out of the pagecache. That in turn has to be read back once you click within Firefox, etc. - which generates IO and is a few orders of magnitude slower than reading the cached copy. That such data tends to be fragmented (all around on the disk in various small files) and that there is a large copy going on does not help either.

      Catastrophic slowdowns on the desktop are typically such combined 'perfect storms' between multiple kernel subsystems. (for that reason they also tend to be the hardest ones to fix.)

      It would be useful if /bin/cp explicitly dropped use-once data that it reads into the pagecache - there are syscalls for that.

      And yes, we'd very much like to fix such slowdowns via heuristics as well (detecting large sequential IO and not letting it poison the existing cache), so good bugreports and reproducing testcases sent to linux-kernel@vger.kernel.org and people willing to try out experimental kernel patches would definitely be welcome.

      Thanks,

      Ingo

    10. Re:Is it really only a matter of scheduling? by Spaham · · Score: 1

      The OS should be doing the scheduling, and you should be able to keep doing this without bothering about the IO details...
      See I won't go into flamebait mode and say that with xxx I don't have to worry about all that :p

    11. Re:Is it really only a matter of scheduling? by blueg3 · · Score: 1

      Here there is another problem at play: cp reads in the whole (big) file and then writes it out.

      While certainly the whole file may end up cached, the source for cp does a simple read/write with a small buffer -- not read in the whole file and then write it out.

    12. Re:Is it really only a matter of scheduling? by fahrbot-bot · · Score: 1

      After all, most of us still write our file access code more or less as follows: x=fopen('somefilename'); while ( !eof(x)) { print readln(x,1024); /* ---- */ } fclose(x);

      Actually, I like this sequence [ open/fstat/mmap/write/munmap/close ] and let the VM system do the work directly. A side benefit is that most of the run time is system (not user) time...

      --
      It must have been something you assimilated. . . .
    13. Re:Is it really only a matter of scheduling? by daveime · · Score: 2, Interesting

      Wow, that's a new one ?

      Perform a non-necessary fget on a file already known to be zero bytes, just so we can get a result "this fget failed because the file is zero bytes".

      while (!eof()) {
              readsomething();
      }

      is something I learnt perhaps 20 years ago, and it's never failed me yet. Why must people always try reinventing the wheel, just to end up with an octagon ?

    14. Re:Is it really only a matter of scheduling? by Ingo+Molnar · · Score: 3, Informative


      While certainly the whole file may end up cached, the source for cp does a simple read/write with a small buffer -- not read in the whole file and then write it out.

      Many apps or DB engines will have a similar pattern: they read/write in a relatively small buffer, but then expect the exact opposite of what you'd expect /bin/cp to do: they expect the file to stay cached (because they will read it again in the future).

      So the kernel cannot know why the files are being read and written: will it be needed in the future (Firefox sqlite DB) or not (cp of a big file).

      (Unfortunately, the planned mind reading extension to the kernel is still a few years out.)

      Even in the specific case of /bin/cp often the files might be needed shortly after they have been copied. If you have 4 GB of RAM and you are copying a 750 MB ISO, you'd expect that ISO to stay fully cached so that the CD-writer tool can access it faster (and without wasting laptop power), right?

      So in 99% of the cases it is the best kernel policy to keep around cached data as much as possible.

      What makes caching wrong in the "copy huge ISO around" case is that both files are too large to fit into the cache and that cp reads and writes to the totality of both files. Since /bin/cp does not declare this in advance the kernel has no way of knowing this for sure as the operation progresses - and by the time we hit limits it's too late.

      It would all be easier for the kernel if cp and dd used fadvise/madvise to declare the read-once/write-once nature of big files. It would all just work out of box. The question is, how can cp figure out whether it's truly use-once ...

      The other thing that can go wrong is that arguably other apps should not be affected by this negatively - and this was the point of the article as well. I.e. cp may fill up the pagecache, but those new pages should not throw out well-used pages on the LRU, plus other write activties by other apps should not be slowed down just because there's a giant copy going on.

      Those kinds of big file operations certainly work fine on my desktop boxes - so if you see such symptoms you should report it to linux-kernel@vger.kernel.org, where you will be pointed to the right tools to figure out where the bug is. (latencytop and powertop are both a good start.)

      Note that i definitely could see similar problems two years ago, with older kernels - and a lot of work went into improving the kernel in this area. v2.6.35 or v2.6.36 based systems with ext3 or some other modern filesystem should work pretty well. (The interactivity break-through was somewhere around v2.6.32 - although a lot of incremental work went upstream after that, so you should try as new of a kernel as you can.)

      Also, i certainly think that the Linux kernel was not desktop-centric enough for quite some time. We didn't ever ignore the desktop (it was always the primary focus for a simple reason: almost every kernel developer uses Linux as their desktop) - but the kernel community certainly under-estimated the desktop and somehow thought that the real technological challenge was on the server side. IMHO the exact opposite is true.

      Fortunately, things have changed in the past few years, mostly because there's a lot of desktop Linux users now, either via some Linux distro or via Android or some of the other mobile platforms, and their voice is being heard.

      Thanks,

      Ingo

    15. Re:Is it really only a matter of scheduling? by zenyu · · Score: 1

      It would be useful if /bin/cp explicitly dropped use-once data that it reads into the pagecache - there are syscalls for that.

      Other than opening the files O_DIRECT, how would you do that?

    16. Re:Is it really only a matter of scheduling? by Ingo+Molnar · · Score: 1

      It would be useful if /bin/cp explicitly dropped use-once data that it reads into the pagecache - there are syscalls for that.

      Other than opening the files O_DIRECT, how would you do that?

      No need for O_DIRECT (which might not even work everywhere), /bin/cp could use fadvise/madvise with some size heuristics. (say if a file is larger than RAM and will be copied fully then it cannot be reasonably cached)

      POSIX_FADV_DONTNEED should do the trick in terms of pagecache footprint - it will invalidate the page-cache.

      Thanks,

      Ingo

    17. Re:Is it really only a matter of scheduling? by rdnetto · · Score: 1

      Yes. Here there is another problem at play: cp reads in the whole (big) file and then writes it out. This brings the whole file into the Linux pagecache (file cache).

      Since you seem to know what you're talking about, I'll post this here in the hope that you at least have a general idea of how to answer my question.
      Does anyone know if this is related to the atrocious write performance on USBs? The performance seems to asymptote to 0 when copying files with either Nautilus or cp, regardless of filesystem. Using dd with a large (100M) blocksize seems to resolve it, so I'm thinking it has something to do with lots of small, frequent writes to the USB.

      --
      Most human behaviour can be explained in terms of identity.
    18. Re:Is it really only a matter of scheduling? by hyperion2010 · · Score: 1

      (Unfortunately, the planned mind reading extension to the kernel is still a few years out.)

      So I know some people may read this and think "haha, funny joke" but given that most users are extremely predictable regarding what programs they use and when and how they use them (same with web browsing), shouldnt it be possible to gather user activity over time and analyze it to help improve scheduling. Hell, programs are more predictable about how they call for reads and writes, if the IOS preempts the program by loading stuff into cache that is likely to be needed when it doesnt have anything else to do we could totally speed stuff up. In theory beyond some basic data security needs the IO scheduler could vastly improve its cache performance by simply being fed data on what things the user and/or their programs tended to access repeatedly. Maybe this is too high level for some basic tasks, but it seems like there is plenty of use data that could be gathered to help teach an IOS what types of data are more likely to see repeated reads.

      On the other hand, we could simply use OUR brains to write better code so that we didnt have to waist our computer's valuable time. Or for that matter other programmers' valuable time that could be spent making computers better (more efficient) tools rather than writing mindbogglingly complex statistical predictive IO schedulers to cover for our inability to follow proper program design.

    19. Re:Is it really only a matter of scheduling? by Anonymous Coward · · Score: 0

      "(Unfortunately, the planned mind reading extension to the kernel is still a few years out.)"

      Not good enough, man! Put some backbone into it!

    20. Re:Is it really only a matter of scheduling? by Anonymous Coward · · Score: 0

      > What makes caching wrong in the "copy huge ISO around" case is that both files are too large to fit into the cache and that cp reads and writes to the totality of both files. Since > /bin/cp does not declare this in advance the kernel has no way of knowing this for sure as the operation progresses - and by the time we hit limits it's too late.

      Like using posix_fadvise() ?
      Too bad it doesnt really work for things like "i want to copy huge amount of data from one place to another without taking the entire system down until it has finished".

      Have you tried using posix_fadvise() lately? and verified that it works in some meaningful capacity ?

      Thank god for O_DIRECT.

    21. Re:Is it really only a matter of scheduling? by Ingo+Molnar · · Score: 2, Interesting


      So I know some people may read this and think "haha, funny joke" but given that most users are extremely predictable regarding what programs they use and when and how they use them (same with web browsing), shouldnt it be possible to gather user activity over time and analyze it to help improve scheduling.

      Yeah, that's certainly a possibility.

      This is also the goal of most heuristics in the kernel: to figure out a hidden piece of information that the application (and user) has not passed to the kernel explicitly.

      The problem comes when the kernel gets it wrong - the kernel and applications can easily get into a feedback loop / arms race of who knows how to trick the other one into doing what the app writer (or kernel writer) thinks is best. In such cases we get the worst of both worlds: we get the bad case and we get the cost of heuristics.

      (Heuristic and predictive systems also tend to be complex and hard to analyze: you can rarely reproduce bugs without having the exact same filesystem layout and usage pattern as the user experienced, etc.)

      What we found is that in terms of default behavior it's a bit better to keep things simple and predictable/deterministic and then give apps the way to inject extra information into the kernel. We have the fadvise/madvise calls which can be used with the POSIX_FADV_DONTNEED flag to drop cached content from the page cache.

      Heuristics and predictive techniques are done when we can be reasonably sure that we get the decisions right: for example there's a piece of fairly advanced code in the Linux page cache trying to figure out whether to pre-fetch data or not.

      The large file copy interactivity problems some have mentioned here were most likely real kernel bugs (in the filesystem, IO scheduling and VM subsystems) and were hopefully fixed in the v2.6.33 - v2.6.36 timeframe.

      If you can still reproduce any such problems then please report them to linux-kernel@vger.kernel.org so we can fix it ASAP.

      In any case, we could all be wrong about it, so if you have a good implementation of more aggressive predictive algorithms i'm sure a lot of people would try them out - me included. We kernel developers want a better desktop just as much as you want it.

    22. Re:Is it really only a matter of scheduling? by Anonymous Coward · · Score: 0

      I believe this behaviour of Linux to cache everything being read or written unless explicitly advised not to is plain wrong. If an application wishes for data to be cached, it ought to read it in to user pages and leave it there until it no longer wants it. It might make sense for the kernel to cache file pages while there is free memory, but swapping out process memory to make room for io cache is braindamaged, the programmer has already indicated their intention that something should remain in memory by not writing back and freeing, so the kernel swapping that out is simply subversion of the application programmer's intent.

      I think a lot of the lousy and unpredictable performance of Linux comes from the aforementioned mindreading extension that is being attempted already. Virtual memory is bad enough, simply a hack for people who can't afford sufficient ram/can't write their programs to store resources intelligently, but all this heuristic second-guessing in IO, makes the performance of simple naive programs unpredictable, and makes it next to impossible to write code that performs well when required storage exceeds available memory.

    23. Re:Is it really only a matter of scheduling? by PhrostyMcByte · · Score: 1

      File access is usually blocking by default, which means the kernel will put the thread to sleep and context switch to another thread/process if the call will block. If you're turning on non-blocking mode, then you're expected to know what you're doing and not busy-wait on some I/O.

    24. Re:Is it really only a matter of scheduling? by KZigurs · · Score: 1

      small writes to any kind of flash memory (especially the cheap kind used in flash drives) will be slow and crappy due to the flash memory design.

    25. Re:Is it really only a matter of scheduling? by rbcd · · Score: 1

      Shouldn't the size heuristics be in kernel space? Why should cp be analysing the RAM on the system? Take a look at the obscene hacky amount of heuristics userspace ends up with here, for example: http://insights.oetiker.ch/linux/fadvise/

      IMHO, POSIX_FADV_SEQUENTIAL should be sufficient, but it doesn't seem to do anything useful (wrt. the page cache). I'm using POSIX_FADV_DONTNEED continuously on just-read pieces of file for an md5sum-type program (moderate CPU on a one-off sequential read), and this seems to work, but I'll also need to do the Oetiker mincore hack as referenced above in order to avoid evicting files out of the page cache if they were in there before.

      This is a massive hack though; why shouldn't POSIX_FADV_SEQUENTIAL suffice? IMHO the kernel should do the following heuristic on POSIX_FADV_SEQUENTIAL: for large files don't cause cache misses to populate the cache. And cp could then do a single posix_fadvise and be done with it.

    26. Re:Is it really only a matter of scheduling? by rdnetto · · Score: 1

      Then why does it take 4-10 times longer on Ubuntu compared to Windows? Windows can continuously copy files at ~8 MB/sec as you would expect, but Ubuntu slows down exponentially? Even a relatively small 124 MB file is copied only at ~1 MB/sec, and the average speed decreases as the file size increases.

      This is a simple, commonly performed task (copying files to a USB), yet Ubuntu's performance is orders of magnitude worse than Windows'. This is exactly the sort of thing that can prevent Linux of achieving widespread adoption.

      --
      Most human behaviour can be explained in terms of identity.
  12. CK patches for the kernel are always updated... by Anonymous Coward · · Score: 1, Informative

    "I've heard about the efforts of Con Kolivas and his Brainfuck Scheduler, but it's unsupported now and probably incompatible with latest kernels."

    I don't know what you're talking about: http://users.on.net/~ckolivas/kernel/
    It's updated for the latest kernel which came out just yesterday.

    1. Re:CK patches for the kernel are always updated... by pinkeen · · Score: 1

      Last time I checked (a few months) ago, he was quite a few releases behind. I haven't checked now, my bad. The thing is that I'm using Arch Linux and compiling custom kernel is a bit of pain in the ass on this platform. Nevertheless, this just should be upstream along with the pluggable io scheduling architecture.

    2. Re:CK patches for the kernel are always updated... by Arker · · Score: 1

      The thing is that I'm using Arch Linux and compiling custom kernel is a bit of pain in the ass on this platform.

      Not to be snarky, but that sounds like a compelling reason not to use Arch to me. I never tried it and after hearing that, I probably wont.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
    3. Re:CK patches for the kernel are always updated... by marsu_k · · Score: 1

      I'm not sure what the GP is referring to - I use Arch as well, and the process is quite simple. Actually I find that rebuilding packages with Arch is about as easy as it can be, the ABS/makepkg-combo works very well. And although Arch is very much bleeding edge, if one is very impatient and a new version of $APP has been just released, upgrading can be as simple as changing the version number in the PKGBUILD and running makepkg.

    4. Re:CK patches for the kernel are always updated... by Beelzebud · · Score: 1

      I would have to agree as an Arch Linux user as well. The idea that it's hard to build the kernel in Arch is, frankly, laughable.

    5. Re:CK patches for the kernel are always updated... by pinkeen · · Score: 1

      I dont remember what it was about, maybe it took a long time or something. It just should work out of the box, meaning good IO schduler.

    6. Re:CK patches for the kernel are always updated... by nicedream · · Score: 1

      Really, the ease of compiling packages from the Arch User Repository is what makes Arch Linux so nice. Download the tar.gz, extract, and run makepkg.
      In fact the new 2.6.36-ck kernel is already in the AUR/

    7. Re:CK patches for the kernel are always updated... by Arker · · Score: 1

      Doesnt look too awful, but still a lot more hassle than with Slack.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
  13. It is been worked on by Anonymous Coward · · Score: 0

    It is been worked on: http://kernelnewbies.org/Linux_2_6_36#head-738bffb3415051b478ecdfd2eabb0294e35146a9 and http://lkml.org/lkml/2010/10/19/123

  14. Con and his trolls by Anonymous Coward · · Score: 0

    Did Con unleash some of his trolls on Slashdot?

    Yeah, I think he just did ...

    1. Re:Con and his trolls by amn108 · · Score: 1

      Well, his trolls are more knowledgeable than you and your trolls :-P

    2. Re:Con and his trolls by edivad · · Score: 1

      Did Con unleash some of his trolls on Slashdot?

      Yeah, I think he just did ...

      Roger that.

  15. This is fixed or being worked on by Yfrwlf · · Score: 1

    Supposedly the 2.6.36 kernel addresses this issue. I don't know if the problem has been completely fixed, or mostly fixed, or what, since I haven't tried that kernel yet (too bad there isn't an easy way to install kernels in a cross-distro fashion!).

    Read the bullet points here, particularly the ones in the middle, as there has been multiple things done to this kernel to improve performance:
    http://www.h-online.com/open/features/What-s-new-in-Linux-2-6-36-1103009.html?page=6

    --
    Promote true freedom - support standards and interoperability.
    1. Re:This is fixed or being worked on by Anonymous Coward · · Score: 0

      Supposedly the 2.6.36 kernel addresses this issue. I don't know if the problem has been completely fixed, or mostly fixed, or what, since I haven't tried that kernel yet (too bad there isn't an easy way to install kernels in a cross-distro fashion!).

      Read the bullet points here, particularly the ones in the middle, as there has been multiple things done to this kernel to improve performance:

      http://www.h-online.com/open/features/What-s-new-in-Linux-2-6-36-1103009.html?page=6

      i don't know much about this but i recently upgraded to ubuntu 10.10 currently kernel 2.6.35.22 and file copy/cut, paste are much faster than 10.04. noticed it right off the bat after upgrade.

  16. Is Desktop Linux [still] relevant? by bogaboga · · Score: 0, Troll

    I ask this question with utmost sincerity. Folks Over here believe it is indeed dead. I am afraid I agree with them. I hear so little about desktop Linux these days. It's all about iOS, Android and RIM. The future does not appear to be on track to change anytime soon. Now tell me I am wrong and why.

    1. Re:Is Desktop Linux [still] relevant? by bieber · · Score: 4, Informative

      That was a joke, right? You don't really think that all the millions of desktop Linux users just up and vanished because some idiot at PCWorld wanted a catchy headline?

    2. Re:Is Desktop Linux [still] relevant? by 32771 · · Score: 1

      You are working for the wrong newspaper. Oh, oops that was supposed to meant 'reading' instead of 'working' but hey, its close enough.

      --
      Je me souviens.
    3. Re:Is Desktop Linux [still] relevant? by m6ack · · Score: 1

      As for me and my laptop... $ uname -a Linux mmm 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux

    4. Re:Is Desktop Linux [still] relevant? by Anonymous Coward · · Score: 0

      You're premise is wrong. It doesn't matter if an operating system has 99% market share or 1% market share so long as the OS is good and the community is good.

      The Linux desktop OS has never been better than it is today, when compared with Windows.

      The community? I don't know, but I've always been able to get help one way or another.

    5. Re:Is Desktop Linux [still] relevant? by Anonymous Coward · · Score: 0

      Define "relevant", anyway. Even if the numbers are dwindling (which is counter to my experience, but there's undoubtedly some degree of selection bias there), those using Linux on the desktop are undoubtedly overrepresented amongst Slashdot readers - so it may very well be relevant here while irrelevant elsewhere. That said, rest assured there are still some of us out here happy with what we have and working to make it better.

    6. Re:Is Desktop Linux [still] relevant? by westlake · · Score: 2, Informative

      That was a joke, right? You don't really think that all the millions of desktop Linux users just up and vanished because some idiot at PCWorld wanted a catchy headline?

      StatCounter provides a global breakdown of OS market share by region and country.

      It is something of a wake-up call when you look at these numbers and compare them to the endless stream of Linux success stories posted to Slashdot.

    7. Re:Is Desktop Linux [still] relevant? by thegarbz · · Score: 1

      It's called flavour of the month. Android and iOS are still new on the market. Everyone is keen to write some crap about it. Did you miss the stories about Ubuntu 10.10? How about multi-touch in Linux? Really if you want to get technical Ubuntu alone has had more press this year than OS X, so OS X is dead and irrelevant right?

    8. Re:Is Desktop Linux [still] relevant? by bieber · · Score: 1

      And what, exactly, am I supposed to be waking up to? It's not like I'm just now finding out that Linux doesn't hold a large market share on the desktop, and it's not like I'm going to start caring now. See, most of us measure the quality of an OS by its quality, not its market share...

    9. Re:Is Desktop Linux [still] relevant? by Reservoir+Penguin · · Score: 1

      So, what does you link prove exactly? Worldwide Linux users account for around 1% of users. A quick google search show that there are over 1 billion PCs worldwide which would account for at least 10 million desktop Linux users, hence "millions".

      --
      US-UK-Israel: The real Axis of Evil
    10. Re:Is Desktop Linux [still] relevant? by TheTurtlesMoves · · Score: 1

      At work: 55 Linux desktop boxes. 2 macs. Another 20 laptops with Linux, 10 with windows about 15 or so mac laptops. This is all just desktop/laptop machines of course. All the servers are sun or Linux. At home I have 3 machines, all Linux (slackware) and right now my daughter is doing her homework on one of them.

      The "year of the Linux desktop" may never come. And quite frankly i don't give a dam. I want a system that isn't a "do as your told" mac or a "your trial subscription to Norton antivirus has run out" comes with nothing windows. I want a system where i can get my work done. And for me that is Linux.

      And its not just our group, there are many more like this.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    11. Re:Is Desktop Linux [still] relevant? by TheTurtlesMoves · · Score: 1

      Yea, I know, you would think that OSX was popular or something with all the fuss /. makes about Apple.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    12. Re:Is Desktop Linux [still] relevant? by Gavagai80 · · Score: 1

      The link you gave says desktop linux is up more than 10% in popularity in the past year, though. Obviously not dying.

      --
      This space intentionally left blank
    13. Re:Is Desktop Linux [still] relevant? by Anonymous Coward · · Score: 0

      And what, exactly, am I supposed to be waking up to? It's not like I'm just now finding out that Linux doesn't hold a large market share on the desktop, and it's not like I'm going to start caring now. See, most of us measure the quality of an OS by its quality, not its market share...

      Yeah, well, by that metric Linux doesn't fare so well either. There's lots of reasons why it's still sub-1% even though it's available for the price of having a computer and internet connection to download it.

  17. if i have many gigs of data to copy over somewhere by FudRucker · · Score: 1

    i just run it and let it own the computer for whatever time it takes = anywhere from 10 to 30 minutes, and just walk off, maybe go get a fresh cup of coffee or cold beer depending on where i am and what time of day it is. one thing i dont want is a borked copy because i was too impatient to let it do its job.

    --
    Politics is Treachery, Religion is Brainwashing
  18. Re:easy solution: by 0123456 · · Score: 1, Troll

    You mean an OS like Windows which will swap out the web browser you're using when you copy a big file from one disk to another even though it's far too large for the entire file to fit in the disk cache?

  19. It has always been like that by guacamole · · Score: 2, Informative

    I can remember that even as far back as 1999 I saw this issue with Linux. This is not bad only for the desktop, but also for the server. I have also experience with Solaris workstations and servers, and it usually doesn't behave this way.

    1. Re:It has always been like that by CAIMLAS · · Score: 1

      It hasn't always been like that. I remember that, around 2000-2001, I was quite able to go about my business without much more than slightly perceivable lag doing:

      * kernel compiling
      * XFree86 compiling
      * large file transfers
      * and so on

      At the time, I actually didn't worry so much about having RAM, because I knew I had swap. It was mostly quite efficient for me. Performance degraded gracefully and gradually.

      Remember the alternative at the time? Yeah, Windows - where copying files over the network would result in similar performance. Or MacOS, where you might as well just go make some coffee if you want to do anything IO intensive.

      I'm not quite sure what it was that I was doing that was different than you (and others, apparently) were doing, but I do remember the almost immediate change (for me): it was around 2.6.18. Unfortunately, I don't remember anymore what it was that I'd moved from. It may have been a 2.4 kernel/distro (I was a big debian user, but I don't think I waited that long to upgrade :P). I know that current RedHat based distros still have 2.6.18 as their base (with massive backports), and it's plagued by the same I/O issues.

      One thing I can say for certain, and that's that Stormix, Debian, and Progeny Debian didn't suffer from these problems in the 1999-2003 timeframe - for me. I had no problems.

      I did find a couple things to help improve the situation, for my purposes, in the past couple years. They run contrary to convention, but agree with what I've heard from others running Linux in larger environments.

      * Run the anticipatory scheduler instead of CFQ. CFQ sucks. (Unfortunately, they killed the as scheduler in .30 something.)
      * Don't use ext3. Ext3 + cfq = death, for whatever reason. I haven't tested ext4 yet enough to know one way or the other, but Iv'e historically used XFS (which, even with fragmentation, is better).

      As for the cause, I can only guess. A couple things I have guessed, however:

      * the orthogonal performance increases of RAM/CPU to storage. Were I to use the old software on new systems, maybe I'd see the same performance degradation - but in the late 90s, the performance differences were not as emphasized as rotating rust is to modern CPUs.
      * Changes in the kernel timing and multitasking/scheduling itself, to give more preference to disk IO in general. I haven't looked through change logs, but I'd suspect this has happeened on account of the big-enterprise contribution to linux in the last decade: they fix what's important to them.
      * The 2.6 kernel. I remember 2.4 was pretty awesome in terms of performance when it came out, but 2.6 didn't really do all that much for me. This goes with the previous possibility, in that 2.6 had a lot more enterprisey emphasis than 2.4.

      --
      ~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
    2. Re:It has always been like that by Anonymous Coward · · Score: 0

      This was resolved in Solaris years ago. Sequential reads don't flush the pagecache there.

  20. Switch to Deadline by Anonymous Coward · · Score: 1, Interesting

    I ran into the same problems and ended up switching to the "deadline" scheduler. Haven't had a single problem since. I changed it via the "elevator=deadline" on the kernel boot prompt, but you can change it on the fly for individual devices. See Configuring and Optimizing Your I/O Scheduler to see how.

    1. Re:Switch to Deadline by pinkeen · · Score: 1

      I've already tried it. Just a minor improvement, but maybe it's my setup to blame in some way.

    2. Re:Switch to Deadline by arth1 · · Score: 1

      I concur.

      A couple of years ago, Linux switched the default IO scheduler to cfq, without any verifiable data to show why it was better. And since then, users have suffered because the completely fucked queueing has a worst case scenario that's much worse than any of the other schedulers. With the amount of IO on a typical systems, the worst case scenarios is what hurts.

      If your load is mostly random reads, and you have RAM and CPU to spare, switch to anticipatory. If it's large file IO, switch to deadline. And if you mainly run VMs which have their own IO schedulers, or are CPU starved, use noop.
      But in any case, ditch cfq. The best case or even average and median times are irrelevant -- it's the worst case that hurts you.

      To switch schedulers without rebooting:

      grep -l anticipatory /sys/block/*/queue/scheduler |\
      awk '{print "echo anticipatory >"$1}' | sh

    3. Re:Switch to Deadline by akanouras · · Score: 1

      To switch schedulers without rebooting:

      grep -l anticipatory /sys/block/*/queue/scheduler |\
      awk '{print "echo anticipatory >"$1}' | sh

      Was V7 Unix that bad? :)

      grep -l deadline /sys/block/*/queue/scheduler \
      | while read; do echo deadline >"$REPLY"; done

    4. Re:Switch to Deadline by arth1 · · Score: 1

      To switch schedulers without rebooting:

      grep -l anticipatory /sys/block/*/queue/scheduler |\

      awk '{print "echo anticipatory >"$1}' | sh

      Was V7 Unix that bad? :)


      grep -l deadline /sys/block/*/queue/scheduler \

              | while read; do echo deadline >"$REPLY"; done

      No, but making assumptions about which shell someone runs when there's no need to is bad.
      The above will return "while: Expression syntax." if run under csh/tcsh.

      Furthermore, depending on the the $REPLY variable isn't POSIX kosher either -- you have to explicitly specify "read REPLY". Even though pretty much every shell since ksh supports it, it isn't portable.

      If allergic to awk, you can always use the shorter:

      grep -l deadline /sys/block/*/queue/scheduler | xargs -n1 echo echo deadline '>' | sh

    5. Re:Switch to Deadline by ColoBikerDude · · Score: 1

      The deadline elevator is a good idea anyway when your system uses LVM or has a RAID. The default elevator tries to optimize I/O request scheduling based on the location of the disk heads. When the system is not reading/writing directly to a physical device (i.e. when there's a software (LVM) or hardware (RAID) layer in between the kernel and the disk), it really doesn't have any idea where the disk heads are and usually guesses poorly. Deadline will make sure as many processes as possible are responsive.

    6. Re:Switch to Deadline by akanouras · · Score: 1

      There are people out there using Python as their shell, would you cater for them in your one-liner as well? I only assumed the lowest common denominator, a POSIX-compatible shell. (Of course the ksh-ism slipped in, didn't test enough).

      Awk is fine by me, what I'm allergic to is eval/piping commands to a shell, input validation becomes a bitch there. This is what prompted my original reply by the way, I never meant to enter pedant mode.

      To close this off, hats off to you, you sure do know your shit. ;)

  21. Not a Thread Scheduling Issue by SwashbucklingCowboy · · Score: 1

    This is not a thread scheduling issue, it's a disk scheduling issue. If CPU utilization is only 1-2% and things aren't snappy then the issue is because the foreground process's I/Os aren't given higher (high enough?) priority. Easy enough to believe too, a whole lot of writes get cached and then queued up. With an elevator algorithm they'll likely all get performed before any reads required by the foreground process.

    1. Re:Not a Thread Scheduling Issue by Anonymous Coward · · Score: 0

      Aiming high, eh? I'm sure eventually Linux will beat out a 10 year old, discontinued OS from Redmond.

  22. Swith to "noop". by Anonymous Coward · · Score: 0

    "noop scheduler: just service next request in the queue without any algorithm to prefer this or that request."

  23. Re:I fixed it! by fishbowl · · Score: 0, Flamebait

    Yes, because everybody knows that kernel scheduling algorithms are far more tunable on Windows than on Linux.
     

    --
    -fb Everything not expressly forbidden is now mandatory.
  24. OS/2 by picross · · Score: 2, Interesting

    I remember using OS/2 (IBM's desktop OS) and i was always amazed that you could format a floppy and do other tasks like nothing else was going on. I never did understand why that never seemed to make it into the mainstream.

    1. Re:OS/2 by TehClaws · · Score: 1

      Are you sure you want to go down this path?

  25. Wrong Question by donscarletti · · Score: 2, Interesting

    This is not a case of Linux IO schedulers being unsuitable for the desktop, but more a case of desktop applications being written in a horrendous way in terms of data access. The general pattern being to open up a file object, load in a few hundred kilobytes, processing this then asking the operating system for more. This is a small inefficiency when the resource is doing nothing, but if the disk is actually busy, then it will probably be doing something else by the time you ask for it to read a little bit more. Not to mention the habit of reading through a few hundred resource files one at a time in seemingly random order, and blocking every time it reads, because the application programmer is too lazy to think about what resources the app is using.

    Linux has such a nice implementation of mmap, which works by letting Linux actually know ahead of time what files you are interested in and managing them itself, without the application programmer worrying his pretty little head over it. Other options are running multiple non-blocking reads at the same time and loading the right amount of data and the right files to begin with.

    The best thing about a simple CSCAN algorithm is that it gives applications what they asked for and if the application doesn't know what it wants, well, that's hardly a system issue.

    --
    When Argumentum ad Hominem falls short, try Argumentum ad Matrem
    1. Re:Wrong Question by Anonymous Coward · · Score: 0

      Many applications don't touch a whole lot of files by themselves. It's in the libraries. No need to be condescending.

      If by resources you're referring to icons, the read-a-billion-files-so-startup-is-slow problem was fixed in GTK several years ago when icon themes started to grow.

    2. Re:Wrong Question by shutdown+-p+now · · Score: 1

      The problem is that heavy I/O in one app slows down other apps which are not doing any themselves! This has nothing to do with memory-mapping, non-blocking I/O, and various other techniques to improve efficiency and UI responsiveness in general (which are, of course, valid on any OS).

    3. Re:Wrong Question by TheTurtlesMoves · · Score: 1

      You know I have not noticed this. I only see a slowdown when a big copy is taking place if the other app needed a lot of IO as well. Otherwise I don't notice that I am copying several 100G of data. Right now I am copying 750G to my new backup drive (both sata internal drives most files are >1G), and the only thing i am noticing is drive noise... which is very low. Oh an i am also copying some stuff from work at 10Mbit too (only 25G).

      Really i haven't had this problem since i used slack 1.0 with a 2G HDD on my old 486 back in 1996 or so.

      Now if the apps need to thrash the HDD all at the same time, well yea its going to be slow, but no amount of scheduling is going to change that.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    4. Re:Wrong Question by Compaqt · · Score: 1

      Doesn't using mmap mean tying your app to Linux, whereas normal fopen at alia would just be C library calls also available on Solaris, NT, MacOS, etc?

      --
      I'm not a lawyer, but I play one on the Internet. Blog
  26. Probably not the IO scheduler by crlf · · Score: 5, Informative

    This is almost certainly not the IO scheduler's problem. IO scheduling priorities are orthogonal to CPU scheduling priorities.

    What you are likely running into is the dirty_ratio limits. In Linux, there is a memory threshold for "dirty memory" (memory that is destined to be written out to disk), that once crossed, will cause symptoms like you've described. The dirty_ratio values can be tuned via /proc, but beware that the kernel will internally add its own heuristics to the values you've plugged in.

    When the threshold is crossed, in an attempt to "slow down the dirtiers", the Linux kernel will penalized (in rate-limited fashion) any and every task on the system that tries to allocate a page. This allocation may be in response to userland needing a new page, but it can also occur if the kernel is allocating memory for internal data structures in response to a system call the process did. When this happens, the kernel will force that allocating thread (again, rate-limited) to take part in the flushing process, under the (misguided) assumption that whoever is allocating a lot of memory is the same thread that is dirtying a lot of memory.

    There are a couple ways to work around this problem (which is very typical when copying large amounts of data). For one, the copying process can be fixed to rate limit itself, and to synchronously flush data at some reasonable interval. Another way that a system administrator can manage this sort of task (if automated of course) is to use Linux's support for memory controllers which essentially isolates the memory subsystem performance between tasks. Unfortunately, it's support is still incomplete and I don't know of any popular distributions that automate this cgroup subsystem's use.

    Either way, it is very unlikely to be the IO scheduler.

    1. Re:Probably not the IO scheduler by 0123456 · · Score: 2, Insightful

      Then there are programs like Firefox, which continually write to sqlite databases, which causes multiple fsync() calls, which will flush the disk cache each time if you're running on an ext3 filesystem. All because NTFS used to eat your bookmarks file if Windows crashed.

    2. Re:Probably not the IO scheduler by pinkeen · · Score: 1

      I usually use midnight commander for copying multiple files and directories. So you say that mc has a very ineffective copy routine? As far as I remember 'cp' behaves the same way...

    3. Re:Probably not the IO scheduler by Tacvek · · Score: 1

      That may be a possibility.

      But there is a very easy way to ensure it is not the I/O scheduler making poor decisions. You bring up the CPU scheduler, probably because the OP brought it up, but obviously if the utilization is that low it is not likely the CPU scheduler.[1]

      Assuming the I/O scheduler uses ionice values, one could set the io priority of the disk hog to very low. If nothing changes, then it is not the I/O scheduler, and is probably something else like the issue you mentioned. If things return to normal speed then it may well be the I/O scheduler, but still could be other things instead.

      Notes:

      [1] Although the CPU scheduler does interact with IO. If the scheduler knows that a process is likely to immediately perform a blocking read if scheduled, returning the rest of its timeslice it should schedule that process right away, so that said process will have the opportunity to process said data sooner.

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    4. Re:Probably not the IO scheduler by moonbender · · Score: 1

      I set toolkit.storage.synchronous to 0 in Firefox when the issue was widely discussed. Now I'm stracing Firefox, and I see zero fsyncs, but still a few fdatasync calls. Can't really figure out when/why it's doing those call, though. Sometimes they don't happen even while browsing, sometimes they occur often even when I'm not doing anything, really. Odd. With the synchronous option set to 1, it fsync'ed once (to store the changed config value). Other than that, there is no change (if anything, the fdatasync calls seem to have gone down in frequency). Fdatasync is similar to fsync, but it usually doesn't update the metadata.

      --
      Switch back to Slashdot's D1 system.
    5. Re:Probably not the IO scheduler by shutdown+-p+now · · Score: 1

      All because NTFS used to eat your bookmarks file if Windows crashed.

      Do you have a source for that? I've never seen NTFS "eat files" when the OS crashes. Given that it's a typical journalled FS, why would it ever do that?

    6. Re:Probably not the IO scheduler by bertok · · Score: 1

      Then there are programs like Firefox, which continually write to sqlite databases, which causes multiple fsync() calls, which will flush the disk cache each time if you're running on an ext3 filesystem. All because NTFS used to eat your bookmarks file if Windows crashed.

      All filesystems will eat your files if the OS crashes unless you call the equivalent of fsync(), it's not a Windows specific issue.

      If we're going to point fingers, how about early Firefox versions writing out all configuration files (including bookmarks), one line at a time. That is, making an I/O call for the content of each line, and then an I/O call to write the "newline" character(s) separately! It took something like 100,000 I/O calls to shut down Firefox, which is why it used to take 10 seconds or more. That's the source of its vulnerability to crashes -- if it's interrupted, files are half-written.

      The standard best practice for writing out files like that is to write them "out of place" in a temporary file using efficient buffered calls, "fsync()" at the end of all of the files once, and then use "rename" operations or the equivalent to replace the original files atomically with the new ones.

      Firefox does not do this. It writes files incorrectly, and the bug went unfixed for years. I'm still not sure if it's been fixed yet (I haven't checked), but at least by using SQLite, they're relying on better written code to do their IO for them.

      Don't blame the OS, every other application has no issues. For example, SQL Server runs unmodified just fine on both Windows desktop and server editions, and does not lose data. I once saw a badly configured Windows database server that was unexpectedly cold rebooted every few minutes, and the users merely complained that it was "slow". I checked the system: No data lost, no data corrupted.

    7. Re:Probably not the IO scheduler by hnaz001 · · Score: 1

      This is almost certainly not the IO scheduler's problem. IO scheduling priorities are orthogonal to CPU scheduling priorities.

      What you are likely running into is the dirty_ratio limits. In Linux, there is a memory threshold for "dirty memory" (memory that is destined to be written out to disk), that once crossed, will cause symptoms like you've described. The dirty_ratio values can be tuned via /proc, but beware that the kernel will internally add its own heuristics to the values you've plugged in.

      When the threshold is crossed, in an attempt to "slow down the dirtiers", the Linux kernel will penalized (in rate-limited fashion) any and every task on the system that tries to allocate a page.

      It will throttle tasks when they try to dirty a page, not allocate a new one. By the time allocators are caught up on dirty pages (during page reclaim), the writeback heuristics has already screwed up.

      Also, it does not throttle _every_ dirtier. A task's dirty limit is biased based on its contribution to the total amount of dirty pages in the system, which introduces a phase where heavy dirtiers will get throttled while light ones get away without any holdup.

      It's impossible to set a sane kernel-default for these limits. Heck, there are not even good per-system defaults, which is why people are currently trying to make those them self-tuning based on the workload.

      We have also seen reports of such interactivity problems for pure read loads, btw. So while the dirty-writeback stuff certainly is not optimal, I am not convinced it is the sole source of the problem described in the TFA.

  27. Re:Background? by amn108 · · Score: 1

    It seems to me you don't really know what you're talking about. As much as one wants one's file copying to be finished sooner, it should never EVER impair responsiveness of a workstation. That's what multitasking operating systems with GUIs are all about. It has nothing to do with Linux or its kernel knowing where it's priorities should be.

    Have you ever heard the BitTorrent client Transmission? Whenever the thing has anything to do (downloading / uploading) I have an almost useless desktop. Now, I don't really care how fast it writes to disk as long as it keeps a decent pace, but I do care about being able to be productive while it's doing its job, otherwise I could resort to MS-DOS or somthing.

    You are obviously confusing concurrency with latency. Latency has been proved time and again to be THE decisive factor for desktop users. It's all on Internet, just do some googling and you'll find case studies which show what is more important to users - whether their 700Mb DivX file copy finishes in 3 minutes instead of 5 or whether their computer keeps being as responsive as they are used to, during those minutes. Users always prefer latency, which is why Con Kolivas' work is appreciated, regardless of what you may have heard (in particular from Linus.) His whole argument with the opponents of a plugin-scheduler (and scheduler plugin system) revolved around the fact that what works for servers doesn't always work for desktops.

  28. Learn to use "nice" by NReitzel · · Score: 1, Redundant

    Gee, most of us *nix people - what did that guy call us, something about smoking roosters over small pieces of wood - know that when you need to copy a few gigabytes in background, you use "nice" and crank the priority way down. This has been around since something like 1975 or so.

    --

    Don't take life too seriously; it isn't permanent.

    1. Re:Learn to use "nice" by hcdejong · · Score: 1, Insightful

      The mind boggles: you're suggesting a manual tweak for each large copy operation. It's not the user's job to make the computer more efficient.

    2. Re:Learn to use "nice" by rrohbeck · · Score: 1

      That helps just about zero in this day and age of dual core and GHz overkill. Even the nicest process will always get a few time slices to kick up a lot of IO.
      Unless you launch a few perl -e 'for(;;){}' ...

    3. Re:Learn to use "nice" by evilviper · · Score: 1

      It's not the user's job to make the computer more efficient.

      In the same way it's not the driver's job to drive in a way that makes their car more fuel-efficient...

      Computers aren't magic. Sometimes human intervention is important.

      More importantly, the parent's point is that the fix lies in userland... If you can come up with an algorithm to select which processes should have the highest and lowest priority, you can write-up a tiny program that will automatically do the nice/ionice thing for you.

      I'd also like to point out that Linux does it as well as any other OS out there, so it's not as if this is a solved problem anywhere.

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    4. Re:Learn to use "nice" by hcdejong · · Score: 1

      If you can come up with an algorithm to select which processes should have the highest and lowest priority, you can write-up a tiny program that will automatically do the nice/ionice thing for you.

      How about this: whatever I'm working on at that moment (i.e. the program in the foreground) must have the highest priority. I'll leave writing the tiny program as an exercise for the reader.

      I'd also like to point out that Linux does it as well as any other OS out there

      Does it? I have noticed IO-related slowdowns in Windows (often related to overzealous antivirus programs), but I can't remember the last time this was an issue on Mac OS. I recently had 5 copy actions totaling 25 GB running at the same time, and was able to continue working normally the entire time. I've no experience with Linux, though, so I can't compare directly.

  29. Re:if i have many gigs of data to copy over somewh by lsllll · · Score: 1

    Hey, I'm all for grabbing a beer any time of the day, but surely you don't think watching a YouTube video, sending emails, playing chess, or shopping online on your machine as it is copying a file in the background will "bork" the copy. I would toss any O/S that would do such thing.

    --
    Is that a roll of dimes in your pocket or are you happy to see me?
  30. Even worse on SSDs by blacklint · · Score: 1

    There's another massive problem with I/O scheduling on Linux: all of the schedulers are designed for physical disks. With solid state drives as opposed to physical spinning platters, a ladder algorithm is useless and only serves to reduce performance. With solid state drives, the best scheduler is currently noop, which doesn't implement priorities. I prototyped a lottery based scheduler for a class that would allow ionice to be used in a sensible way on solid state drives, but never got it into a state where it didn't crash the kernel. The whole system does seem a little massively out of date.

    1. Re:Even worse on SSDs by Tacvek · · Score: 1

      For SSD's your requirements are:

      Obey ionice priorities.
      No starvation.

      Lottery can work, but I would think there should be some deterministic algorithm that could be used instead.

      It would be nice though if processes that rarely use disk get higher priority than those that are frequently using it, which basically entails combining this information with the ionice priorities to get the actual priorities.

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    2. Re:Even worse on SSDs by blacklint · · Score: 1

      Oh yes, I certainly agree lottery isn't a very good choice, except for the project was due in a few days and it was simple :)

      I was, however, quite surprised that there seemed to be no schedulers with priorities and no ladder already in the the kernel.

  31. But that's a strawman by Anonymous Coward · · Score: 0

    OP didn't state that he wants to have a fine tunable kernel schedulin algorithm. He stated a problem and is looking for a solution. So, if the problem has already been fixed in another system (So you don't need to tune the kernel scheduling algorithm there... It just works), it is irrelevant whether you actually could tune the kernel scheduling algorithm if you wanted to.

    Not saying, that GP wasn't a troll or a flamebait - he obviously was. But just noting that your answer didn't really refute his post in any way.

    1. Re:But that's a strawman by 0123456 · · Score: 1

      So, if the problem has already been fixed in another system (So you don't need to tune the kernel scheduling algorithm there... It just works), it is irrelevant whether you actually could tune the kernel scheduling algorithm if you wanted to.

      And which OS has magically managed to predict which I/O operations should be given a higher priority over other I/O operations without any user intervention? I don't know about Windows 7, but XP had a choice between 'server mode' and 'desktop mode' and both were equally useless if you copied a large file while using the system.

  32. Re:easy solution: by TheTrueScotsman · · Score: 1, Interesting

    You can disable swapping in Windows if you have sufficient RAM. The poster raises a very good point, but it's actually more important in servers than clients (isn't Linux anyway dead on the desktop...?).

    This is actually one of the very reasons (the other being multithreaded performance) why many of us use Windows Server 2003/2008 sometimes in preference to Linux.

  33. How much does the filesystem matter? by Anonymous Coward · · Score: 0

    On my current openSUSE 11.3 install I've only observed severe slowdown whenever I read/write large amounts of data from/to NTFS partitions. Similar operations that only involve ext4 largely remain unnoticed. My best guess would be, that the NTFS-3G driver was written around a spec that was for one thing closed and, perhaps more importantly, not designed with the Linux kernel in mind.

  34. ionice helps some by LukeCrawford · · Score: 1

    If you are doing something non-interactive that uses a lot of I/O, use IOnice. experiment, but I find

      ionice -p [pid] -c 2 -n 7

    to produce reasonable results.

    1. Re:ionice helps some by moonbender · · Score: 1

      I keep having to look up the way ionice works since I only use it very occasionally. The dual priorities don't help. And is a higher number a higher priority or the opposite? But then again I keep being confused about nice/renice, too. And why the hell do I need to be root to renice my own firefox process? (On a default Ubuntu 10.10.)

      The GUIs suck, too: to change a process priority in Gnome means opening the system monitor, which is a surprisingly big application. Then you need to navigate the huge honking list of all your processes, right click it (hope it didn't just scroll away if you've enabled auto-refresh) to open up another dialog to finally set the new CPU priority. And of course you need to enter your password, too. Changing the IO priority isn't supported at all, even though ionice has been around for ages. A lot of work for such a simple task.

      --
      Switch back to Slashdot's D1 system.
  35. Re:easy solution: by 0123456 · · Score: 1

    You can disable swapping in Windows if you have sufficient RAM.

    I tried that once on XP and several programs barfed. For example I seem to remember that Premiere simply wouldn't run if you didn't have a swap file, because it did some wacky things with virtual memory allocations; perhaps the newer versions aren't so braindead.

  36. Maybe it's the filesystem? by flerchin · · Score: 1

    My absolutely puny hardware (all 5+ years old, or netbooks) does not experience this problem at all running different releases of Ubuntu. I did notice that Transmission sometimes chewed up too much processor when I had 10+ torrents going, but my bulk drive was NTFS. After I formatted it to ext4, even that went away. I routinely copy multiple GB files intra-drive, inter-drive, and intranetwork while browsing, youtubing, etc.

    Maybe you're using an NTFS filesystem that isn't as efficient?

    Again, my hardware is majorly obsolete. My only "multicore" setup is on a hyperthreading Atom.

    --
    --why?
  37. IO scheduler != CPU scheduler by Ingo+Molnar · · Score: 5, Insightful

    FYI, the IO scheduler and the CPU scheduler are two completely different beasts.

    The IO scheduler lives in block/cfq-iosched.c and is maintained by Jens Axboe, while the CPU scheduler lives in kernel/sched*.c and is maintained by Peter Zijlstra and myself.

    The CPU scheduler decides the order of how application code is executed on CPUs (and because a CPU can run only one app at a time the scheduler switches between apps back and forth quickly, giving the grand illusion of all apps running at once) - while the IO scheduler decides how IO requests (issued by apps) reading from (or writing to) disks are ordered.

    The two schedulers are very different in nature, but both can indeed cause similar looking bad symptoms on the desktop though - which is one of the reasons why people keep mixing them up.

    If you see problems while copying big files then there's a fair chance that it's an IO scheduler problem (ionice might help you there, or block cgroups).

    I'd like to note for the sake of completeness that the two kinds of symptoms are not always totally separate: sometimes problems during IO workloads were caused by the CPU scheduler. It's relatively rare though.

    Analysing (and fixing ;-) such problems is generally a difficult task. You should mail your bug description to linux-kernel@vger.kernel.org and you will probably be asked there to perform a trace so that we can see where the delays are coming from.

    On a related note i think one could make a fairly strong argument that there should be more coupling between the IO scheduler and the CPU scheduler, to help common desktop usecases.

    Incidentally there is a fairly recent feature submission by Mike Galbraith that extends the (CPU) scheduler with a new feature which adds the ability to group tasks more intelligently: see Mike's auto-group scheduler patch

    This feature uses cgroups for block IO requests as well.

    You might want to give it a try, it might improve your large-copy workload latencies significantly. Please mail bug (or success) reports to Mike, Peter or me.

    You need to apply the above patch on top of Linus's very latest tree, or on top of the scheduler development tree (which includes Linus's latest), which can be found in the -tip tree

    (Continuing this discussion over email is probably more efficient.)

    Thanks,

    Ingo

    1. Re:IO scheduler != CPU scheduler by thisisauniqueid · · Score: 1

      Thanks Ingo for the detailed explanation.

      Though you're the CPU scheduler maintainer not the IO scheduler maintainer, can you shed light on two other situations please?

      (1) As soon as RAM is exhausted and the kernel starts swapping out to disk, the desktop experience is severely impacted (and immediately so). However I would have thought that most if not all code that is actually being used by the core desktop (working memory and code for X, gtk etc.) would be marked as recently used, i.e. the pages being swapped out should be at the end of some LRU list? In other words, is the slowness due to the fact that *other* non-core-desktop-related pages are being swapped in and out, and the IO due to swapping is causing all processes to slow down, or is it because the pages containing running desktop code is constantly being swapped in and out? Is it possible to create a better desktop experience by mapping certain memory areas "core to user experience" and forbidding the VM from ousting them, so that for example an individual app might slow down if it suddenly takes up a lot of RAM and causes swapping, but interacting with the rest of the desktop is still smooth?

      (2) When doing a "dd if=img.iso of=/dev/sdb" to copy an .iso file to a USB stick, once the buffers are full the entire desktop comes grinding to a halt for several seconds, then frees up for a second or two once it is no longer blocking on write, then locks up again for several seconds, and so on. Why would a blocked write lock up the whole desktop?

    2. Re:IO scheduler != CPU scheduler by Dante · · Score: 1

      Ingo, I am so glad you posted here!

      I wanted to say I've been using the -tip tree for over a year, with great success for my desktop, and my laptop.
      Many of the problems listed here? They never seem to occur with -tip kernels. It's my hope that it gets more exposure.

      I know some of the patches have made it back into the mainline kernel, any idea when they all will be merged?

      Also one thing I've noticed, but it seems not to be part of the discussion is the choice of files systems, I was under the impression that scheduling was abstracted away from the file systems?

      More so in the non-tip kernels, I've seen major differences in behavior between ones I've tested, usually with XFS performing best for IO, and BFS having wildly different behaviors depending on the workload, and ext3 just kinda sucking in general, but consistently sucking.

      --
      "think of it as evolution in action"
    3. Re:IO scheduler != CPU scheduler by Ingo+Molnar · · Score: 3, Informative

      (1) As soon as RAM is exhausted and the kernel starts swapping out to disk, the desktop experience is severely impacted (and immediately so). [...]

      Right. If a desktop starts swapping seriously then it's usually game over, interactivity wise. Typical desktop apps produce so much new dirty data that it's not funny if even a small portion of it has to hit disk (and has to be read back from disk) periodically.

      But please note that truly heavy swapping is actually a pretty rare event. The typical event for desktop slowdowns isn't deadly swap-thrashing per se, but two types of scenarios:

      1) dirty threshold throttling: when an app fills up enough RAM with dirty data (which has to be written to disk sooner or later), then the kernel first starts a 'gentle' (background, async) writeback, and then, when a second limit is exceeded starts a less gentle (throttling, synchronous) writeback. The defaults are 10% and 20% of RAM - and you can set them via. To see whether you are affected by this phenomenon you can try much more agressive values like:

        echo 1 > /proc/sys/vm/dirty_background_ratio
        echo 90 > /proc/sys/vm/dirty_ratio

      These set async writeback to kick in ASAP (the disk can write back in the background just fine), but sets the 'aggressive throttling' limit up really high. This tuning might make your desktop magically faster. It may also cause really long delays if you do hit the 90% limit via some excessively dirtying app (but that's rare).

      2) fsync delays. A handful of key apps such as Firefox use periodic fsync() syscalls to ensure that data has been saved to disk - and rightfully so. Linux fsync() performance used to be pretty dismal (the fync had to wait for a really long time on random writers to the disk, delaying Firefox all the time) and went through a number of improvements. If you have v2.6.36 and ext3 then it should be all pretty good.

      I think a fair chunk of the "/bin/cp /from/large.iso /to/large.iso" problem could be eliminated if cp (and dd) helped the kernel and dropped the page-cache on large copies via fadvise/madvise. Linux really defaults to the most optimistic assumption: that apps are good citizens and will dirty only as much RAM as they need. Thus the kernel will generally allow apps to dirty a fair amount of RAM, before it starts throttling them.

      VM and caching heuristics are tricky here - a app or DB startup sequence can produce very similar patterns of file access and IO when it warms up its cache. In that case it would be absolutely lethal to performance to drop pagecache contents and to sync them out agressively.

      If the cp app did something as simple as explicitly dropping the page-cache via the fadvise/madvise system calls then a lot of user side grief could be avoided i suspect. DVD and CD burning apps are already rather careful about their pagecache footprint.

      But, if you have a good testcase you should contact the VM and IO developers on linux-kernel@vger.kernel.org - we all want Linux desktops to perform well. (server workloads are much easier to handle in general and are secondary in that aspect.) We have various good tools that allow more than enough data to be captured to figure out where delays come from (blktrace, ftrace, perf, etc.) - we need more reporters and more testers.

      Thanks,

      Ingo

    4. Re:IO scheduler != CPU scheduler by Ingo+Molnar · · Score: 4, Informative

      I know some of the patches have made it back into the mainline kernel, any idea when they all will be merged?

      The -tip tree contains development patches for the next kernel version for a number of kernel subsystems (scheduler, irqs, x86, tracing, perf, timers, etc.) - and i'm glad that you like it :-)

      We typically send all patches from -tip into upstream in the merge window - except for a few select fixlets and utility patches that help our automated testing. We merge back Linus's tree on a daily basi and stabilize it on our x86 test-bed - so if you want some truly bleeding edge kernel but want proof that someone has at least built and booted it on a few boxes without crashing then you can certainly try -tip ;-)

      Otherwise we try to avoid -tip specials. I.e. there are no significant out-of-tree patches that stay in -tip forever - there are only in-progress patches which we try to push to Linus ASAP. If we cannot get something upstream we drop it. This happens every now and then - not every new idea is a good idea. If we cannot convince upstream to pick up a particular change then we drop it or rework it - but we do not perpetuate out-of-tree patches.

      So the number of extra commits/changes in -tip fluctuates, it typically ranges from up to a thousand down to a few dozen - depending on where we are in the development cycle.

      Right now we are in the first few days of the v2.6.37 merge window and Linus pulled most of our pending trees already in the past two days, so -tip contains small fixes only. While v2.6.37 is being releasified in the next ~2.5 months, -tip will fill up again with development commits geared towards v2.6.38 - and we will also keep merging back Linus's latest tree - and so the cycle continues.

      Thanks,

      Ingo

    5. Re:IO scheduler != CPU scheduler by zx2c4 · · Score: 1

      Ingo,

      I believe most desktop users run into this problem when they complain about IO schedulers. Is there any immediate plan to address it?

      Thanks,

      Jason

      --
      ZX2C4
    6. Re:IO scheduler != CPU scheduler by thisisauniqueid · · Score: 1

      Very informative. Why does fsync not synchronously flush out *only* the data dirtied by the current process, rather than all buffers on all file systems dirtied by any process? It seems like a bad idea for a non-root thread to have so much power over how smoothly the rest of the system runs.

    7. Re:IO scheduler != CPU scheduler by Anonymous Coward · · Score: 0

      The problem is in the IO scheduler. Switching from CFQ to AS minimizes the problem. It takes less than 5 seconds with google to see how wide spread the problem is. Lots of people squawking about it. CFQ is pure crap in my experience. Copying a couple gigabytes of data should not render all my applications unusable for five minutes.

      Probably uninformed, but someone actually claimed that CFQ is designed to be tweaked with ionice. Yeah, a modern OS should require people to manually ionice every time they do a file copy!

      It would be ideal for the schedulers and window manager to communicate and give priority to the foreground application.

    8. Re:IO scheduler != CPU scheduler by Ingo+Molnar · · Score: 1

      Why does fsync not synchronously flush out *only* the data dirtied by the current process, rather than all buffers on all file systems dirtied by any process?

      That's the intention and that's even how it's coded - but for example ext3 had a bug/misfeature that caused this operation to serialize on all pending writes to the same filesystem's journal area in some pretty common scenarios - with disastrous results to interactivity.

      There was a big flamewar about it on lkml a year or two ago, and in that discussion Linus declared that it is a very high priority item to fix this, and that desktop interactivity is our main optimization focus. (IIRC the flamewar was big enough to make it to Slashdot - cannot find the link right now.)

      The fsync/fdatasync performance problem was fixed/resolved shortly after that.

      Kernels after v2.6.32 (and certainly the latest v2.6.36 kernel) should be much better in that area.

      It seems like a bad idea for a non-root thread to have so much power over how smoothly the rest of the system runs.

      Yes, indeed.

      In terms of isolation guarantees, block cgroups (control groups) should be a feature for more formal isolation of one user from another. AFAIK Android puts each app into a separate user and into separate cgroups. So it's not impossible to design the user-space side properly. It was written a server feature originally, but i think it's very useful on the desktop as well.

      Thanks,

      Ingo

    9. Re:IO scheduler != CPU scheduler by Ingo+Molnar · · Score: 2, Informative

      Ingo,

      I believe most desktop users run into this problem when they complain about IO schedulers. Is there any immediate plan to address it?

      Thanks,

      Jason

      Regarding plans you need to ask the VM and IO folks (Andrew Morton, Jens Axboe, Linus, et al).

      Regarding that bugzilla entry, there's this suggestion in one of the comments:

          echo 10 > /proc/sys/vm/vfs_cache_pressure
          echo 4096 > /sys/block/sda/queue/nr_requests
          echo 4096 > /sys/block/sda/queue/read_ahead_kb
          echo 100 > /proc/sys/vm/swappiness
          echo 0 > /proc/sys/vm/dirty_ratio
          echo 0 > /proc/sys/vm/dirty_background_ratio

          or use "sync" fs-mount option.

      If you can reproduce that problem with a new kernel (v2.6.36 would be ideal) then please try to describe the symptoms in a mail to linux-kernel@vger.kernel.org, and also point out whether the tunings above improved things. Please Cc: Jens, Andrew, me and Linus as well.

      To turn interactivity woes on the desktop into actual hard numbers you can use Arjan van de Ven's latencytop tool. It will measure your worst-case delays with and without big copies being done in the background, which numbers you can cite in your email.

      Thanks,

      Ingo

    10. Re:IO scheduler != CPU scheduler by Ingo+Molnar · · Score: 1

      The problem is in the IO scheduler. Switching from CFQ to AS minimizes the problem. It takes less than 5 seconds with google to see how wide spread the problem is. Lots of people squawking about it. CFQ is pure crap in my experience. Copying a couple gigabytes of data should not render all my applications unusable for five minutes.

      Probably uninformed, but someone actually claimed that CFQ is designed to be tweaked with ionice. Yeah, a modern OS should require people to manually ionice every time they do a file copy!

      It would be ideal for the schedulers and window manager to communicate and give priority to the foreground application.

      Please help us resolve this issue: please post your experiences to linux-kernel@vger.kernel.org and Cc: the following gents:
      jaxboe@fusionio.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, a.p.zijlstra@chello.nl, mingo@elte.hu.

      It would be nice if you could attach latencytop numbers for CFQ and for AS, using the same workload. Latencytop will measure the worst-case delays you suffered - so you can demonstrate the CFQ versus AS effect numerically.

      Thanks,

      Ingo

    11. Re:IO scheduler != CPU scheduler by Anonymous Coward · · Score: 0

      Any chance Linux could get support for a mechanism similar to MADV_DONTNEED, but which doesn't immediately deallocate the page, but rather tries to keep it mapped as long as possible? I imagine it could be used for all sorts of temporary data caching, where the data doesn't need to be persisted to disk and could be reconstructed faster than read from swap. Ie. a browser keeping an uncompressed multi-MB bitmap of a small png file.

    12. Re:IO scheduler != CPU scheduler by Anonymous Coward · · Score: 0

      On an unrelated note: this is why I come to Slashdot. There's an interesting question, followed by a discussion including several +5-modded comments by one of the handful of people in the world most qualified to answer it.

    13. Re:IO scheduler != CPU scheduler by kinema · · Score: 1

      I think a fair chunk of the "/bin/cp /from/large.iso /to/large.iso" problem could be eliminated if cp (and dd) helped the kernel and dropped the page-cache on large copies via fadvise/madvise. Linux really defaults to the most optimistic assumption: that apps are good citizens and will dirty only as much RAM as they need. Thus the kernel will generally allow apps to dirty a fair amount of RAM, before it starts throttling them.

      Why haven't basic system tools like cp had this functionality added to them? I can't imagine the required patches would be incredibly complex.

    14. Re:IO scheduler != CPU scheduler by Anonymous Coward · · Score: 0

      2) fsync delays

      So, does this mean that linux only fsync's the data associated with the FD now? Or is it still flushing everything left and right? This has been fsyncs primary issue, someone fsyncs a 2k file, and the kernel proceeds to flush 2 GB of totally unrelated cp data.

  38. Re:I fixed it! by Anonymous Coward · · Score: 0

    If it works there's no real need to tune it.

  39. Actually, you're wrong by inode_buddha · · Score: 1

    Con Kolivas released a patch set against the 2.6.36 kernel just a few days ago. Check lkml.org.

    --
    C|N>K
  40. Re:easy solution: by TheTrueScotsman · · Score: 1

    Sorry, I can only comment on server solutions that we wrote. I'm sure that some flaky desktop programs have problems.

  41. umm.. not a general issue by Anonymous Coward · · Score: 0

    i have never seen such a problem... i play music off of a mounted drive, read/write to another mounted partition all the time... move files from here to there... absolutely no noticeable slowdowns coz of that...

    but hands down, windows 7 beats the pants off any linux distro (or even mac for that matter)... love it completely! very professional work...

  42. What am I doing wrong? by poptones · · Score: 1

    Sometimes I see my system get bogged down doing copies and even lock up for a few seconds. And when I see this I always become very nervous because usually it means I have a hard disk failure of some sort (sometimes it can be just a bad connector, but still a hard failure).

    I just copied about 5GB from my 5 disk raid5 to my main partition WHILE I copied about the same amount of data back TO that same raid WHILE watching a video from that raid and didn't see much of an issue. I saw one little "stutter" for about 100mS and that was it.

    I am using LVM. And the braindead way ubuntu configures LVM to put swap in the same LVM partition as your home and system directories DOES cause all sorts of nastiness. This used to drive me nuts before I fixed it simply by disabling swap. I have 8GB of RAM, why do I need swap?

    Edit: this "new and improved" page formatting SUCKS. Now the buttons that were right there are hiddden behind DUMBASS popup menus. Fucking "engineers" thinking they know how to improve shit. How do I turn this bullshit off?

    1. Re:What am I doing wrong? by ultranova · · Score: 1

      Edit: this "new and improved" page formatting SUCKS. Now the buttons that were right there are hiddden behind DUMBASS popup menus. Fucking "engineers" thinking they know how to improve shit. How do I turn this bullshit off?

      Your user page -> Help & account -> Discussions -> Discussion style (Slashdot Classic Discussion System)

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    2. Re:What am I doing wrong? by rubycodez · · Score: 1

      I never liked the idea of swap in LVM, always just made separate real partition for it. boot, root and swap I believe should always be on real partitions, then /tmp /var, /home, /usr /usr/local and the rest can go into LVs

    3. Re:What am I doing wrong? by daveime · · Score: 0, Offtopic

      It's amazing how the Slashdot crowd are lighting torches and sharpening the pitchforks whenever Google or Facebook do some opt-out privacy trick by making the "new thing" the default ... and yet when Slashdot themselves pull the same trick, the silence is deafening.

      I've been offline for a week, I come back and all my settings have been changed ?

      *sound of cricket rubbing it's legs together*

    4. Re:What am I doing wrong? by John+Hasler · · Score: 1

      So what bit of your privacy has Slashdot compromised?

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
    5. Re:What am I doing wrong? by SanityInAnarchy · · Score: 2, Insightful

      I have 8GB of RAM, why do I need swap?

      So you can use that 8 gigs for something else, or not buy 8 gigs in the first place. In particular, so when a program is using large amounts of memory for no good reason, it can be swapped out, maybe even just for disk cache.

      Also, hibernate.

      --
      Don't thank God, thank a doctor!
    6. Re:What am I doing wrong? by Iskender · · Score: 2, Funny

      CowboyNeal came to my house yesterday and sat on the sofa and had a beer like it was just a basic day.

      He even said I should work on my interior decoration - "Those empty white walls aren't very pretty." It sucked, so don't come telling me Slashdot hasn't violated my privacy. :)

    7. Re:What am I doing wrong? by Anonymous Coward · · Score: 0

      rubbing it's legs

      "its".

  43. "nice" is for CPU bound tasks by LukeCrawford · · Score: 1

    it doesn't do much for I/O. ionice, a much newer program does something similar to what 'nice' does for CPU for I/O intensive tasks. It's pretty good, not as good as nice is for cpu-bound tasks, but eh.

  44. Re:Background? by Anonymous Coward · · Score: 0

    It seem to me you don't really know what you're talking about either. Linux is the kernel. It has everything to do with Linux knowing where its priorities should be, which for impatient people like you, had better be making sure everything always seems fast. You might also like to set CONFIG_HZ to 20000, everything will feel much more responsive after that. But thank you for informing me about a load of studies which tell me what I want.

    You could get a better bittorrent client, or alternatively, have everyone else fix everything else for you. Are you using Transmission to share Linux ISOs over gigabit ethernet or something equally believable?

  45. Re:I'll tell you how to fix it by Anonymous Coward · · Score: 0

    Your base Ubuntu distro is about as much a server OS as is WinXP Tablet Edition. Get over it. If you're running a non-server version of Linux and using whatever box you have like a server you're either kidding yourself just to look cool or you're really not using it in a real production environment. Can you now stop being such a little fanboi and start to recognize the difference between server and desktop OSs instead of coming off like a dumb ass who thinks that one OS can really do it all?

  46. Re:if i have many gigs of data to copy over somewh by eldepeche · · Score: 4, Insightful

    I would definitely ditch an OS that fucked up a file copy because I used the computer for something else while I was waiting.

  47. BFS doesn't seem like the solution. by Beelzebud · · Score: 1

    In Arch Linux I installed the 2.6.35 kernel with BFS enabled, and I found that it gave too much priority to user input. When playing a standard definition xvid file, it would literally pause for a second while opening Firefox. The default scheduler might have problems, but it will keep playing the same type of file just fine, while also opening something like a web browser.

  48. It's very hardware dependent. by GNUALMAFUERTE · · Score: 1

    Here's my experience with this issue:

    I develop a camera surveillance system. So, I see machines with constant I/O. 25fps (PAL) on several cameras. So, an average system configured in full-recording will be saving 200fps to disk. All the cameras are shown on the screen through SDL on X11. When WD rolled out it's new 4k sector sized disks, I had to figure out how to make them work properly on GNU/Linux, since they came with a special format utility for XP, but no docs on what was required on GNU/Linux. They report to the machine a 512b sector size, but I know they are 4k. So, I managed to align partitions with cylinders properly, and the disk performance spiked. If you didn't do this, partitions and cylinders would end up unaligned, and disk performance would suck. The whole machine would slow down badly, even the SDL windows showing video. That video comes straight from V4L, and disk-output happens later in another thread (i.e, no the same doing the SDL visuals). SDL windows would only show 4-5 fps for several seconds (after every disk flush), then go back to normal.

    There are serious I/O issues. Actually, the IO model is ok for servers, but for anything realtime, it fucking sucks.

    --
    WTF am I doing replying to an AC at 5 A.M on a Friday night?
  49. Re:easy solution: by growse · · Score: 1

    If by 'sufficient RAM' you mean 'enough memory to allocate every single running process their 4GB of addressable memory (assuming 32bit arch)', then yes, you can turn off swapping. Otherwise, don't be surprised when the kernel starts to randomly kill processes when it runs out of memory.

    --
    There is nothing interesting going on at my blog
  50. Re:easy solution: by TheTrueScotsman · · Score: 1

    By 'sufficient RAM', I mean 16GB and above depending on your requirements (we routinely run both Linux and Windows with 32GB). I am talking about servers here because that's what we run and we have observed the the problem in TFA.

  51. Desktop OS? by digitallife · · Score: 0, Flamebait

    I see your mistake. Linux is not a "desktop OS", it is an advanced OS for production systems or people who like to tinker. Pretending it is otherwise will only cause grief in the long term.

    1. Re:Desktop OS? by dbIII · · Score: 1

      I see. What are your thoughts then on Windows NT as seen in XP and Windows 7? How about OS X?
      The "desktop OS" died with WinME - get over it.

  52. limit the amount of pagecache by biophysics · · Score: 1

    what you need is http://code.google.com/p/pagecache-mangagement/ This tool allows the user to limit the amount of pagecache used by applications under Linux. This is similar to nice, ionice etc. in that it usually doesn't make an application go faster, but does reduce the impact of the application on other applications performance. This is especially useful for applications that walk sequentially through data sets larger than memory, as discarding their pagecache does not reduce their performance (although this tool does add overhead of about 2%). See http://lwn.net/Articles/224653/ Although it is little more than a proof-of-concept it seems to be fairly useful. When running pagecache-management.sh dd if=100-mb-file of=foo or pagecache-management.sh cp -a /usr/src/linux-2.6.20 /usr/src/foo

  53. Re:easy solution: by JonJ · · Score: 2, Insightful

    That's great that you post your experiences with server scheduling in a topic about desktop scheduling. It's so relevant. No wait, it's not.

    --
    -- Linux user #369862
  54. To quote James T. Kirk... by Anonymous Coward · · Score: 0

    Cooooonnnnnn!

  55. Guess I'm not sure what you mean by Giant+Electronic+Bra · · Score: 1

    My point was only that a system which is totally bogged down by disk IO is somehow not exactly optimum and that a lot of the less mainstream distros don't exactly seem to know a heck of a lot about tuning or what patches to use, which CAN be an issue. You want a desktop specific distribution from a reputable mainstream source.

    People expect that some guy in his garage somewhere knows how to put together a well built OS, but that is largely a vain hope. The Linux kernel is a wonderful piece of software, but that doesn't mean you can't horribly misuse it and get bad results.

    No doubt many older releases work fine too. I can't recall having this sort of problem in any version of Mandriva for instance, at least not in years. I don't think my particular system is special in that respect, I just use a reasonably high quality distro and things work!

    Of course the OP could be dealing with some horrible bad specific device driver or hardware too. That can make a significant difference. I think the flaw in his thinking is generalizing this as a Linux desktop issue and not a hardware or OS specific issue that HE has.

    --
    "Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
  56. Change your I/O scheduler by hawkeyeMI · · Score: 1

    If you just change your I/O scheduler to anticipatory this should go away. I think the simplest in Ubuntu is to add "elevator=anticipatory" to your kernel command line arguments. This is done differently in GRUB and GRUB2, so fgi.

    --
    Error 404 - Sig Not Found
    1. Re:Change your I/O scheduler by CAIMLAS · · Score: 1

      I'm not sure, but I believe the 10.10 kernel does not have the as IO scheduler: it was removed from mainline in 31 or 32, or something like that, for some dumb reason.

      --
      ~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
    2. Re:Change your I/O scheduler by fnj · · Score: 1

      What is the rationale for removing schedulers from the codebase? Choice is good. The disk space impact of extra scheduler choices is entirely negligible, and the RAM impact is hardly severe for most cases. I can see tuning a kernel to remove them in highly restricted scenarios like embedded, but why take them out of the codebase?

    3. Re:Change your I/O scheduler by hawkeyeMI · · Score: 1

      It is because of things like this that I am sticking with the 10.04 LTE for a while. I've become really disillusioned with the rapid changes in Ubuntu between releases. I guess it's good, but I don't have the time to screw around 'fixing' everything after an upgrade very often. One of the things I miss about Gentoo is that you can keep your system in a state of rolling update, for the most part.

      --
      Error 404 - Sig Not Found
  57. Re:easy solution: by blueg3 · · Score: 1

    A process only gets 2 GB of addressable memory on Windows; the other 2 GB is allocated to the kernel. (Sure, you can enable a switch to make this 3/1 GB instead, but that's fairly uncommon.) You only need to have enough RAM to cover memory that's actually used, though, and things like memory-mapped files and zero pages still work as normal.

    It's not necessarily a good idea, but you can get away with running quite a few processes even with no pagefiles.

  58. Re:easy solution: by TheTrueScotsman · · Score: 1

    It's extremely relevant since Linux has far more importance as a server platform than a desktop one and the OS used in either is essentially the same.

  59. Easy problem to understand, hard to fix. by dannycim · · Score: 1

    The problem is this: Let's say you do an action that reads 5 blocks on the disk. While the system is idle it has nothing else to do so your 5 blocks are read immediately, super fast.

    While the system is doing some other I/O intensive job, it might be doing 500 block reads at the same time. Everything goes in the same queue, so your task is only %1 of the requests that have to be done in a set time. Result: Your task takes 100 times longer.

    This is the problem that all the scheduler are trying to solve: trying to be fair so that every task gets a reasonable share of priority, while keeping performance at an optimum level.

    For example, some O/S researchers have tried to implemented multiple-tiered system where every I/O is tagged with flags that indicate if the call came from an interactive user action, or was generated by non-interactive jobs (daemons, lower-level layers, etc...) and then give higher priority to the user requests. Two problems with that approach is it can be very hard to differentiate the two and that any heavy user task may prevent system tasks to work in a timely fashion and the user tasks may depend on the system tasks to complete their jobs in order to proceed; vicious circles and race conditions.

    I'm glad I'm not trying to code a kernel scheduler, they're very hard problems and figuring one out that can be fair for all types of uses is nigh impossible.

    The great thing about the open source O/Ss is that everything's done in the open, there's intense discussions going on about in the field, and there's multiple solutions being worked on and tested.

    To me, Linux has always felt like it gave much higher priority to I/O than the "user experience". It's something I've come to expect. If I copy gigabytes from a disk set to another I gladly accept that my web browser's going to be sluggish for a time, all the while feeling content that at least it's going to be done so efficiently that it's going to last for the shortest amount of time possible.

    Other O/Ss that I won't name may "feel" better, but have nowhere near the same I/O throughput that Linux has.

  60. Re:if i have many gigs of data to copy over somewh by Arker · · Score: 1

    I would definitely not let a monkey like you get near my computers if some intense file copy was going on and they wanted to start doing other things while that was going on, sure you can do it but that does not make it a prudent thing to do, and the file may copy over just fine, and it may lose a few bits without even reporting any errors and that can happen on any OS, BSD, Linux, Winders & etc...etc...etc...

    Funny, I do that constantly and have never seen any corruption even possibly attributable to it on any system besides Windows.

    --
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Friends don't let friends enable ecmascript.
  61. Never been a problem for me by siride · · Score: 1

    I'll chime in too about not having this problem. I've used Linux since late 2004. I've used Fedora 3, 4, 6 and 12, Ubuntu (since Edgy) and Gentoo (my main Linux distro), with Ubuntu in VMs sometimes -- all these across six or seven machines. I've never had the desktop grind to a halt with heavy I/O. In fact, I was relieved that unlike Windows, the harddrive can be grinding away and I can still actually use my computer and start programs in a reasonable amount of time. So when I first started hearing about this issue recently, I was quite surprised and thought maybe it was just a localized config problem or something specific to certain people's hardware. Now that everyone on Slashdot seems to be having this problem, I can't help but wonder how I managed to be so lucky all these years. WTF is going on?

    1. Re:Never been a problem for me by jgrahn · · Score: 1

      I'll chime in too about not having this problem.[...] Now that everyone on Slashdot seems to be having this problem, I can't help but wonder how I managed to be so lucky all these years. WTF is going on?

      Put differently, where is the simple test which demonstrates the problem? It may or may not be the one someone linked to: https://bugzilla.kernel.org/show_bug.cgi?id=12309

      I tried that dd(1) line. It doesn't make /everything/ else "slow down to a crawl", but everything that does I/O is affected ... and as someone remarked things like fancy web browsers and bloated desktops environments do a lot of I/O.

  62. Re:I fixed it! by obarthelemy · · Score: 1
    --
    The Cloud - because you don't care if your apps and data are up in the air.
  63. Re:easy solution: by jazzmans · · Score: 2, Insightful

    You are joking right?(OP) I'm using debian, and I routinely copy TB(s) of data from hard drive to hard drive via SATA and/or USB 2.0, and though the usb tramsfer speed is fairly slow, my system doesn't slow appreciably at all.

    Weird, I've been using Linux for 10 years now, and one thing linux does really well is move large amounts of data around without killing the system (useability).

    Lotsa ram is your freind, also make sure your / filesystem isn't the hdd that you're moving the data from/to or vice-versa. That does slow access down a bit.

    jaz

    --
    Life is what happens to you while you are busy making other plans. No-one sees motorcycles
  64. it's more about memory, less about IO scheduling by markhahn · · Score: 1

    My experience is that when IO affects "feel", it's mostly because of increased competition for memory. Someone else mentioned tuning the vm.dirty_* sysctls, which certainly helps, but what surprises me is that we don't use O_DIRECT and splice/vmsplice more. "cp" is still a loop of 32k read/writes, with only the obvious O_ modes on either descriptor (and needless to say, no fadvise either.)

    In short, the kernel offers fine mechanisms to resolve these problems - it's user-space that isn't taking advantage of them.

  65. Re:easy solution: by shentino · · Score: 1

    Wrong.

    2G private address space, 1G public address space, and 1G kernel address space.

  66. Re:if i have many gigs of data to copy over somewh by lsllll · · Score: 1

    Lose a few bits? Are you being serious? Despite what you may believe, during the file copy which you walked away from, several hundred processes continue to run in the background and do what they're supposed to, doing things way more complex than your file copy. You think X stops doing what it's doing just so the file can be copied? Or the kernel drops everything it's doing except process the file copy? The very simple movement of a mouse fires hundreds of IRQs each second which are services by a service routine. Watching a YouTube video is no different.

    --
    Is that a roll of dimes in your pocket or are you happy to see me?
  67. You'll have to wait for 2.6.37 by next_ghost · · Score: 1

    You're looking at a bug that was fixed some time ago but those patches didn't make it into stable kernel yet. It should be fixed for everyone in 2.6.37 (about 3 months from now as 2.6.36 came out 3 days ago). In the mean time, you can grab those patches and compile your own kernel.

  68. swappiness by lytles · · Score: 1

    when the kernel accesses the slow disk, it is aggressive in trying to cache the read. if there's free memory this is obviously the correct thing to do, since if the memory is needed the cache can be dropped. but if memory is full, the kernel needs to decide whether to drop some file cache, or swap out a process. the default settings tend to favor disk cache, meaning every time you try to access anything on the desktop, the application has been swapped out and it has to wait for disk access to swap back in (often several seconds on my machine)

    setting /proc/sys/vm/swappiness to a low value, eg 0, tells the kernel to favor processes at the expense of caching disk reads. this helps a lot in keeping the desktop snappy. kernel trap has a good summary of the issue and the developers motivations

    swappiness doesn't help with applications that want to access a file repeatedly, but rely on the disk cache instead of an internal cache. eg, an IDE might have 10 source files in tabs, but instead of keeping the files in memory, it could just reread them each time a tab is switched. as long as the file remains in cache, this works fine. but when you copy a huge file, the source file gets dropped from cache, and the tab takes forever to refresh

    not sure if there's an easy way for the kernel to know the difference between an application just copying a file, and actually reading it. but if there is, it would make sense to favor reads

  69. Re:easy solution: by Anonymous Coward · · Score: 0

    Oh, I understand how "awesome" lunix is. That's why I use FreeBSD. But don't stop believing that anyone who thinks linux is shit on technical merits must be a stupid Windows or Mac fanboy!

  70. Re:easy solution: by rubycodez · · Score: 1

    nah, most processes don't try to allocate the maximums, nor does Linux swap out the whole process (true swapping is very, very rare) but just pages.

    Most of the time my swapfile never gets used on my 4GB desktop. and yes I made my swap partition 4GB just because I never know what I might be doing in the future. but it's been a waste of space thus far, even running web server, database and middleware for projects with a nice 768MB RAM virtual windows machine in vmware on the side.

  71. Re:if i have many gigs of data to copy over somewh by shutdown+-p+now · · Score: 1

    i just run it and let it own the computer for whatever time it takes = anywhere from 10 to 30 minutes, and just walk off, maybe go get a fresh cup of coffee or cold beer depending on where i am and what time of day it is. one thing i dont want is a borked copy because i was too impatient to let it do its job.

    I see you're a long-time Windows 95 user.

    - Tell me about multitasking, daddy!
    - Hold on, boy, the floppy didn't finish formatting yet.

  72. Re:easy solution: by Captain+Segfault · · Score: 2, Insightful

    Cite? What exactly is the difference between "public" and "kernel"?

    If all processes see the same 1G the distinction isn't meaningful, especially in this context.

  73. It isn't only IO scheduling by grandpa-geek · · Score: 3, Interesting

    I've encountered situations where I'm trying to do something online and a task starts up due to a cron job that builds some kind of index. The index building should be in the background but somehow takes priority over what I'm doing on the desktop. Those kinds of cron jobs should be default scheduled in the background, not take priority over what is happening on the desktop.

    1. Re:It isn't only IO scheduling by Anonymous Coward · · Score: 0

      almost certainly mlocate: even though it runs at -c3, there are cases where it still sucks pretty hard:
      https://bugs.launchpad.net/ubuntu/+source/mlocate/+bug/362809
      https://bugs.launchpad.net/ubuntu/+source/findutils/+bug/332790

      for the worst-case scenario of running a linux vm on a windows host AND having the host fs mounted in the correct place, (ie /mnt/ rather than /media/), this can definitely put some serious hurt on a machine.

    2. Re:It isn't only IO scheduling by amn108 · · Score: 1

      Ditto. On Ubuntu, ever since version 8 something, the 'update-apt-xapian-index' binary, once started, even though a background process by design, is REALLY noticeable. It also consumes 97% CPU while it's doing whatever it's doing, which lasts a couple of minutes at most, then quits. In any case, it's annoying enough so that I tracked it down to being part of System Update, and changed the frequency of system update to once a week from once a day as before. This is how users command system updating, so next time developers of cool systems complain users are insecure because they don't patch their systems, shove it and remember - users decide what to update, and if your update is suboptimal, don't blame it on the users. As a result of an intrusive system update system, my operating system is one week behind a possibly critical update. Not much of course, but just an example...

  74. Re:if i have many gigs of data to copy over somewh by Anonymous Coward · · Score: 0

    I ditched Windows for this reason, among many others.

  75. Re:I'll tell you how to fix it by mcneely.mike · · Score: 1

    I'd go mad.

    Mad i say. Mad!!

    Better to die, than live under slavery: "Yes, Massa Balmer, no suh, please don' throw that chair suh."

    --Head like a hole, black as your soul, i'd rather die than give you control-- NIN

    --
    soylentnews.org Go there to enjoy the people!
  76. Re:if i have many gigs of data to copy over somewh by moonbender · · Score: 2, Insightful

    You're insane. If your computer ever silently drops "a few bits" while copying stuff, there's something seriously wrong with your OS or your hardware, and things will break whether or not you're using the computer while copying. You might as well sacrifice a chicken to make sure the data transfer works, it'll have about the same effect.

    --
    Switch back to Slashdot's D1 system.
  77. Re:easy solution: by jne_oioioi · · Score: 1

    i bet you're not really scottish either.

  78. Re:Background? by moonbender · · Score: 1

    Eh. I've had Transmission's UI freeze when it's doing heavy IO-work like verifying local data, but it has never affected the whole system. They seem to have fixed that issue, too, since I just did a verify and the UI remained totally responsive.

    --
    Switch back to Slashdot's D1 system.
  79. Re:easy solution: by Ingo+Molnar · · Score: 3, Interesting

    That's great that you post your experiences with server scheduling in a topic about desktop scheduling. It's so relevant. No wait, it's not.

    The boundary between the desktop space and the server space is rather fluid, and many of the problems visible on servers are also visible on desktops - and vice versa.

    For example 'copying a large amount of data' on a server is similar to 'copying a big ISO on the desktop'. If the kernel sucks doing one then it will likely suck when doing the other as well.

    So both cases should be handled by the kernel in an excellent fashion - with an optimization/tuning focus on desktop workloads, because they are almost always the more diverse ones, and hence are generally the technically more challenging cases as well.

    Thanks,

    Ingo

  80. No kidding by Sycraft-fu · · Score: 1

    The only way NTFS would "eat" a file is if you were writing a new file, and the system crashed before it was completed. In that case, to make the FS consistent, the file will not be there as having it there would be inconsistent. However in the case up updating an existing file that isn't what happens. If the system crashes during updating a file, the file will be rolled back to the state before the write.

    As you say, this is how a journaled system works. Only once a write is complete, once things are consistent, is it applied in a permanent fashion. If a crash happens and the disk would be in an inconsistent state, the journal is used to roll things back so that everything is consistent.

    My guess is he's confusing ext4 with NTFS in a case of wishful anti-MS thinking. Ext4 had a case of the "nom noms" with regards to files because it could delay writes for so long. Because of the way some programs choose to update things like bookmarks and config files, they could vanish in a crash. This has been fixed, of course, but it was a problem initially you can search Slashdot for it. That is perhaps what he was thinking of.

  81. Why should he have to? by Sycraft-fu · · Score: 1

    A modern OS should be able to deal with being asked to do more than one thing with its disk. There will, of course, be a slowdown as disks are not good at random access, but it should not bring the system to a halt. At work all the time I copy large data files around. 10-100GB videos and VMs. I copy them between local drives, and to servers on the net and so on. System works fine when this is going on. Webbrowsing is fast and responsive, e-mail has no problems, everything works as normal. Only time you notice a slowdown is if you try and do something else disk intensive. Copy a VM on a drive and then boot another VM from that drive and both the boot and the copy slow down as the drive jumps back and forth. However it still works just fine, and the system is still responsive.

    This is not too much to ask, this is how it should work.

  82. Re:if i have many gigs of data to copy over somewh by ultranova · · Score: 1

    I would definitely ditch an OS that fucked up a file copy because I used the computer for something else while I was waiting.

    But it fucked it up with highest possible bandwidth, and in a way that's O(1) scalable up to 1024 processors in a NUMA cluster. Don't you care about server fuckup performance?

    --

    Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  83. Thanks! (Seems to be a reported bug too) by Sits · · Score: 1

    I've been seeing something similar for sometime too but thought it might be an isolated case. Now I've just searched I notice there is a Slashdot comment paste issues in Chrome which describes what I see (very slow pasting doesn't necessarily succeed in pasting).

  84. Nice values also affect the default I/O priority by Sits · · Score: 1

    If you are using the CFQ I/O scheduler on Linux a process' nice value also impacts its default I/O priority. From the ionice man page:

    For kernels after 2.6.26 with CFQ io scheduler a process that has not asked for an io priority inherits CPU scheduling class. The io priority is derived from the cpu nice level of the process

  85. Re:easy solution: by DarkOx · · Score: 4, Insightful

    Generally Windows runs badly without a swap. Don't listen to people who tell you to disable it. You should have a swap file on Windows no matter how much memory you have.

    Tweakers who don't really understand anything about Windows paging often conclude turning off the swap is a good idea, because they only run trivial applications and don't experience certain memory backed I/O operation failing with it off. They do see an initial speed boost though. The reason is NT is very pessimistic about memory. Windows assumes you will need to page out to disk. It therefore flush the set of static pages to disk almost right away. This is why there is so much more disk thrashing on Windows than say Linux when you start an application and plenty of memory is free. It will do its best to keep the working set out of the page file of course. This does give Windows a performance advantage under memory pressure however. When there is not enough memory to start a new application Windows can just drop the pages from memory of the application being paged out without the need to flush them to disk because they are already there; Linux will need to write those pages.

    Given that Windows boxes (desktops anyway) tend to have large numbers proccess running in the background so they usually are under that memory pressure.

    --
    Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
  86. Re:Background? by amn108 · · Score: 1

    My poor rhetorics regardless, the OP is wrong - there is neither a need for Linux to know that a file copy need be done in background (no need does not mean a user can't hint the system about his preference), nor should the users be dependent on 'ionice' to have responsive systems - Windows gets it right ENOUGH without user intervention.

    Same goes for CONFIG_HZ - I think we all know deep down inside that nobody is going to bother resetting variables to fix the symptoms of a problem lying somewhere else entirely. Also, Transmission was just an example - I am sure its program is fairly straightforward, certainly straightforward enough to not make it a culprit - a 'dd if=/dev/sda of=/dev/sdb' will starve the system in much the same manner.

    I did not make up the studies, in case you are ironic about them telling you what you want:
    http://portal.acm.org/citation.cfm?id=339420
    http://www.sapdesignguild.org/community/design/perc_perf.asp
    and of course the closely related term http://en.wikipedia.org/wiki/Perceived_performance

    I'll admit it's not like googling Angelina Jolie but the information is out there

  87. Re:if i have many gigs of data to copy over somewh by grepya · · Score: 4, Funny

    I would definitely not let a monkey like you get near my computers if some intense file copy was going on and they wanted to start doing other things while that was going on, sure you can do it but that does not make it a prudent thing to do, and the file may copy over just fine, and it may lose a few bits without even reporting any errors and that can happen on any OS, BSD, Linux, Winders & etc...etc...etc...

    You sir, are a perfect specimen of a BOFH. You only have a dim notion of what actually goes on inside those mysterious boxes that are unfortunately left under your care. And yet, by some curious accident of nature, you've been entrusted with root passwords for said boxes. You use phrases like "intense file copy" like they mean anything. You place every idiotic restriction that you can think of on the users of said boxes (who, incidentally, are almost always smarter and more qualified than you in whatever field of work they're in) by using words like "prudent" and "safety"... or god forbid... "security". You actually think that because I run a second program along with your "intense" copy, it can result in loss of "a few bits without even reporting any errors" due to what ? The magical fairies that dance inside those little chips getting angry ? Tired ? Can you do everybody a favor and reduce the amount of utter nonsense emanating out of that tiny, befuddled brain ?

  88. Re:Background? by amn108 · · Score: 1

    No intention from my side to badmouth the application. I like it a lot because of its simplicity and function. But I haven't fired it for months exactly because I am still afraid it will eat my CPU as the torrents are churning :-) You may be exactly right about the issue having been fixed, what do I know. My version is 1.92 (10621) that was bundled with Ubuntu 10.04. Mind you it's not Transmissions own GUI that suffered, it was any other process that I wanted to work with through the GUI.

  89. Re:Background? by amn108 · · Score: 1

    I meant version 1.93, not 1.92.

  90. Set to improve... by Sits · · Score: 1

    Assuming your SSD is detected correctly, the Linux block layer maintainer is proposing changes to improve SSD performance. The idea of waiting for requests (so as to be able to reorder them in a ladder fashion) is not used on SSD devices since 2.6.28 though.

  91. Re:Background? by amn108 · · Score: 1

    And of course (poor rhetorics again / trigger happy on the keyboard) the correct description of the behavior would not be Transmission eating my CPU. What I was observing however is that with enough torrents/seeds to apparently saturate the disk bandwidth (no big deal if you got a 10mbps Internet line both ways like I do) the rest of system GUI really was stopping to be responsive enough. Having 'ionice'd Transmission all the way to the background would make a considerable improvement to the point where things would be just acceptable. But I would always know when I had left it running in the background :-)

  92. Slashdot ext3 + fsync article by Sits · · Score: 1

    I would guess the Slashdot article about painful fsync behaviour on ext3 was "Kernel Hackers On Ext3/4 After 2.6.29 Release".

    (And wow - a developer who still reads and posts to Slashdot! I've got to ask, which tech news site did you all migrate to in the end?)

  93. Re:easy solution: by blueg3 · · Score: 1

    That's certainly not what any of the Windows internals books say. Do you have a reference for that?

  94. Linux does not mix well with USB Drives by supercell · · Score: 1

    I tried using a USB hard drive to back up about 30 gigs of data from my CentOS 4.8 server. The IO wait on the system shot up to 80% and I had to kill the process since it brought the machine to a crawl and the other processes were taking forever to complete. Something as simple as copying a file to a USB drive should not cause the system to slow to a crawl and become no long functional.

    1. Re:Linux does not mix well with USB Drives by dutchwhizzman · · Score: 1

      That's a USB problem, not a Linux problem.

      --
      I was promised a flying car. Where is my flying car?
    2. Re:Linux does not mix well with USB Drives by smash · · Score: 1

      No, its a linux problem. I can do the same thing without issue under Windows, MacOS and presumably (though I haven't tried it recently) FreeBSD. I have the same problem with the same intel standard hardware (D35DP desktop board) under linux.

      --
      I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
    3. Re:Linux does not mix well with USB Drives by supercell · · Score: 1

      No, that is a linux problem. One cp command whether over USB or NFS that is a slow connection, brings the system to a crawl. That is *MAJOR* problem.

  95. AS I/O scheduler was removed in 2.6.33 by Sits · · Score: 3, Informative

    AFAIK there are only two I/O schedulers remaining in recent Linux (and if you squint you might say that RHEL 5's kernel could have been related to 2.6.34 at one point right? :) - CFQ and deadline (three if you count noop I guess). The anticipatory scheduler was removed in 2.6.33...

    1. Re:AS I/O scheduler was removed in 2.6.33 by Ingo+Molnar · · Score: 2, Informative

      You are right, deadline is the other (much smaller/simpler) one - CFQ is the main IO scheduler remaining.

      You can still test AS by going back to an older kernel - and as long as it's a performance regression that is reported (relative to that old kernel, running AS), it should not be ignored on lkml.

      Thanks,

      Ingo

  96. Why is it that I have doubts by Provocateur · · Score: 1

    Somewhere, a guy just won a bet, that he could get slashdot to print the word 'brainfuck' on its front page. And not, mind you, on April Fool's Day.

    His elaborate scheme has paid off, and it might even slip under the radar, and remain undiscovered. I'm watching you. /* uses 2 finger gesture for 'watching you'

    --
    WARNING: Smartphones have side effects--most of them undocumented.
  97. Re:Background? by moonbender · · Score: 1

    Is that megabyte or megabit/s? Shouldn't matter, though, since even 10 megabyte/s should not saturate the disk. I guess doing random read/writes that way could do it, but that shouldn't be an issue with a torrent app. When I was verifying that torrent for the previous post, iotop reported transmission reading in data at 60 to 70 mbyte/s. The 1.3 mbyte/s down at which my connection usually tops out at have no effect on the system.

    If you need to use the app again, I'd recommend adding the transmission PPA repository and getting the most recent version (currently 2.11, Ubuntu 10.10 ships with 2.04: sudo add-apt-repository ppa:transmissionbt/ppa && sudo apt-get update && sudo apt-get upgrade

    --
    Switch back to Slashdot's D1 system.
  98. we have a winner! by Anonymous Coward · · Score: 0

    You've got it. Why are you fsync()ing so often for a userland app with trivial data. There are so many better ways to do this.

  99. You're just asking the wrong question by Anonymous Coward · · Score: 0

    The right one is... why am I still bothering with crappy desktop Linux in the first place?

  100. Re:easy solution: by dbIII · · Score: 1

    A point to consider is that after about 1995 everybody realised they were better off on a server OS on the desktop anyway.

  101. Re:it's more about memory, less about IO schedulin by Anonymous Coward · · Score: 0

    splice/vmsplice only work if the source or target is a pipe. Completely useless for file-to-file copy operations.

  102. Re:if i have many gigs of data to copy over somewh by BeanThere · · Score: 2, Funny

    I wanted to write a lengthy rebuttal here explaining how computers work, but my computer is busy with a seriously *intense* copy right now so I don't want to chance it.

  103. Re:easy solution: by sootman · · Score: 2, Informative

    Did you even read the summary? He specifically points out where desktop I/O has different requirements from server I/O: "When I'm copying a large amount of data in the background, everything else slows down to a crawl while the CPU utilization stays at 1-2%." So I think he's talking about things like video playback, web browsing, and general UI responsiveness--things that 100% do not matter on a server.

    I've noticed this myself--start a complex task and all of a sudden the UI becomes really jerky. If I'm trying to multitask and some mundane task is making the whole UI slow, that's bad. I it takes me 10 seconds to do something with an unresponsive UI instead of 5 just so a bunch of files can copy in 1:00:00 instead of 1:00:01, that's bad.

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  104. what else? by Anonymous Coward · · Score: 0

    "When I'm copying a large amount of data in the background, everything else slows down to a crawl while the CPU utilization stays at 1-2%"
    maybe the network card is crap or the wiring is faulty? myabe the HDD is near death?

  105. Re:easy solution: by Ingo+Molnar · · Score: 2, Insightful

    No, massive unfairness is just as bad on the server as it is on the desktop - in all but a few select batch processing situations.

    Replace 'desktop' with 'database', 'Apache', 'Samba' or 'number crunching job' and you get the same kind of badness.

    There's not much difference really. If it sucks on the desktop then it sucks on the server too: why would it be a good server if it slows down a DB/Apache/Samba/number-crunching-job while prioritizing some large copy operation?

  106. Re:easy solution: by shentino · · Score: 1

    Nothing specific I can recall but I do remember poking around a bit with SoftICE.

  107. Per process control API needed? Win32/64 way here by Anonymous Coward · · Score: 0

    "have you tried ionice?" - by larry bagina (561269) on Saturday October 23, @02:43PM (#33997928)

    http://sourceforge.net/projects/ultradefrag/forums/forum/709672/topic/3690136

    Find the analog to that in Linux' API's (thread and process level priority control code), & integrate it into your own open sourced code for projects you think needs it (which I imagine MOST of you around here don't operate fluently at sourcecode levels, some do I wager, but most not & even if you do, it takes time to study the flow of any project first).

    Still, per your idea? Well - That's how I'd go about it I suppose at this level, and you open source crowd do have that much going for you, which could work out nicely at times.

    APK

    P.S.=> See, I figure it this way, especially to those of you that code: You've got threads now in Linux (since what, kernel 2.2 or so?? All I know was that around 1998/1999, the Linux kernel wasn't preemptible or re-entrant, & that meant no threads @ the kernel level (usermode "round-robin to kernel" cooperative threads do NOT count, ala Windows 3.x)), vs. forks only, thank goodness...

    So, that all said & aside? Well, for "the industrious" & skilled amongst you, yes, this IS doable, because if I can do it in Windows, along with others now as shown above in the UltraDefrag64 project (& even show others also as I have for a 64 bit defragger in Windows) you can in Linux as well is my guess, even across languages (Object Pascal to C/C++ &/or Win32/64 API calls) and you additionally have your "Fresh Meat" sites etc. & Open code to work with... apk

  108. Re:if i have many gigs of data to copy over somewh by godrik · · Score: 1

    Well, I don't even recall something like that in NT branches of windows.

  109. On ANY OS... by gagol · · Score: 1

    If I need to move around huige amount of data, I use a commandline. Let it be Windows or Linux, it makes it easier on the system.

    --
    Tomorrow is another day...
  110. Re:easy solution: by Skal+Tura · · Score: 1

    My experience for Ubuntu on desktop was EXACTLY vice-versa, any I/O activity and even sounds started to jitter. I tested different schedulers, read ahead values etc. and that remained, nothing helped. I/O performance was crappy at best for desktop usage.

  111. Re:easy solution: by shentino · · Score: 1

    0-2G is local memory
    2-3G is global memory, for stuff like GDI and USER and KERNEL. Every process sees the same window between 2 and 3G
    3-4G is kernel memory.

  112. Re:easy solution: by JWSmythe · · Score: 1

        Really, I'm right with you. I've using both sides for a long time. I've transfered huge amounts of data around. The only time the system slows down is if I start maxing out the IO. If he had shitty drivers (ancient distro/kernel, modern hardware), sure the performance is going to suck. I had a whole flock of servers, where when we booted to the install disk (using ISOLinux), it took seemingly forever to do a big file transfer. It was a 5 minute job that would take about 30 minutes. Once we booted into a real running environment, we could (and did) do similar transfers on the same hardware in the expected time (about 5 minutes).

        Running terabyte transfers in the background shouldn't slow down the rest of the OS, unless it is reaching the IO capacity of the OS drive. Sure, transferring from sda1 to sda2 (booted to sda1) would be slow. Transferring from sdb1 to sdc1 should be fine.

        The same applies to other OS's too, except sometimes there is extra overhead, where the OS does get slow. Those were non-*nix OS's though.

        I have no problems with speed on USB 2.0 ports under Linux (current Slackware64). On the same hardware, I switch between Win7 and Slack64, and it's always faster under Slack64. Sometimes it's necessary to go in with Slack64 just to fix problems induced in Windows. The last one was a Cygwin install. There were things added in the directory, and I was housecleaning. Windows couldn't remove some files because of the filenames, and Cygwin couldn't even remove them. A quick boot into Linux, and then a 'rm -rf' did the trick.

    --
    Serious? Seriousness is well above my pay grade.
  113. Re:easy solution: by LingNoi · · Score: 1

    Your post makes no sense, what has lunix being awesome got to do with linux? They're totally different operating systems.

  114. Re:easy solution: by izomiac · · Score: 1

    So you're saying that disabling the page file is a bad idea if you use most of the memory you have? AFAIK that's the most obvious trade off with disabling the paging file. Hence why everyone says "if you have enough memory".

    OTOH, if your computer has 4 GB of RAM and you rarely, if ever, use over 800 MB of physical memory, then there is never a reason to page anything to disk. Windows will still preemptively page stuff there, in some idiotic fear that those 3.2 GB are going to get used sometime soon, so there's extra disk activity. While generally innocuous, that extra activity has an annoying habit of cutting into battery life (let's periodically spin up the HDD for no useful reason!), or happening when you're already disk IO saturated.

    It all comes down to your usage, hence why it's a "tweak" and not the default. I'm sure people make the mistake of not examining their needs (especially if they fail to account for the disk cache), but, yeah, that's what happens if you do cargo cult tweaks. At the other extreme, there still seem to be a lot of people that think "free memory" makes your computer (or phone) run faster. So they install extra RAM, memory defraggers, decrease disk cache size, and increase swap size and swappiness so they live at 2-3 GB of free memory rather than 1 GB. Free memory is wasted memory, and until RAM is filled up there's no logical reason to use the (very slow) disk for short term storage.

  115. Alternative file systems by Compaqt · · Score: 1

    What do you use? Genuinely curious.

    I'm using ext3 on a 1TB WD Green. I used to experience huge fsck times in Karmic (hours), but ext3 in Lucid seems fine except that it takes 45 seconds to create a directory if I haven't created on in the last 5 min.

    Are the "exotic" filesystems good for normal use and low fsck times? Is Reiser dead? Has btrfs reached a fork in the road?

    --
    I'm not a lawyer, but I play one on the Internet. Blog
    1. Re:Alternative file systems by rubycodez · · Score: 1

      XFS, but of course research the pros and cons and see if it's for you

      good overview:

      http://www.mythtv.org/wiki/XFS_Filesystem

  116. Highly I/O latency dependant application by Sami+Lehtinen · · Score: 1

    Just to mention a very bad app, I'll say Evolution. If there is any heavy disk I/O it becomes ultra sluggish. And you're asking for coffee break especially when you're changing from mail folder to another or deleting messages. I was practically forced to use ionice with any disk to maintain acceptable performance with Evolution. (2.6.32-25-generic #45-Ubuntu SMP x86_64 GNU/Linux / GNOME evolution 2.28.3)

  117. And by mahadiga · · Score: 1
    --
    I'd like to buy homeland for our 10 million people. http://twitter.com/mahadiga
  118. bug 12309 by Anonymous Coward · · Score: 0

    "When I'm copying a large amount of data in the background, everything else slows down to a crawl while the CPU utilization stays at 1-2%."

    I think what you describe is due to kernel bug 12309 and it looks to be fixed in 2.6.36. See https://bugzilla.kernel.org/show_bug.cgi?id=12309 and git commit http://git.kernel.org/linus/e31f3698cd3499e676f6b0ea12e3528f569c4fa3

  119. Ben by Anonymous Coward · · Score: 0

    Is this also an issue under Freebsd ? Im thinking of switching to one of the BSD desktop OS'es.

  120. Re:easy solution: by Anonymous Coward · · Score: 0

    Did you even run a search on the person you responded to? If you know just a bit about Linux kernel development you should recognize his name as one of the people that is a Linux kernel veteran that works for RedHat and is involved in kernel schedulers. There's a rather large chance your Linux systems are running on the scheduler he helped develop.

  121. Re:Background? by Anonymous Coward · · Score: 0

    Parent is right. You are wrong.

  122. this is why... by smash · · Score: 1

    ... i switched to FreeBSD, years go.

    --
    I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
  123. old dudes... by poptones · · Score: 1

    I'm 48, but you sound to me like an old dude. Why would I NOT buy 8GB of ram? I use a big chunk of it for my thumbnail directory and other temp data that would otherwise go to a real hard disk, and it's NOT expensive. Well, maybe it is NOW but when I bought it it was cheap. Funny to think I could actually have MADE money by investing in RAM back then, as the 4GB "kits" I use are now about twice what they were when I bought them.

    Anyway, who uses hibernate? Did you not see the comment about my five disk raid? This isn't a notebook. Who uses hibernate when they have torrents, freenet, and other p2p channels to make use of? You never get a good priority when you're constantly going on and off line.

    1. Re:old dudes... by SanityInAnarchy · · Score: 1

      I wouldn't buy 8 gigs of RAM, so I could spend that money on something else, and, as you suggested, because I have a laptop -- 8 gigs would've been significant at the time I bought this, and 4 gigs was the most this model could take.

      I don't use hibernate much, I mostly suspend to RAM. I have a separate server to seed if I really want it, but I find torrents and such work much better if I'm on a private tracker. I find it's much more convenient to have at least a notebook and a server, and I'm thinking I may get a desktop eventually.

      But even that server, hibernate isn't out of the question. Could be triggered by a UPS, or it could just be that I want to unplug it and move the power cable. If I hibernate and restore quickly enough, connections might not even drop.

      --
      Don't thank God, thank a doctor!
  124. What is so hard by SirThe · · Score: 1

    I don't care if you can do oodles of HTML, if you can't paste the bloody link into the bloody white box, then all that HTML isn't worth diddly squat.

  125. Hopefully fixed in the 2.6.36 kernel by Sits · · Score: 1

    One of the 2.6.36 patches explicitly mentions addressing poor responsiveness when doing IO on slow (e.g. USB) devices. The CentOS 4 kernel seems to be a heavily patched 2.6.9 though...

  126. BAD config & usage always trump OS performance by lpq · · Score: 1

    I don't know about how default conditions apply, but with CFQ, you should learn how to use 'ionice'. When an I/O bound process is assigned, "idle", it goes completely 'idle' when any other process competitively wants I/O. So complaining about I/O processes swamping userland, is showing a configuration problem, not a problem with the scheduler.

    What more do you want? This is the whole reason different I/O schedulers were added.

    If you don't want the I/O to go into cache, then make sure your I/O heavy processes use the posix_fadvice( fd, , , POSIX_FADVIS_DONTNEED);

    So what's the problem. You have a way to control priority as well as usage. What more do you want?

    A refinement, of possible benefit, would be a param to limit the cache-pages/process in memory at any point. That could be another way to address the issue. Hmmm...

  127. Re:if i have many gigs of data to copy over somewh by Anonymous Coward · · Score: 0

    I would definitely ditch an OS that fucked up a file copy because I used the computer for something else while I was waiting.

    Really +4 Insightful for what is obviously a Trollish, poor choice of curse words language choice. Okay lets run with your hypothesis, consider the following...

    Than you have already ditched Windows, and if not you could not help but note that all new Windows OS development is using Linux development strategies, philosophies, etc, heck they even use the term kernel now too.

    Not just Windows either, the Mac is built on Unix/Linux as well, they just call it OS X.

    Pretty soon you will not have an operating system to use, based on your own definition, that is unless you step up and start helping to develop open source and Linux specifically. That way all the great new stuff will eventually get ported over whatever non-Linux operating system you are using, be it Windows 7 or OS X. Regardless Linux will have it first!

    Of course that would mean you could not just complain, but you would have to have a solution as well...now that would NOT be Troll-like...that would be my suggestion to you. Don't complain unless you are going to provide a solution. No solution, then you must be a troll.

  128. Re:easy solution: by TheTrueScotsman · · Score: 1

    Read up on Antony Flew. It might broaden your education somewhat.

  129. Re:easy solution: by xtracto · · Score: 1

    That's Adobe's fault, although still Windows problem. You can create a RAM drive and set swap to that partition as a fix.

    Don't know how easy is to do that in Seven. That's one of the reasons I like XP... it is really easy to abuse (i.e., make things work MY way, instead of Ballmer's way)

    --
    Ubuntu is an African word meaning 'I can't configure Debian'
  130. Solaris! by Anonymous Coward · · Score: 0

    How about switching to Solaris 10? It has no scheduling issues: it is lightning fast, even during very heavy I/O.

  131. Re:easy solution: by KZigurs · · Score: 1

    The trouble is that in server workloads you generally don't see ONE LARGE I/O operation - lots of small ones instead. There are very very few server workloads that involve transferring >100MB data at a time (even when it comes to DB snapshoting). On the desktop this is common (all your AVI files).

    Scheduler has to find a balance between allocating large enough slices of CPU time so that system isn't slowed down to a crawl due to context switching/missed cache hits/spinning between actually idle tasks while keeping them short enough so that somebody using the system doesn't notice the latency when his process has a chance to draw pretty terminal texts/pictures.

    It's a tricky balance for a large number of technical and psychological (ooh, a benchmark) reasons.

  132. Re:easy solution: by Ingo+Molnar · · Score: 2, Informative

    The trouble is that in server workloads you generally don't see ONE LARGE I/O operation - lots of small ones instead. There are very very few server workloads that involve transferring >100MB data at a time (even when it comes to DB snapshoting).

    There's lots of server workloads that involve large IO requests:

      - backups
      - DB startup/shutdown
      - DB traffic that generates or reads a lot of new data (say report generation)
      - HPC workloads that work with huge data sets
      - animation farms that work with huge images/movies
      - web servers streaming out big files
      - fsck
      - virtual desktop servers where the desktops are virtual instances running on the server. There any IO load within that 'desktop' runs on the server.

    etc. As there is a fair number of server workloads that are IO heavy but which use small IO requests.

    On the desktop this is common (all your AVI files).

    If you have those big files in networked storage or if you are backing them up to some network host then you've already transformed those kinds of IO requests into big IO requests on the server side as well: the big file you read or write on the desktop the network file/backup server will read/write from its own disks, etc.

    Really, "interactivity sucks during big IO" kind of bugs can hurt servers just as much as they can hurt desktops. The boundary between desktops and servers is very fluid.

  133. Re:easy solution: by DaVince21 · · Score: 1

    He's already using a real OS. How else do you think he posted this? The C64 BASIC interpreter?

    --
    I am not devoid of humor.
  134. Re:if i have many gigs of data to copy over somewh by FudRucker · · Score: 1

    you all trust and have much more confidence in computers than I do, I surely don't trust them and have very little confidence in them

    --
    Politics is Treachery, Religion is Brainwashing
  135. Number of requests by Anonymous Coward · · Score: 0

    Sometimes poor I/O scheduling is because the I/O scheduler can't see the requests at all.
    Look at /sys/block/sda/queue/nr_requests, it is by default some low number like 128.
    Considering a few I/O requests, and their associated read-aheads, it can quickly fill up.
    At that point no further requests are even *seen* by the I/O scheduler until it empties some of the queue.

    Did you try setting it to some higher number like:
    echo 4096 > /sys/block/sda/queue/nr_requests

  136. ionice by Anonymous Coward · · Score: 0

    http://linux.die.net/man/1/ionice

  137. Re:I fixed it! by DaVince21 · · Score: 1

    Believe me, that'll just make your system less responsive.

    I wish I were kidding.

    --
    I am not devoid of humor.
  138. ionice -c 3 can improve performance by Cassini2 · · Score: 2, Interesting

    I often note that multiple simultaneous low-priority file copies implemented as:

    ionice -c 3 rsync bigfilein directoryout

    run faster than multiple simultaneous high-priority copies implemented as:

    rsync bigfilein directoryout

    If the copies are run one at a time, the higher priority rsync runs faster. For multiple copies, often the lower priority rsyncs run faster. Also, desktop usability is much improved with the lower priority rsyncs.

    I suspect a priority inversion occurs inside the file systems write back cache. At regular priority levels, data is not written back to disk in a timely manner. The ionice -c 3 gives the disk caches a higher priority than the rsync I/O commands, preventing the I/O commands from filling the cache and creating a priority inversion.

    The Gnome GUI in Ubuntu is particularly vulnerable to this priority inversion, as by default it does multiple copies simultaneously inside a separate window. Ubuntu usually performs better than Windows however. Between the A-V software in Windows, and the tendency to swap applications out of memory to maximize disk cache, Windows usually performs the same copy operations more slowly than Ubuntu and with less system responsiveness.

  139. MOD informative ++ by Anne+Honime · · Score: 1

    Didn't even knew it was there. Thanks, works perfectly.

  140. Re:easy solution: by rwa2 · · Score: 1

    I've seen similar issues on certain hardware... I did a lot of tweaking on my older platform (Tyan Tiger MPX with a Trident 4D Wave NX audio card) but never really got audio jitter to go away completely until I simply bit the bullet and upgraded my computer (to some AMD760 chipset with onboard audio).

    But if you've got a reasonably modern system, I'd suggest disabling PulseAudio on Ubuntu and running your audio apps on straight ALSA drivers.

    And lest I lose my Linux fanboi cred, I might want to add that the Tyan Tiger MPX was a real pain under Windows... while audio worked fine, nVidia 6800 was a mess due to the crappy windows AGP drivers... mistesselated triangles showing up everywhere!

  141. Re:easy solution: by Anpheus · · Score: 1

    Ah, so the solution is just to not run the most common of all user desktop scenarios (not to mention laptops), the single hard disk PC.

    I see where you're getting at, very clever.

  142. Re:if i have many gigs of data to copy over somewh by Anonymous Coward · · Score: 0

    You actually think that because I run a second program along with your "intense" copy, it can result in loss of "a few bits without even reporting any errors" due to what ? The magical fairies that dance inside those little chips getting angry ?

    Actually, he's not wrong. If you have broken hardware (whether broken-by-design or just ordinary faulty stuff), there are a lot of failure modes which might not show up under light load but will show up under heavy load. Examples of this kind of thing really do show up in the field. However, the solution to it is not to live in fear, but instead to identify hardware which is solid under any load condition and buy that hardware rather than cheap shitty junk which breaks if you look at it crosseyed.

    Here's just one example of how hardware might be able to handle light loads but not heavy: power distribution. As you load a chip more, it consumes more power. The supply voltage is ideally held constant, so more power implies greater current (since P = current * voltage). However, the regulator typically can only regulate the voltage at the chip's connections to the circuit board. Inside the chip, there are "wires" distributing power, and they have resistive losses like any other type of wire. The more current that's flowing, the greater the voltage drop. If there's too much drop, the supply voltage for some circuits inside the chip might dip below the point where they can operate reliably.

    So in other words, it's quite possible to design a chip which functions very reliably under light load, but under heavy load some of its circuits don't get sufficient voltage and start malfunctioning.

  143. Re:easy solution: by SharpFang · · Score: 1

    OP is not joking. I'm using Ubuntu on eee900 netbook, and I can go make a coffee if I copy a 700MB movie from SD to internal storage. Lotsa RAM is not an option, and the system is default install of one partition for everything. It's pretty obvious if you have some overkill hardware the performance drop won't be nearly enough to affect user experience. No, "Buy More RAM" is what I'd expect from a Microsoft support to hear... I choose Linux primarily because of abysmal Windows performance on that netbook.

    --
    45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
  144. Re:it's more about memory, less about IO schedulin by jabjoe · · Score: 1

    That doesn't seam to be true.

    http://stackoverflow.com/questions/1580923/how-can-i-use-linuxs-splice-function-to-copy-a-file-to-another-file

    This is something I was wondering. As I understand it splice/sendpage just marks a page belonging to a block of one filesystem as a page of a block of another filesystem. Thus no memory copying, the same RAM the data was read from one disc is used to write that data to another disc. So I think markhahn has a point, the problem is userspace, not the kernel. The cp code could be faster if it used splice/sendpage zero copy stuff (when dealing with filesystems that it is possible to do so (i.e non-FUSE)).

    BusyBox certainly doesn't http://git.busybox.net/busybox/tree/libbb/copyfd.c

  145. Re:easy solution: by SharpFang · · Score: 1

    Still, a server task slowed down by 50% will take 2x the time to finish, that's all. A GUI slower by 50% disrupts the user's workflow and will make the task 3-4x longer because the user wastes time elsewhere, performs unnecessary tasks waiting for the GUI to respond, overlooks appearing reply and reacts much slower...

    Think of a network that runs at half the speed vs one with 50% packet loss.

    --
    45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
  146. Re:it's more about memory, less about IO schedulin by jabjoe · · Score: 1

    The GNU cp doesn't either:

    http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/copy.c

    Could be an interesting test.

  147. Re:easy solution: by ByOhTek · · Score: 1

    I've had systems where it slows down for large file transfers, and others where it doesn't. The pattern I've noticed: Intel integrated video chipsets. It may be any integrated video, but the only integrated video I've had and used with Linux is intel.

    Windows/Linux/FreeBSD: None slow down appreciably with a large file transfer and dedicated video card, though Windows has the most slowdown in this case.

    Linux, by far, handles large file transfers the worst with integrated cards (at least G31 and earlier chips), and FreeBSD is the only one of the three where I don't see much performance degradation.

    I *suspect* the issue is related to shared memory, although I would think that DMA would fix that.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  148. Re:easy solution: by MrSenile · · Score: 1

    I've found that IDE controllers tend to get bogged with heavy I/O. Some of the better controllers like SATA or SCSI tend to totally release the overhead of the I/O.

    I also found some CPU/motherboard issues with I/O. For example, one system had an ATA-66 harddrive, and a 64 bit AMD processor (Turon I belive?). When the ATA was pegged, the AMD processor was totally slapped in the face, total time skews and everything.

    It wound up being a weird timing issue in the processor where the fair-que got smacked around because of the timing bugs.

    So sometimes, the hardware as well as the exact kernel revision you're using can impact performance.

    One of the things I find that helps performance is to disable hyperthreading in your bios. For bogged down I/O, that seemed to improve a lot of performance.

    Secondly, make sure you have a swap partition specified. Even if you have enough memory to choke a horse, you still should have some swap specified as the kernel may decide to swap out memory that's not been accessed in a long while to disk.

    I hope this helps things.

  149. Re:easy solution: by Anonymous Coward · · Score: 0

    I don't thrash a lot in Windows. I thrash more in OpenSUSE than I did in XP (I only put Linux on that PC when I try it). It has 2GB RAM which can run Vista and XP with little to no thrashing (with Swap set to Automatic). My other PCs run Windows 7 with 4+ GB RAM and a Dedicated ReadyDisk that is = in size to the RAM. They don't thrash at all :P

    I experience these issues on Linux. It seems to happen most when the updaters run. So, whilst a Linux Desktop MAY boot up faster than XP, the Updater Applet immediately checks for updates, and it completely bogs down KDE. The end result is that I have to wait about as long as I do in XP to use the System. Also makes the desktop more jerky than necessary.

    I find Linux to thrash more than Windows XP or 7 because it is more aggressive IRT caching. It's more similar to Windows Vista (which was extremely cache-happy).

  150. Re:easy solution: by Anonymous Coward · · Score: 0

    If you have enough RAM Windows doesn't need a SWAP file. It will just cach things to RAM. Premier can run fine if you have lots of RAM and disable the SWAP file. By lots of RAM... 4GB RAM is not enough to run Premier that way if you are editing Videos of a decent size. I'm thinking more of 8-16GB RAM.

    Windows can run out of Virtual Memory as well (just like most other OSes), so the fact that you have a SWAP file will not stop you from running out of Memory - especially with a high class Video Editing application... 4GB RAM is too little, IMO.

    It was enough in 2004 or so, though...

  151. Re:easy solution: by marcello_dl · · Score: 1

    try dd if=/dev/zero of=/tmp/delme bs=4K

    with my sid kernel it hoses X, but with some patience you ctrl-z out of it or pause the process from a text console.

    But usually you don't dd stuff, and usually windows is slower than debian. Where I work, all issues are windows related. Too much time to reinstall (aptosid from a usb stick: complete desktop able to print everywhere scan from everywhere in 4 damn minutes, while unattended XP clean install from SP2 takes hours) which office license was installed where, newer office seems less compatible with openoffice etc. All machines are dual booting.

    IIRC kanotix ships with kon kolivas kernel so one can easily try out which scheduler is right for him. Then bother patching if it really makes a difference.

    --
    ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
  152. Re:easy solution: by marcello_dl · · Score: 1

    Oh great I tried my own suggestion and it doesnt hose the system. Maybe newer kernels corrected the problem? Im on 2.6.36 and ext3 (on encrypted LVM) and doing the dd right now, as root. Load is 4, X is only a lil jerky at times. It was with earlier kernels and ext4 maybe...

    --
    ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
  153. Re:easy solution: by marcello_dl · · Score: 1

    I question your experience of average desktop users.

    The most common scenario is a single hd and lots of usb drives with data stored and retrieved from that.

    Average users don't even know how to make a copy, they usually move files around if same filesystem and copy it around if different filesystem no matter if they wanted to move or copy stuff in the first place.

    Back to topic, transfers on the same filesystem are slow because the heads are switching back and forth from source to destination blocks. If that hoses the system because of scheduling problems i dunno since i can't reproduce the problem anymore :D

    --
    ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
  154. Re:if i have many gigs of data to copy over somewh by prefect42 · · Score: 1

    Because copying over a big file and doing other things is too taxing for a modern machine? Seriously?

    Most shocking i/o behaviour like this I've suffered from has been a result of crap RAID controllers. Big cache, shoddy drivers/firmware/hardware, and linux i/o scheduling doesn't get a look in. Potentially you find your one critical read stuck behind 512Mbytes of poorly performing writes all within the confines of the card.

    --

    jh