Disks using DMA causing high CPU usage

Sna Fu snafu6002 at hotmail.com
Sat Oct 22 14:08:37 PDT 2005


I installed a Maxtor 250Gb ATA133 drive in my FreeBSD machine just yet,
and after doing the common stuff it came up and running just fine. Curious
as I am I decided to do some benchmarks (Bonnie++) to see if a 16Mb cache
affected performance, but much to my surprise I saw that the drive was
using up to 99% of my CPU!

Here is the Bonnie output:

File './Bonnie.7724', size: 104857600
              -------Sequential Output-------- ---Sequential Input--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec
          100 15326 50.3 14596 24.5 17190 27.8 42274 99.0 132574 99.2
13326.4 98.0

As you can see, the CPU usage is quite high and the drive throughput is
not what I expected either, but I'm not sure if those are normal rates.
Anyway, the ouput that Bonnie gave me lead me to believe that the drive
might not be using DMA at all, so I checked this using atacontrol:

ATA channel 1:
    Master:  ad2 <Maxtor 6L250R0/BAH41G10> ATA/ATAPI revision 7
    Slave:  acd0 <ATAPI CDROM 52X/V130F> ATA/ATAPI revision 0

Master = UDMA66
Slave  = UDMA33

So much for this drive, but I found that both drives on ATA channel 0 were
having the same issue! Both are awfully CPU-intensive when under load,
however I am using a fairly old DMA cable (40 pins) so both disks are
running on UDMA33. Yet, they *are* using DMA so at least I would've
expected a lower CPU utilisation - or am I dead wrong there?

Relevant dmesg output follows:

atapci0: <Intel ICH UDMA66 controller> port
0xf000-0xf00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 31.1 on pci0
ata0: channel #0 on atapci0
ata1: channel #1 on atapci0
ata0-master: DMA limited to UDMA33, non-ATA66 cable or device
ata0-slave: DMA limited to UDMA33, non-ATA66 cable or device
ad0: 78167MB <Maxtor 6Y080P0/YAR41BW0> [158816/16/63] at ata0-master UDMA33
ad1: 78167MB <Maxtor 6Y080P0/YAR41BW0> [158816/16/63] at ata0-slave UDMA33
ad2: 239372MB <Maxtor 6L250R0/BAH41G10> [486344/16/63] at ata1-master UDMA66
acd0: CDROM <ATAPI CDROM 52X/V130F> at ata1-slave PIO4

The machine and disks (sans the 250gb one) performed fine when I was still
running Linux, albeit after some tweaking with hdparm (i.e. enabling
32-bit transfer mode).

My questions in a nutshell: Why is my transfer rate so disappointing, and
why is my CPU usage so enormously high when the disks are being put to
work? I'm out of ideas, I hope anybody can help.

Thanks in advance,

Dan(iel) Eisenhower

Spel spelletjes met je online vrienden via MSN Messenger 

More information about the freebsd-questions mailing list