Subject: Re: disks write-back cache
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Sean Davis <dive@endersgame.net>
List: tech-kern
Date: 04/27/2003 10:12:46
On Sun, Apr 27, 2003 at 04:03:58PM +0200, Manuel Bouyer wrote:
> On Sun, Apr 27, 2003 at 09:57:11AM -0400, Sean Davis wrote:
> > doesn't appear to work. I tried: dkctl wd0 setcache w, and got a:
> > pciide1:0:0: lost interrupt
> >   type: ata tc_bcount: 0 tc_skip: 0
> > 
> > and dkctl getcache still reported writeback cache as enabled.
> 
> dkctl wd0 setcache w will enable the cache. If it's already enabled, the
> drive may fail to handle it.
> My drives don't have problems with this.
> 
> > according to the dkctl manpage, my usage was incorrect. however, the command
> > according to the dkctl manpage to disable writeback cache would be dkctl wd0
> > setcache r, but this gives me:
> > dkctl: /dev/rwd0d: setcache: Operation not supported
> 
> dkctl wd0 setcache none will work.
No, it won't...
eros# dkctl wd0 setcache none
dkctl: /dev/rwd0d: setcache: Input/output error

in syslog:
Apr 27 10:08:57 eros /netbsd: pciide1:0:0: lost interrupt
Apr 27 10:08:58 eros /netbsd:   type: ata tc_bcount: 0 tc_skip: 0
Apr 27 10:08:58 eros /netbsd: wd0: wd_setcache command error 0x128
Apr 27 10:08:58 eros /netbsd: wd0e: DMA error writing fsbn 2691648 of
2691648-2691679 (wd0 bn 6885954; cn 6831 tn 4 sn 54), retrying
Apr 27 10:08:58 eros /netbsd: wd0: soft error (corrected)

however, on wd1:
eros# dkctl wd1 setcache none
eros# dkctl wd1 getcache
/dev/rwd1d: read cache enabled
/dev/rwd1d: read cache enable is not changeable
/dev/rwd1d: write cache enable is changeable
/dev/rwd1d: cache parameters are not savable
eros# dkctl wd1 setcache rw
dkctl: /dev/rwd1d: setcache: Operation not supported
eros# dkctl wd1 getcache
/dev/rwd1d: read cache enabled
/dev/rwd1d: read cache enable is not changeable
/dev/rwd1d: write cache enable is changeable
/dev/rwd1d: cache parameters are not savable
eros# dkctl wd1 setcache w
eros# dkctl wd1 getcache
/dev/rwd1d: read cache enabled
/dev/rwd1d: write-back cache enabled
/dev/rwd1d: read cache enable is not changeable
/dev/rwd1d: write cache enable is changeable
/dev/rwd1d: cache parameters are not savable

and no lost interrupt messages anywhere.

wd0 is a western digital WD1200JB special edition 120GB ATA100 w/ 8MB of
cache.
wd1 is an IBM deskstar 60GXP 20GB ATA100 with 2MB of cache.

I don't know why it should work for one but not the other...

-- 
/~\ The ASCII
\ / Ribbon Campaign                   Sean Davis
 X  Against HTML                       aka dive
/ \ Email!