Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: piixide write speed very slow - solved

On Fri, 4 Dec 2009, Stephen Borrill wrote:
I've seen a couple of boxes recently where writing to a piixide-attached disk was excruciatingly slow:

-------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec  %CPU
        4096  4268  3.1  4264  0.5  3994  0.6 92913 72.1 112090 11.4 1957.4  3.7

Turns out that this was simply down to the write-cache being disabled (OpenBSD explicitly forces the write-cache on). _Why_ the write-cache is disabled is less clear.

On this chipset and drive, the write-cache is on:
piixide0: Intel 82801I Serial ATA Controller (ICH9) (rev. 0x02)
wd0 at atabus0 drive 0: <WD2502ABYS-23B7A0 39M4511 42C0463IBM>

On this chipset and drive, the write-cache is off:
piixide0: Intel 3400 Serial ATA Controller (rev. 0x05)
wd0 at atabus0 drive 0: <WD2502ABYS-23B7A0 39M4511 42C0463IBM>

Note that the drive is an identical model in each case (there are no BIOS settings regarding this).

It seems to me that forcing write-cache on in the kernel is a bad idea for a couple of reasons: some users may want it off and enabling it early in the boot process in userland should be just as good.

To this end I've written an rc.d script to alter the settings as desired:

To use this add "drivecache=YES" to your rc.conf. It can be tweaked with drivecache_flags (set to ON or OFF to force cache on or off - defaults to ON) and drivecache_list (a space-separated list of drives to alter - defaults to all wd* and sd* devices).


Home | Main Index | Thread Index | Old Index