Slashdot Mirror


Apple OSes and IDE DMA Support?

KFox wishes to get to the core of this particular issue: "I just recently purchased an iBook and I have noticed that even in Jaguar, the system gets choppy from disk I/O. It appears that Mac OS 9 and Mac OS X don't support DMA access for hard drives, even if the drives are initialized in a UDMA mode. Wintel has had support in this area for a long time (since Win95b). Has anyone in the Mac world had any experience with DMA support on hard drives? Is it supported on iBooks? If so, which models?"

49 comments

  1. Drive Setup v1.1 by brejc8 · · Score: 4, Informative

    The ChangeLog seems to have added UDMA in version 1.1 and later updated in 1.7 .
    Try searching for UDMA Ultra-ATA ATA33/66/100 because DMA doesnt allways show up.

  2. DMA check for your ibook by TwP · · Score: 4, Interesting
    DISCLAIMER: I have not tried this, but I found a webiste that has ...

    Daemon News has a little section on the iBook and DMA. You can see the Darwin boot sequence by holding down the "v" key at startup. Find the section titled "Further Exploration: Das Boot" in the article above and it will tell you how to view the boot messages and other useful tidbits.

    IOATAPICDDrive: Using DMA transfers
    IOCDDrive drive: MATSHITA, CD-ROM CR-175, rev 5AAE [ATAPI].
    IOATAHDDrive: Using DMA transfers
    IOHDDrive drive: , TOSHIBA MK3211MAT, rev J1.03 G [ATA].
    IOHDDrive media: 6354432 blocks, 512 bytes each, write-enabled.


    It appears that this revision-A iBook does indeed have DMA enabled for both the hard drive and the CD-ROM drive.

    This does not help you enable your own DMA, but do a search on Google for enabling DMA on FreeBSD style systems. You might find something useful.
    1. Re:DMA check for your ibook by OttoM · · Score: 2, Informative

      Since 10.0 it is Command-V (V was the public beta). The information in the daemon news article is quite old. Jaguar seems a lot less verbose. It does not say anything about DMA transfers for disk or CD. Which of course doesn't mean it does not do DMA.

    2. Re:DMA check for your ibook by Anonymous Coward · · Score: 0

      ha ha. made you reboot! uptime this!

    3. Re:DMA check for your ibook by mAIsE · · Score: 0

      try

      dmesg |more

  3. Choppy Disk or VM switching out by Anonymous Coward · · Score: 5, Informative

    Are you sure it's the disk causing the problem vs delays due to VM switching in and out. There's a memory utility (can't remember name, Memory Tracker or Memory Monitor?) that will beep each time memory is paged in or out (or you could use top if you can interpret the numbers).

    I've found it can be pretty easy to use up all free RAM if you have a number of programs open or they leak memory. I've found at times I've had over 2GB of switch files.

    This is with 896 MB of RAM, iBooks can be under spec'd in that department.

    1. Re:Choppy Disk or VM switching out by Golias · · Score: 5, Insightful
      I thought the same thing as the AC when I saw this post. This sounds like more like a VM issue than a "lack of DMA" issue.

      I also recently bought an iBook, and the very first thing I did, before I even booted it up, was drop in a bunch more RAM (and my Airport card, while I was in there). I have not experienced the kind of sluggishness you are talking about during disk reads, so that might be what your actual problem is.

      OS X is the best OS experience I've ever had, but it is a memory pig. If you have the default RAM in your iBook (probably 128), you are hitting the VM a lot. It's fine if you don't mind a little sluggishness, but memory is cheap now days, so buying more is money well spent. Even another 128 can make a world of difference.

      --

      Information wants to be anthropomorphized.

    2. Re:Choppy Disk or VM switching out by coolgeek · · Score: 3, Informative

      Me too. Esp. if running OS X w/256MB (or less), you need the WindowServer compression hack or else all your available RAM goes to window buffers, which inevitably causes swapping.

      --

      cat /dev/null >sig
    3. Re:Choppy Disk or VM switching out by frankie · · Score: 3, Informative

      Note that window buffer compression is enabled by default in Jaguar. I still wouldn't run OS X with less than 256MB though, and 512+ is much faster.

    4. Re:Choppy Disk or VM switching out by Anonymous Coward · · Score: 0

      i use memory monitor, although i dont know if it beeps, it does display a greta graph of memory useage in the dock and it will show you the memory paged in and out.

      this and cpu monitor in dock are very useful to visualy understand what your mac is doing.

      apple should never ship a mac with less than 256mb and i reccomend a min of 384mb at very least for most people.

    5. Re:Choppy Disk or VM switching out by foo12 · · Score: 1

      Don't blame all the memory gobbling on Mac OS X itself. There are still a lot of leakey programs for OS X, even by developers who usually are better at catching major bugs. e.g., the current version of BareBone's Super Get Info has a command line tool which leaks like a seive; I've seen its private memory allocation push 80MB.

    6. Re:Choppy Disk or VM switching out by uid8472 · · Score: 1

      Try the command "vm_stat 1"; that'll print out VM statistics once a second, with the counts of various events (pages in/out, zerofills, etc.) given incrementally (and the grand totals every 25 lines or so).

  4. try this by austad · · Score: 4, Informative

    # sysctl -a | grep dma

    Look for a setting that's related to DMA and set it from 0 to 1 with "sysctl -w". You should be able to place the setting in /etc/sysctl.conf to make it enable it on every boot also.

    Unfortunately, I don't have an OSX box to test it on right now, so I can't give you the exact settings. OSX is based on FreeBSD, and FreeBSD enables DMA by default, however, it's possible that apple found a need to disable it by default. Some drive/chipset combos have problems with DMA, and if they were unsure of which brands of drives or chipsets they would be using, disabling it by default would be the safe way to go.

    --
    Need Free Juniper/NetScreen Support? JuniperForum
    1. Re:try this by frankie · · Score: 2
      sysctl -a | grep dma

      Nope. sysctl is actually pretty small in Darwin. Mine has about 240 lines, 2/3rds of which are network-related (including 40 for IPv6). The only line related to my HD was vfs.hfs has 2 mounted instances

    2. Re:try this by smeat · · Score: 1

      It's possible that the settings are hidden. Try "man ata" and see if it shows the settings like it does on freebsd, and then try setting them with sysctl.

      --
      "Let's not bicker about who killed who." Monty Python
    3. Re:try this by dadragon · · Score: 2

      OS X is based on FreeBSD, yes, but only its "BSD layer". The BSD layer controlls such things as file systems, networking, unixy apis used throuout the system, etc. The libraries and userland tools are based on NetBSD.

      Its driver interface is a homebrew system from Apple called "IOKit". IOKit is where you'd find the DMA stuff, but I don't know offhand how to access it. You may do well to try Apple's "Apple System Profiler".

      --
      God save our Queen, and Heaven bless The Maple Leaf Forever!
  5. A quick trip to Google... by frankie · · Score: 3
    ...reveals that yes the iBook has DMA .

    Will someone please mod up comment #4222630??? The most likely answer is KFox hasn't bought enough RAM.

  6. A quick and dirty test of disk I/O by tokki · · Score: 2, Informative
    This isn't the most comprehensive test of a disk's I/O, but it's easy and will help determine is something is potentially wrong.

    Run this command from the Mac OS X shell:

    dd if=/dev/zero of=testfile bs=1024 count=102400

    This should make you a 100 MB file. dd on some systems will give you how long it took to write out the file in seconds (I don't have access to a Mac OS X box, just a FreeBSD box right now). If it doesn't, just put the time command in front of it:

    time dd if=/dev/zero of=testfile bs=1024 count=102400

    Devide the number of seconds it took to write the file out by 100, and you'll have a rough estimate of how many megabytes per second it wrote to disk.

    Again, not the most comprehensive metric of course, but it gives you a rough idea. For an ATA system, it should probably do between 15 and 25 MB/s without too much trouble for a fast drive. The interface can be much faster (ATA/33, ATA/66, ATA/100), but the UFS and HFS+ file systems aren't optimized for sequntial writing, and/or there are other factors involved, so about 20 MB/s is a good mark I think.

    1. Re:A quick and dirty test of disk I/O by Duck_Taffy · · Score: 1

      hmm...my PowerBook G4 did about 10 MB/sec. I know it has some file system errors, but it shouldn't slow down the disk that much. Perhaps it's just because it's a low-RPM laptop hard drive.

      --
      Karma: Ran over your dogma.
    2. Re:A quick and dirty test of disk I/O by Tom+Rini · · Score: 1

      I just tried this in my PowerBook G4 (800MHz), and got roughly 20MB/s.
      Semi-cold:
      $ time dd if=/dev/zero of=testfile bs=1024 count=102400
      102400+0 records in
      102400+0 records out
      104857600 bytes transferred in 5.325558 secs (19689505 bytes/sec)

      real 0m5.569s
      user 0m0.190s
      sys 0m3.840s

      And the best of 3 runs in a row was:
      104857600 bytes transferred in 4.984686 secs (21035949 bytes/sec)

    3. Re:A quick and dirty test of disk I/O by tokki · · Score: 1

      That's pretty standard. I get that on my Linux box with SCSI even, also similar for FreeBSD.

  7. I don't think it's DMA by ebcdic · · Score: 2

    My iMac certainly feels slow, but I don't think it's disk DMA. "dd bs=8k count=100000 >ttt /dev/zero" gives a speed of 30MB/s which would be impossible without DMA.

    Anyone know a way to check whether ATA write caching is enabled? The FreeBSD ATA sysctls don't work, presumably it's not using the FreeBSD ATA drivers.

  8. Not a DMA issue by h0tblack · · Score: 3, Informative

    Mac's have had DMA support for a long time in both hardware and software, see this technote and the Developer Notes on hardware here for details. This includes the original clamshell iBooks. The iBooks may not have the fastest drives or interfaces but I don't think this is the problem. It's much more likely a Virtual Memory issue with lots of caching going on. check the contents of /private/var/vm/ for the number of 80Mb swapfiles you have, also try issuing vm_stat from the CLI to see whats going on. Two suggestions, either get more RAM or setup a 'clean' swap-drive partition.

    1. Re:Not a DMA issue by KillerKane · · Score: 1

      As I recall, DMA support in the Mac goes all the way back to the IIfx (a sweet machine), but it either was never used by the system or was hobbled in some way. Not sure. Can someone fill in the blanks?

      --
      There is a thin line between genius and insanity. I have erased that line. -- Oscar Levant
  9. Masking interrupts... by Audin · · Score: 2

    The linux IDE driver has an option which controls whether it masks or unmasks non-ide interrupts during disk transfers...this option makes a huge difference in the amount of cpu time disk access consumes.

    Does OS X have something similar?

  10. DMA isn't the problem by jchristopher · · Score: 1
    DMA isn't the problem, OS X is the problem. The iBook, even with 512 MB of RAM, is just slow. Live with it I guess... and everyone considering one of these machines should try before they buy.

    I was just at CompUSA playing with the new dual Macs with Jaguar, and even they lag quite frequently, especially with web browsers.

    1. Re:DMA isn't the problem by Anonymous Coward · · Score: 0

      Well then I guess, even if a Dual G4 Mac is supposeably supposed to be faster then a PIV at 2.2gig(yeah they suck but they are getting a little better), OS X is slowing them down a whole lot, do yourself a favor and use a PPC linux distro and run OS X under an emulator(I just can remeber that good one).

    2. Re:DMA isn't the problem by jchristopher · · Score: 1
      do yourself a favor and use a PPC linux distro

      Yep. True, true. PPC Linux just goes to show how much OS X is making the hardware look slow. Even on a slower Mac like the iBook, Linux PPC hums along while OS X lags.

      Apple should take a lesson from the open source folk here. It is really shameful that the various Linux GUIs run fast, while OS X GUI runs slow.

      Yes, I know all the fancy things the OS is doing that need so much horsepower. If the penalty is a slow GUI, then perhaps the OS should not be designed to do those things?

    3. Re:DMA isn't the problem by KillerKane · · Score: 1

      "Yes, I know all the fancy things the OS is doing that need so much horsepower. If the penalty is a slow GUI, then perhaps the OS should not be designed to do those things?"

      I can agree, up to a point, but aren't we then penalizing them for moving forward? I remember when color was thought unnecessary and expensive (both ways, financially and computationally) and no one argues whether there should be color anymore. Apple has a history of pushing the interface forward, usually in an expensive way, and eventually everyone follows along. I have a gig of RAM in my current computer (new iMac) and I remember my last computer (Quadra 950) had 72 MB. That was considered an obscene amount at the time, and cost more than this whole box tricked out with everything. System 7's 24-bit icons were thought to be unnecessary eye-candy, for cryin' out loud. I really believe that eventually graphics layers like Quartz, with transparency, anti-aliased compositing, etc., will be as normal as color is now. The hardware just has to catch up.

      You could also make the case that for the non-technical masses, some of that eye-candy is useful. The Genie Effect, for example, is what ZoomRects always wanted to be. I've seen some non-technical users who didn't get what ZoomRects was trying to tell them. They get it with the Genie Effect because it's more literal. I don't need it, you don't need it, but many, maybe most of them will benefit from it.

      Of course, it's also a young system. Give them a little time for optimizations, custom chips, etc.

      --
      There is a thin line between genius and insanity. I have erased that line. -- Oscar Levant
    4. Re:DMA isn't the problem by Anonymous Coward · · Score: 0

      When you can come up with a Linux distro (or pretty much any open source project like KDE or GNOME) that has a consistent UI then you can make that judgement.

    5. Re:DMA isn't the problem by jchristopher · · Score: 1
      I can agree, up to a point, but aren't we then penalizing them for moving forward?

      I agree that progress is important. But progress is no good if the hardware isn't fast enough to support it. I think OS X is great. I also think too slow to be usable on current Apple hardware :(

    6. Re:DMA isn't the problem by Krach42 · · Score: 1

      I have a 550 PowerBook, and I loved it when I first got it, and to be honest, I don't think I ever noticed how laggy OSX was. Now with Quartz Extreme, things just respond, and move quickly. In fact, things started moving so well, that I dumped Mozilla, because it's interface was lagging (because of the XUL defined interface)

      Doing everything with PDF actually is a very good idea, and I'm glad that they have it hardware accelerated now. Scaling is much faster now, and everything.

      But, as someone else pointed out. Linux, and X still seems to run faster, which is pretty ridiculous, considering that X is running through a socket, and is naturally indirect. *sigh*

      Still, Apple's idea is to advance what you can do with a GUI, and I think this is a positive push forward, and I want to see Apple make things even better!

      --

      I am unamerican, and proud of it!
    7. Re:DMA isn't the problem by Phroggy · · Score: 2

      But, as someone else pointed out. Linux, and X still seems to run faster, which is pretty ridiculous, considering that X is running through a socket, and is naturally indirect. *sigh*

      I'm not sure of the technical details, but my understanding is that Quartz works very much the same way - although Apple doesn't seem to provide a way to do it, it should be possible to run applications remotely, just like you can with X.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    8. Re:DMA isn't the problem by MalleusEBHC · · Score: 1

      It is *hardly* too slow to use on current Apple hardware. I have a 500 mhz TiBook with 512 megs of RAM, and Jaguar runs great on my system. Hell, 10.1 was definitely fast enough to where it wasn't noticeable. Are there other faster GUIs like Platinum (OS 9) or Linux GUIs. Sure. But all the other great things about Aqua really make that irrelevant in my mind. I have a feeling that a lot of people who have complained about Aqua's speed have not tried it on machines with a good amount of memory. I put a memory stick into someone's 400 mhz G3 iMac for them; the difference between 64 MB and 320 MB afterwards was amazing. If a 400 mhz G3 with 320 MB of memory can run it fine, pretty much any Mac can.

    9. Re:DMA isn't the problem by Anonymous Coward · · Score: 0

      There are lots of caveats to that. OSX's filesystems
      are sub-par in their performance: HFS+ is damn slow, and their FFS implementation is missing nearly all of the performance updates written in the last decade. Combine that with the extra compute
      required for the OSX eye candy (recall that XFree offloads much of its 2D blitter ops to the graphics cards) and it is fairly clear why OSX is slower.

      This is all fixable by apple, however they'll
      have to prioritize doing so.

    10. Re:DMA isn't the problem by jchristopher · · Score: 2
      500mhz iBook, 640 MB RAM. It sucked ass. Going back and forth with a Windows machine was like night and day. Fast, slow. Fast, slow.

      The year is 2002. I simply will not "wait" for my computer. The computer is supposed to wait for me, yet I find myself waiting on OS X, especially when running web browsers.

    11. Re:DMA isn't the problem by ksheff · · Score: 1

      But, as someone else pointed out. Linux, and X still seems to run faster, which is pretty ridiculous, considering that X is running through a socket, and is naturally indirect. *sigh*

      If you're on the console it better NOT be. Local X traffic should be going through shared memory queues and not the networking layer. Many of the common unix workstations were doing this at least 10 years ago. I would certainly would have thought the XFree team would have implemented it.

      --
      the good ground has been paved over by suicidal maniacs
    12. Re:DMA isn't the problem by Anonymous Coward · · Score: 0

      Combine that with the extra compute required for the OSX eye candy (recall that XFree offloads much of its 2D blitter ops to the graphics cards)

      This was supposed to have been done for 10.2
  11. Re:a reality check by Krach42 · · Score: 1

    Good job attacking a person over asking a question. True, I may tell people that their question is stupid, but if they ask them after that: "Why?" I'll respond quite plainly why their question/comment was "stupid" in my opinion. But I will never not answer a question.

    --

    I am unamerican, and proud of it!
  12. a fix that worked for me by ob1f62 · · Score: 1

    I too had bad problems with disk lag on my iMac rev. A. The two things I did to increase the speed of drive I/O to the very acceptable latency was;
    1: 7200rpm drive (this helped the most) and
    2: More ram as others have mentioned, this does work (320mb instead of 192mb).

    A couple of my friends have also done dedicated swap partitions and gotten even more responciveness. Other's here have also suggested this.

    R

  13. DMA by Anonymous Coward · · Score: 0

    yes DMA should be enabled.

    yes the user probably doesn't have enough RAM, however my similar spec pismo G3/500 is noticeably faster than the ibook. I wonder how much of this is related to a larger L2 cache(2M? don't remember offhand) & 100MHz system bus v. 66MHz & 256k L2. IIRC the drive speeds are similarly specced.

    OSX: speed is usable, but hardly what it could/should be. I especially noticed this the other week when I had to boot into OS9 and how freaking FAST it felt, especially when dealing with LARGE items lists. Apple needs to spend more time of some serious optimization work and less on the icrapps. They REALLY REALLY need to spend more time with finishing up the basics, and getting us a decent filesystem.

    yeah, Linux was ok, but I ended up dumping it at about the time that 10.1 came out as alot of stuff just wasn't supported or buggily supported or a pain in the a--. The linux/*BSD desktop experience also blows chunks. Nice as servers/development workstations though...
    But I get about the same experience compiling stuff myself & using X11 & fink. (Although X11 under OSX performance isn't all that hot, but see above.)

  14. Macs and DMA by Tycho · · Score: 1

    Every PCI Powermac with IDE i.e. the 6400/ 6360 and later has been able to do DMA and uses DMA if the drive supports it. You can't disable DMA if it is enabled and you are using the MacOS. Granted until the Blue & White G3 the kind of DMA used is Multiword DMA. Any of the problems you may have heard about Multiword DMA are only compatability problems in Win 95. Multiword DMA works perfectly fine in the MacOS.

    --
    Impersonating Tycho from Penny Arcade since before there was a PA.