Patent ID: 7853761

Claim:
A magnetic disk apparatus comprising: a magnetic disk; a nonvolatile memory; a volatile memory configured to store write commands supplied from a host system and data accompanying the write commands; and a first flush control unit configured: to arrange the write commands stored in the volatile memory, in such an order that the write commands may be written at a highest efficiency possible, to store into the nonvolatile memory a time required to write each of the write commands stored in the volatile memory on the magnetic disk, a cumulated time required to write the write commands on the magnetic disk in a forward order starting with a first command, a time required to write each of the write commands stored in the volatile memory to the nonvolatile memory, and a cumulated time required to write the write commands to the nonvolatile memory in a reverse order starting with a last command, to classify a command for which the cumulated time required to write the write commands on the magnetic disk is longer than the cumulated time required to write the write commands to the nonvolatile memory into a second group of commands, to classify a command for which the cumulated time required to write the write commands on the magnetic disk is not longer than the cumulated time required to write the write commands to the nonvolatile memory into a first group of commands, to write the data accompanying the first group of commands to the magnetic disk, and to write the second group of commands and the data accompanying the second group of commands to the nonvolatile memory.