ata vs wd driver performance

1999-12-08 Thread Richard S. Straka

I have recently performed some testing on the ata and wd drivers
on my system.  When writing to and reading from a file on the same
file system in the same directory, the ata driver appears to take almost

double the CPU time as compared to the wd driver.  However, when
reading from the raw disk, the ata and wd driver take about the same
amount of CPU time.  DMA is enabled in both driver.

Can someone explain why the ata driver is using more CPU?

Rich Straka
[EMAIL PROTECTED]

*
wd driver results writing to a file.

$ time dd if=/dev/zero of=test.dat bs=1024k count=256
256+0 records in
256+0 records out
268435456 bytes transferred in 41.810011 secs (6420363 bytes/sec)

real0m42.136s
user0m0.002s
sys 0m19.939s

*
ata driver results writing to a file.

$ time dd if=/dev/zero of=test.dat bs=1024k count=256
256+0 records in
256+0 records out
268435456 bytes transferred in 39.475358 secs (6800077 bytes/sec)

real0m39.750s
user0m0.008s
sys 0m35.665s



wd driver results reading from a file.

$ time dd if=test.dat of=/dev/null bs=1024k count=256
256+0 records in
256+0 records out
268435456 bytes transferred in 39.992958 secs (6712068 bytes/sec)

real0m40.040s
user0m0.025s
sys 0m13.387s


ata driver results reading from a file.

$ time dd if=test.dat of=/dev/null bs=1024k count=256
256+0 records in
256+0 records out
268435456 bytes transferred in 37.914618 secs (707 bytes/sec)

real0m37.944s
user0m0.009s
sys 0m28.221s



wd results reading from raw disk.

$ time dd if=/dev/rwd0 of=/dev/null bs=1024k count=256
256+0 records in
256+0 records out
268435456 bytes transferred in 33.100446 secs (8109723 bytes/sec)

real0m33.137s
user0m0.000s
sys 0m0.266s


ata results reading from raw disk.

$ time dd if=/dev/rwd0 of=/dev/null bs=1024k count=256
256+0 records in
256+0 records out
268435456 bytes transferred in 34.518500 secs (7776568 bytes/sec)

real0m34.535s
user0m0.000s
sys 0m0.222s



