Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2013 11:04:47 -0800
From:      Dieter BSD <dieterbsd@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: HDD write cache
Message-ID:  <CAA3ZYrBK2Vyb50_ZLN7fyOV6RJjpHmjbY-EfvvxtzMda8ge2OQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Wojciech writes:
> after reading quite recent topics about disabling/enabling write cache, i
> tried to test in on desktop 3.5" drive
>
> kern.cam.ada.write_cache: 1
> kern.cam.ada.read_ahead: 1
> kern.cam.ada.0.read_ahead: -1
> kern.cam.ada.0.write_cache: -1
>
> i tried writing 1 or 0 to kern.cam.ada.0.write_cache, and there were
> exactly no differences at all, and disk seems to do always write caching.
>
> Does that drive lie and ignore commands or i do it wrong?
>
> this is my disk.
>
> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
> ada0: <SAMSUNG HD501LJ CR100-10> ATA-8 SATA 2.x device
> ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
> ada0: Command Queueing enabled
> ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)

1) See the other followups about making sure this change actually takes
effect.

2) How, exactly, are you testing this?  With Command Queueing enabled,
(and assuming that it is working properly) you will not see any difference
in speed with a casual test.

Does ata(4) support your controller?  Last time I looked, ata did not
support NCQ. :-( So turning the write cache on/off gives a huge difference
in speed.

When ahci and siis came out, NCQ was so fast that it looked like the
write cache was on.  I had to write a special pathological test to
be able to tell the difference between having the write cache on and
using NCQ.  I needed to verify that the write cache was really off so
that my data was safe.

In anything resembling normal use, NCQ with the write cache off is
just as fast as having the write cache on.  You really get the best
of both worlds, speed and safety.  Now all we need is NCQ support
for all the controllers that have it.



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