Subject: Re: disks write-back cache
To: NetBSD Kernel Technical Discussion List <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 04/28/2003 23:11:38
On Sat, Apr 26, 2003 at 03:56:27PM -0400, Greg A. Woods wrote:
> [ On Saturday, April 26, 2003 at 10:00:44 (-0700), Jason Thorpe wrote: ]
> > Subject: Re: disks write-back cache
> >
> > On Saturday, April 26, 2003, at 09:05  AM, Manuel Bouyer wrote:
> > > 
> > > This cause problems for filesystems or applications that take measure to
> > > prevent problems in case of unattended reboot (e.g. FFS, or sendmail).
> > > Until today I though I was safe when using SCSI disks.
> > > I think the kernel should print a warning when it probes a disk with the
> > > write cache enabled.
> 
> Heh.  Yes, disk manufacturers seem to want to give the impression of
> good performance more than they need to give the impression of more
> reliable operation, but good server vendors worth their salt will want
> to ensure more reliable operation over and above performance tweaks that
> will lower reliability.  :-)
> 
> > Perhaps the kernel should print the cache enabled status of the drive 
> > with the autoconfiguration messages?
> 
> Yes please!  This would be very useful.

For IDE it would be useless. IDE drives always have write-back enabled at
power-on.

> 
> It would also be very useful to print the AWRE and ARRE settings (as I
> may have mentioned at least once before :-).  I keep meaning to hack
> on this myself, but have never got around to it.
> 
> BTW, is there any plan/desire to make this new dkctl(8) manage such
> things as the SCSI A?RE mode page settings, especially when such
> settings might be common to other non-SCSI devices?

No, I think this belongs to scsictl, they looks scsi-specific.
What are AWRE and ARRE ?

> 
> > Anyway, if the drive isn't going to reorder commands, then your 
> > performance can be really bad with the w/b cache disabled.  We should 
> > probably have some dkctl(8) settings that allow tuning these other 
> > kinds of disk parameters.
> 
> s/dkctl/scsictl/?  Or are you saying that dkctl(8) will become the
> preferred way to interact with "disks" as opposed to having special

It depends. For generic things (cache enable/disable, bad block lists, etc),
dkctl is appropriate. However, for things like the queueing behavior,
scsictl is probably more appropriate (because it affect all tagged-queuing
capable devices, not only disks).

> 
> BTW, it would also be nice to have generic mode page editing in
> scsictl(8), as well as specific AWRE & ARRE set&clear commands in either
> scsictl(8) and/or dkctl(8).  :-)  (I keep building the old FreeBSD
> "scsi" command to do this because I'm too lazy to re-jig the code to fit
> into scsictl... :-)

Yes. Are you volonteer ? :)

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--