• Please review our updated Terms and Rules here

Caching hard drive controller functions?

Dagwood

Experienced Member
Joined
Oct 16, 2018
Messages
66
I would like to better understand how hard drive controllers with dedicated cache utilized their resources. What was the most optimal caching strategy used by vendors (what to store, and when)?
Similar for IDE vs. SCSI? Was the cache used for reading, writing, or both? If the cache was used as a write buffer then it seem data might not be written to the hard drive before the machine might appear safe to power off.
 
Hard drive controllers with built in caches had secret sauce caching routines. Not publicly known and often optimized for specific tasks meaning relatively poor for others. It worked in a similar fashion to the normal OS level caches storing frequently accessed data and reading ahead somewhat and allowing writes to be ordered for maximum throughput. Probably less efficient than the OS cache since the OS cache knows how the allocation is stored and can therefore load up small sections of critical data in advance. Of course, the caching controller's memory wasn't being taken from the system memory pool so memory limited servers didn't wind up having to use virtual memory to retain a disk cache.

Caching can be used on both reads and writes. Yes, there is a chance for data loss if someone races to turn the server off hence attaching to a UPS providing time to shut down in a clean fashion.
 
Or battery-backed memory in some controllers, so they could prevent data loss by writing pending data after power was back.
 
Back
Top