Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jun 1999 08:34:45 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Alfred Perlstein <bright@rush.net>
Cc:        mike@hyperreal.org, freebsd-questions@FreeBSD.ORG
Subject:   Re: Optimizing IDE performance revisited
Message-ID:  <19990618083444.D9893@freebie.lemis.com>
In-Reply-To: <Pine.BSF.3.96.990617115251.14320l-100000@cygnus.rush.net>; from Alfred Perlstein on Thu, Jun 17, 1999 at 11:57:05AM -0500
References:  <19990617163819.14715.qmail@hyperreal.org> <Pine.BSF.3.96.990617115251.14320l-100000@cygnus.rush.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, 17 June 1999 at 11:57:05 -0500, Alfred Perlstein wrote:
> On Thu, 17 Jun 1999 mike@hyperreal.org wrote:
>
>> OK, from posts here and on the newsgroup, and the 'wd' man page, I found
>> that flags 0xb0ffb0ff were sufficient to enable the kernel to use an IDE
>> controller's 32-bit transfer, bus mastering, LBA addressing and
>> multi-sector transfer capabilities:
>>
>> controller      wdc0    at isa? port "IO_WD1" bio irq 14 flags 0xb0ffb0ff
>>
>> I saw a reference on the newsgroup to the fact that FreeBSD 3.0 and up
>> supports "PIO".. I've looked at the source in /sys/i386/isa/wd.c and only
>> saw one reference to PIO as some kind of fallback.
>>
>> My controller is capable of PIO mode 3 (11.1 MB/s in theory). No info about DMA
>> modes. My question is: is this as optimized as it can be, or no? I haven't
>> really noticed an improvement, is why I ask.

What does your dmesg output say?  You should get something like:

wdc0 at 0x1f0-0x1f7 irq 14 flags 0xa0ffa0ff on isa
wdc0: unit 0 (wd0): <IBM-DADA-26480>, DMA, 32-bit, multi-block-16

If you get the "DMA" message, then your chipset does support DMA.
Otherwise it'll fall back to PIO.

> Enabling PIO or DMA doesn't do all that much for transfer rate, however
> it offloads a lot of work from the CPU.

PIO is the mode in which the CPU does the work, so it onloads a lot of
work to the CPU.  It can also reduce transfer rates because the CPU
can't keep up.  I've seen a 10 MB/s drive reduced to 2.5 MB/s and 100%
CPU on a P5/133.

> Before I enabled DMA on my boxes, during heavy compiles top showed
> about 50% or more CPU devoted to "interupt" (processing hardware IO)
> when i switched to DMA it went to under 1% :)

Right.  That was PIO.

> if you want to see raw read performance try this:
>
> dd if=/dev/rwd0 of=/dev/null bs=512 count=1000
>
> -----^^^^^^^^^^
>> raw device for your harddisk.

The block size is important.  512 bytes (the default) will not give
you optimal performance.  Try 64 kB instead.  While this is running
(you may want to increase the count) use top or iostat to see the
interrupt time.  With PIO it will be high, with DMA practically 0.

Greg
--
When replying to this message, please copy the original recipients.
For more information, see http://www.lemis.com/questions.html
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990618083444.D9893>