Memory system and method for controlling non-volatile memory
According to one embodiment, a memory system perform a first write operation for writing data to a non-volatile memory by a first write method for writing multi-bit information per memory cell. When a power loss event occurs while the data is written, the memory system calculates a remaining time period required to complete write of an unwritten portion of the data. When the remaining time period is longer than a time period required to write the whole of the data by a second write method for writing one-bit information per memory cell, the memory system performs a second write operation for writing the whole of the data by the second write method in place of the first write operation.
1. A memory system comprising:
a power supply circuit configured to supply power to components of the memory system from a backup power source in response to a power loss event;
a write buffer;
a non-volatile memory including a plurality of blocks; and
a controller configured to store data to be written, which is received from a host, in the write buffer temporarily and perform a first write operation for writing the data in the write buffer to a first block of the non-volatile memory by a first write method for writing multi-bit information per memory cell,
wherein the controller is configured to:
calculate a remaining time period required to complete write of an unwritten portion of the data in the write buffer by the first write operation when a power loss event occurs;
perform a second write operation for writing a whole of the data in the write buffer to a second block of the non-volatile memory by a second write method for writing one-bit information per memory cell, in place of the first write operation when the remaining time period is longer than a first time period required to write the whole of the data in the write buffer to the non-volatile memory by the second write method; and
continue the first write operation when the remaining time period is not longer than the first time period.
2. The memory system of claim 1 , wherein the first block is a block allocated for writing of data to be written, which is received from the host, and the second block is a block allocated to save data in response to the power loss event.
3. The memory system of claim 1 , wherein the first write method is a write method for writing 3-bit information per memory cell.
4. The memory system of claim 1 , wherein the controller is configured to calculate the remaining time period by subtracting a time period from start of the first write operation to occurrence of the power loss event from a time period required to write the whole of the data in the write buffer to the non-volatile memory by the first write method.
5. The memory system of claim 4 , wherein the controller comprises a timer configured to measure the time period from start of the first write operation to occurrence of the power loss event.
6. The memory system of claim 1 , wherein the controller is configured to return a response indicating completion of write of the data to the host in response to storage of the data in the write buffer.
7. The memory system of claim 1 , wherein the controller is configured to switch a block to which the data is to be written from the first block to the second block when the remaining time period is longer than the first time period.
8. A method of controlling a memory system comprising a non-volatile memory, a write buffer, and a power supply circuit configured to supply power to components of the memory system from a backup power source in response to a power loss event, the method comprising:
storing data to be written, which is received from a host, in the write buffer temporarily;
performing a first write operation for writing the data in the write buffer to a first block of the non-volatile memory by a first write method for writing multi-bit information per memory cell;
calculating a remaining time period required to complete write of an unwritten portion of the data in the write buffer by the first write operation when a power loss event occurs;
performing a second write operation for writing a whole of the data in the write buffer to a second block of the non-volatile memory by a second write method for writing one-bit information per memory cell, in place of the first write operation when the remaining time period is longer than a first time period required to write the whole of the data in the write buffer to the non-volatile memory by the second write method; and
continuing the first write operation when the remaining time period is not longer than the first time period.
9. The method of claim 8 , wherein the first block is a block allocated for writing of data to be written, which is received from the host, and the second block is a block allocated to save data in response to the power loss event.
10. The method of claim 8 , wherein the first write method is a write method for writing 3-bit information per memory cell.
11. The method of claim 8 , wherein the calculating the remaining time period comprises subtracting a time period from start of the first write operation to occurrence of the power loss event from a time period required to write the whole of the data in the write buffer to the non-volatile memory by the first write method in order to calculate the remaining time period.
12. The method of claim 11 , wherein the time period from start of the first write operation to occurrence of the power loss event is measured by a timer in the memory system.
13. The method of claim 8 , further comprising returning a response indicating completion of write of the data to the host in response to storage of the data in the write buffer.
14. The method of claim 8 , further comprising switching a block to which the data is to be written from the first block to the second block when the remaining time period is longer than the first time period.