A magnetic disk drive with a caching system includes an intelligent
interface to communicate with a host, a magnetic disk and a cache memory
to buffer data transferred to and from the host. The caching system
maximizes drive performance based on past access history. The caching
system alters execution of commands by coalescing commands or executing
internal commands in parallel. The caching system anticipates data
requests by using a prefetch to store data that may be requested. The
caching system divides the cache memory into segments to store multiple
streams of data. The number of segments may be continuously adapted
according to the types of access to maximize performance by maintaining a
segment for each sequential stream of data. The caching system uses a
dynamic priority list to determine segments to maintain and discard. Each
segment is monitored to determine access types such as sequential, random,
and repeating. The access type determines the amount of data to prefetch
and to save, including a minimum and maximum prefetch. The caching system
may prescan the cache memory during prefetch to alter the prefetch amount
in response to a command request. The caching system may wait for a cache
memory access that has not yet occurred. An initiator changes the caching
parameters though a mode page.