On Fri, Apr 5, 2013 at 3:39 PM, Per Jessen <per@computer.org> wrote:
Greg Freemyer wrote:
On Fri, Apr 5, 2013 at 12:27 PM, Per Jessen <per@computer.org> wrote:
Carlos E. R. wrote:
This should be diminished by good disk hardware with a /write/ ram cache in the firmware. This cache is pretty small, and I'm not sure it caches writes.
Disks don't do write-caching. That is left to hardware controllers with battery-backed cache.
ISTR that sata drives have a very small write cache. For some reason I'm remembering up to 7 writes can be cached. For streamed data like BC is talking about, that is effectively nothing.
Does it need to be explicitly enabled? Seems odd for the drive to report "data written to disk" unless it has?
I just used hdparm -I /dev/sda to check my laptop drive. It has a 8MB cache and it is enabled. I'm running a default openSUSE install, so I'd say it defaults to on with openSUSE. OTOH, read http://yarchive.net/comp/linux/drive_caches.html. There Linus says that the cache is typically made of large segments on the order of an entire track. I think a full track is about 1 MB currently, so I've got roughly 8 tracks worth of write cache on my low end laptop drive. If I'm doing linear writes like in BC's workload, it should work great at accepting more data. If a single sectors data was late arriving, the cpu could just keep pushing data out while the platter is rotating back around. That is the cpu should not get hit with a 10 msec penalty just because it was a microsecond late pushing out a given sector. Instead the cpu can just go as fast as it can as long as there is a cache segment free. In the BC workload case where the drive is not running at full speed, there is probably always a few free segments in the drives cache. I "think" there are cache flush commands the kernel can push to the drive to ensure the cache is flushed prior to moving forward. I don't know if the linux kernel actually pushes those types of barrier calls out to sata drives or not. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org