CPC G06F 3/064 (2013.01) [G06F 3/0604 (2013.01); G06F 3/0631 (2013.01); G06F 3/0656 (2013.01); G06F 3/0679 (2013.01); G06F 12/0238 (2013.01); G06F 12/1009 (2013.01); G06F 2212/7201 (2013.01)] | 12 Claims |
1. A control method of a flash memory controller, wherein the flash memory controller is configured to access a flash memory module, the flash memory module comprises a plurality of blocks, and the control method comprising:
receiving a settling command from a host device, wherein the settling command configures at least one portion of the flash memory module as a zoned namespace, wherein the zoned namespace logically comprises a plurality of zones, the host device performs a zone-based data write operation on the zoned namespace, each zone has a same size, logical addresses corresponding to each zone are continuous, and the logical addresses are not overlapping between zones;
writing data of a first zone into a plurality of first blocks;
establishing a zone-block mapping table, wherein the zone-block mapping table comprises information about the first zone and the corresponding first blocks;
establishing or updating a valid page count table after the data is written into the plurality of first blocks;
receiving at least one deallocate command from the host device, wherein each deallocate command comprises a logical address range that is to be deallocated;
updating the valid page count table according to the deallocate command to generate an updated valid page count table;
determining if the valid page counts of all of the first blocks corresponding to the first zone become zero according to the updated valid page count table; and
if the valid page counts of all of the first blocks corresponding to the first zone become zero, recommending the host device to send a reset command, wherein the reset command is used to reset the first zone;
wherein the valid page count table is a zone valid page count table, and the zone valid page count table records a plurality of bits of each zone, and each bit corresponds to a logical address range corresponding to a physical page or a logical address unit.
|