***
dmesg with wd driver.
***
Copyright (c) 1992-1999 The FreeBSD Project.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights
reserved.
FreeBSD 4.0-CURRENT #1: Sat Dec  4 09:22:58 MST 1999

Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 333189478 Hz
CPU: AMD-K6(tm) 3D processor (333.19-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x580  Stepping = 0
  Features=0x8001bfFPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX
  AMD Features=0x8800SYSCALL,3DNow!
real memory  = 134152192 (131008K bytes)
avail memory = 127021056 (124044K bytes)
Preloaded elf kernel "kernel" at 0xc0303000.
npx0: math processor on motherboard
npx0: INT 16 interface
pcib0: Host to PCI bridge on motherboard
pci0: PCI bus on pcib0
pcib1: VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge at device 1.0
on pci0
pci1: PCI bus on pcib1
isab0: VIA 82C586 PCI-ISA bridge at device 7.0 on pci0
isa0: ISA bus on isab0
ide_pci0: VIA 82C586x (Apollo) Bus-master IDE controller at device 7.1
on pci0
chip1: VIA 82C586B ACPI interface at device 7.3 on pci0
sym0: 875 irq 10 at device 8.0 on pci0
sym0: Symbios NVRAM, ID 7, Fast-20, parity checking
sym0: open drain IRQ line driver, using on-chip SRAM
vga-pci0: Matrox MGA 2164W graphics accelerator at device 9.0 on pci0
fxp0: Intel EtherExpress Pro 10/100B Ethernet irq 12 at device 10.0 on
pci0
fxp0: Ethernet address 00:a0:c9:27:fc:1d
fdc0: NEC 72065B or clone at port 0x3f0-0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1440-KB 3.5" drive on fdc0 drive 0
wdc0 at port 0x1f0-0x1f7 irq 14 flags 0xa008a008 on isa0
wdc0: unit 0 (wd0): IBM-DCAA-34330, DMA, 32-bit, multi-block-8
wd0: 4134MB (8467200 sectors), 8400 cyls, 16 heads, 63 S/T, 512 B/S
wdc1 at port 0x170-0x177 irq 15 flags 0xa008a008 on isa0
wdc1: unit 0 (wd2): WDC AC22500L, DMA, 32-bit, multi-block-8
wd2: 2441MB (4999680 sectors), 4960 cyls, 16 heads, 63 S/T, 512 B/S
wdc1: unit 1 (atapi): CD-ROM  TW 120D/V2.10, removable, dma, iordy
wcd0: drive speed 2062KB/sec, 240KB cache
wcd0: supported read types: CD-R, CD-DA
wcd0: Audio: play, 255 volume levels
wcd0: Mechanism: ejectable tray
wcd0: Medium: no/blank disc inside, unlocked
atkbdc0: keyboard controller (i8042) at port 0x60-0x6f on isa0
atkbd0: AT Keyboard irq 1 on atkbdc0
vga0: Generic ISA VGA at port 0x3b0-0x3df iomem 0xa-0xb on
isa0
sc0: System console on isa0
sc0: VGA 16 virtual consoles, flags=0x200
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
sio2 at port 0x3e8-0x3ef irq 5 on isa0
sio2: type 16550A
ppc0 at port 0x378-0x37f irq 7 drq 3 on isa0
ppc0: Winbond chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/16 bytes threshold
lpt0: generic printer on ppbus 0
lpt0: Interrupt-driven port
ppi0: generic 

Re: ata vs wd driver performance

1999-12-08 Thread Soren Schmidt

It seems Richard S. Straka wrote:
 I have recently performed some testing on the ata and wd drivers
 on my system.  When writing to and reading from a file on the same
 file system in the same directory, the ata driver appears to take almost
 
 double the CPU time as compared to the wd driver.  However, when
 reading from the raw disk, the ata and wd driver take about the same
 amount of CPU time.  DMA is enabled in both driver.

Since the old driver doesn't tell you which DMA mode it uses, its a
bit difficult to compare, but my gues is that the wd driver set UDMA2
mode and from the ata probe it can bee seen it only sets WDMA2 mode.

Besides you should upgrade your current, the ata driver has support
for the VIA chip now...

 Can someone explain why the ata driver is using more CPU?
 
 Rich Straka
 [EMAIL PROTECTED]
 
 *
 wd driver results writing to a file.
 
 $ time dd if=/dev/zero of=test.dat bs=1024k count=256
 256+0 records in
 256+0 records out
 268435456 bytes transferred in 41.810011 secs (6420363 bytes/sec)
 
 real0m42.136s
 user0m0.002s
 sys 0m19.939s
 
 *
 ata driver results writing to a file.
 
 $ time dd if=/dev/zero of=test.dat bs=1024k count=256
 256+0 records in
 256+0 records out
 268435456 bytes transferred in 39.475358 secs (6800077 bytes/sec)
 
 real0m39.750s
 user0m0.008s
 sys 0m35.665s
 
 
 
 wd driver results reading from a file.
 
 $ time dd if=test.dat of=/dev/null bs=1024k count=256
 256+0 records in
 256+0 records out
 268435456 bytes transferred in 39.992958 secs (6712068 bytes/sec)
 
 real0m40.040s
 user0m0.025s
 sys 0m13.387s
 
 
 ata driver results reading from a file.
 
 $ time dd if=test.dat of=/dev/null bs=1024k count=256
 256+0 records in
 256+0 records out
 268435456 bytes transferred in 37.914618 secs (707 bytes/sec)
 
 real0m37.944s
 user0m0.009s
 sys 0m28.221s
 
 
 
 wd results reading from raw disk.
 
 $ time dd if=/dev/rwd0 of=/dev/null bs=1024k count=256
 256+0 records in
 256+0 records out
 268435456 bytes transferred in 33.100446 secs (8109723 bytes/sec)
 
 real0m33.137s
 user0m0.000s
 sys 0m0.266s
 
 
 ata results reading from raw disk.
 
 $ time dd if=/dev/rwd0 of=/dev/null bs=1024k count=256
 256+0 records in
 256+0 records out
 268435456 bytes transferred in 34.518500 secs (7776568 bytes/sec)
 
 real0m34.535s
 user0m0.000s
 sys 0m0.222s
 
 
 
 ***
 dmesg with wd driver.
 ***
 Copyright (c) 1992-1999 The FreeBSD Project.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
 The Regents of the University of California. All rights
 reserved.
 FreeBSD 4.0-CURRENT #1: Sat Dec  4 09:22:58 MST 1999
 
 Timecounter "i8254"  frequency 1193182 Hz
 Timecounter "TSC"  frequency 333189478 Hz
 CPU: AMD-K6(tm) 3D processor (333.19-MHz 586-class CPU)
   Origin = "AuthenticAMD"  Id = 0x580  Stepping = 0
   Features=0x8001bfFPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX
   AMD Features=0x8800SYSCALL,3DNow!
 real memory  = 134152192 (131008K bytes)
 avail memory = 127021056 (124044K bytes)
 Preloaded elf kernel "kernel" at 0xc0303000.
 npx0: math processor on motherboard
 npx0: INT 16 interface
 pcib0: Host to PCI bridge on motherboard
 pci0: PCI bus on pcib0
 pcib1: VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge at device 1.0
 on pci0
 pci1: PCI bus on pcib1
 isab0: VIA 82C586 PCI-ISA bridge at device 7.0 on pci0
 isa0: ISA bus on isab0
 ide_pci0: VIA 82C586x (Apollo) Bus-master IDE controller at device 7.1
 on pci0
 chip1: VIA 82C586B ACPI interface at device 7.3 on pci0
 sym0: 875 irq 10 at device 8.0 on pci0
 sym0: Symbios NVRAM, ID 7, Fast-20, parity checking
 sym0: open drain IRQ line driver, using on-chip SRAM
 vga-pci0: Matrox MGA 2164W graphics accelerator at device 9.0 on pci0
 fxp0: Intel EtherExpress Pro 10/100B Ethernet irq 12 at device 10.0 on
 pci0
 fxp0: Ethernet address 00:a0:c9:27:fc:1d
 fdc0: NEC 72065B or clone at port 0x3f0-0x3f7 irq 6 drq 2 on isa0
 fdc0: FIFO enabled, 8 bytes threshold
 fd0: 1440-KB 3.5" drive on fdc0 drive 0
 wdc0 at port 0x1f0-0x1f7 irq 14 flags 0xa008a008 on isa0
 wdc0: unit 0 (wd0): IBM-DCAA-34330, DMA, 32-bit, multi-block-8
 wd0: 4134MB (8467200 sectors), 8400 cyls, 16 heads, 63 S/T, 512 B/S
 wdc1 at port 0x170-0x177 irq 15 flags 0xa008a008 on isa0
 wdc1: unit 0 (wd2): WDC AC22500L, DMA, 32-bit, multi-block-8
 wd2: 2441MB (4999680 sectors), 4960 cyls, 16 heads, 63 S/T, 512 B/S
 wdc1: unit 1 (atapi): CD-ROM  TW 120D/V2.10, removable, dma, iordy
 wcd0: drive speed 2062KB/sec, 240KB cache
 wcd0: supported read types: CD-R, CD-DA
 wcd0: Audio: play, 255 volume levels
 wcd0: Mechanism: ejectable tray
 wcd0: Medium: no/blank disc inside, unlocked
 atkbdc0: keyboard controller (i8042) at port 0x60-0x6f on isa0
 atkbd0: AT Keyboard irq 1 on atkbdc0
 vga0: Generic ISA VGA at port 0x3b0-0x3df iomem 0xa-0xb on
 isa0