Patent ID: 8868842

Claim:
A memory system comprising: a cache memory; a nonvolatile semiconductor memory in which data is written via the cache memory; an organizing unit that increases, in response to a resource usage of the nonvolatile semiconductor memory exceeding a specific value, a resource of the nonvolatile semiconductor memory by organizing the data in the nonvolatile semiconductor memory; a first flush control unit; and a second flush control unit, wherein the first flush control unit is configured to perform, in response to the resource usage of the cache memory exceeding a first threshold and being smaller than a second threshold that is larger than the first threshold, and organizing by the organizing unit being finished when a write request is not kept waiting after data write processing to the cache memory is performed, a first flush processing for flushing data in the cache memory to the nonvolatile semiconductor memory until a resource usage of the cache memory becomes equal to or less than the first threshold, and wherein the first flush control unit does not perform the first flush processing but accepts the write request in response to the resource usage of the cache memory exceeding the first threshold and being smaller than the second threshold when the write request is kept waiting after the data write processing to the cache memory is performed, wherein the second flush control unit performs, in response to the write request not being kept waiting after the data write processing to the cache memory is performed when the resource usage of the cache memory exceeds the second threshold, a second flush processing that includes: flushing the data in the cache memory to the nonvolatile semiconductor memory until the resource usage of the cache memory becomes equal to or less than the second threshold when organizing by the organizing unit is finished, and flushing, when organizing by the organizing unit is not finished by waiting until organizing by the organizing unit is finished, the data in the cache memory to the nonvolatile semiconductor memory until the resource usage of the cache memory becomes equal to or less than the second threshold, wherein the second flush control unit performs, in response to the write request being kept waiting after the data write processing to the cache memory is performed when the resource usage of the cache memory exceeds the second threshold, the second flush processing before accepting the write request.