A control method, device and equipment of a ZNS SSD device
By dividing the flash memory chips of the ZNS SSD device into multiple chipsets and parallel block groups and dynamically mapping them based on idle time information, the problem of low chip utilization is solved and the performance and life of the device are improved.
Patent Information
- Application Number
- CN202211711686.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-12-29
AI Technical Summary
The ZNS SSD device has the problem of low chip utilization during use.
By dividing the flash memory chip into multiple chipsets and parallel block groups, and performing dynamic mapping based on the idle time information of the flash memory chip, the target chipset and parallel block group are selected, and the mapping relationship between the partitions and the parallel block group is established to achieve dynamic mapping between the partitions and the parallel block group.
It improves the utilization rate of flash memory chips, reduces the probability of busy and idle states of chips, and improves the performance and life of the equipment.
Smart Images

Figure CN116069252B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile communication technology, and in particular to a control method, apparatus and device for a ZNS SSD device. Background Art
[0002] Solid-state drives (SSDs), based on flash storage media, are widely used in modern computer systems due to their low power consumption, high bandwidth, and lightweight advantages. Traditionally, hosts have used a block interface to interact with SSD devices. However, with the advent of the big data era, user demands for storage system performance and reliability have continued to increase. The significant mismatch between the traditional block interface and the characteristics of flash storage media has become a major factor hindering further improvements in SSD storage system performance.
[0003] Therefore, the Zoned Namespace (ZNS) interface has been proposed as an emerging storage interface for connecting hosts and SSD devices. The ZNS interface divides the logical address space into fixed-size zones and stipulates that each zone must be written sequentially and reset before further writing. These regulations make data writing more compatible with the characteristics of flash storage media.
[0004] Furthermore, proper data placement in partitions can reduce the effective data migration during garbage collection in SSD devices. Therefore, the ZNS interface can significantly reduce the write amplification and life loss caused by garbage collection, thereby further improving the performance of SSD devices. Among them, SSD devices using the ZNS interface are called ZNS SSDs.
[0005] Therefore, ZNS SSDs need to maintain a partition-level mapping relationship between physical addresses and logical addresses, that is, a mapping relationship between partitions and flash physical blocks. However, to ensure parallelism between SSD chips, current ZNS SSDs widely use a static partition mapping mechanism, that is, during initialization, physical blocks on different chips are statically (i.e., fixedly) mapped to different partitions (zones), and then they are no longer changed.
[0006] However, due to the principle of data locality, when host requests are concentrated on several partitions at a certain moment, the chips corresponding to these partitions are very busy, resulting in low chip utilization.
[0007] It can be seen from this that the existing technology has the problem of low chip utilization during the use of ZNS SSD devices. Summary of the Invention
[0008] Embodiments of the present application provide a ZNS SSD device control method, device and equipment to solve the low chip utilization problem of ZNS SSD devices in the prior art.
[0009] In a first aspect, the embodiments of the present application provide a ZNS SSD device control method. A ZNS SSD device includes a plurality of flash chips, each of which includes a plurality of physical blocks. The plurality of flash chips are divided into a plurality of chip groups. The physical blocks included in the flash chips in the same chip group are divided into a plurality of parallel block groups.
[0010] The method includes:
[0011] obtaining a target partition of a parallel block group to be mapped;
[0012] obtaining next idle time information of each flash chip included in the ZNS SSD device;
[0013] selecting a target chip group from the plurality of chip groups according to the next idle time information;
[0014] selecting a target parallel block group from the plurality of parallel block groups corresponding to the target chip group;
[0015] establishing a mapping relationship between the target partition and the target parallel block group.
[0016] In a second aspect, the embodiments of the present application also provide a ZNS SSD device control device. A ZNS SSD device includes a plurality of flash chips, each of which includes a plurality of physical blocks. The plurality of flash chips are divided into a plurality of chip groups. The physical blocks included in the flash chips in the same chip group are divided into a plurality of parallel block groups.
[0017] The device includes:
[0018] a first obtaining module configured to obtain a target partition of a parallel block group to be mapped;
[0019] a second obtaining module configured to obtain next idle time information of each flash chip included in the ZNS SSD device;
[0020] a first selecting module configured to select a target chip group from the plurality of chip groups according to the next idle time information;
[0021] a second selecting module configured to select a target parallel block group from the plurality of parallel block groups corresponding to the target chip group;
[0022] an establishing module configured to establish a mapping relationship between the target partition and the target parallel block group.
[0023] In a third aspect, an embodiment of the present application provides a ZNS SSD device, wherein the partitioned namespace solid-state drive (ZNSSSD) device includes a plurality of flash memory chips, each of which includes a plurality of physical blocks, the plurality of flash memory chips are divided into a plurality of chipsets, and the physical blocks included in the flash memory chips in the same chipset are divided into a plurality of parallel block groups;
[0024] The ZNS SSD device also includes a memory, a transceiver and a processor:
[0025] The memory is used to store computer programs;
[0026] The transceiver is used to send and receive data under the control of the processor;
[0027] The processor is configured to read the computer program in the memory and execute the aforementioned control method for the ZNS SSD device.
[0028] In a fourth aspect, an embodiment of the present application provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the control method of the ZNSSSD device described above.
[0029] In an embodiment of the present application, the ZNS SSD device includes multiple flash memory chips, each flash memory chip includes multiple physical blocks, wherein these flash memory chips are divided into multiple chipsets, and the physical blocks included in the flash memory chips in each chipset are divided into multiple parallel block groups. Therefore, in an embodiment of the present application, a parallel block group is used as the basic unit of partition mapping. In this way, after obtaining the target partition of the parallel block group to be mapped, the next idle time information of each flash memory chip included in the ZNS SSD device can be obtained first, and then a target chipset is selected from the multiple chipsets according to the next idle time information, and then a target parallel block group is selected from the multiple parallel block groups corresponding to the target chipset, and then a mapping relationship between the target partition and the target parallel block group is established.
[0030] It can be seen from this that in the embodiment of the present application, dynamic mapping of partitions and parallel block groups can be achieved based on the idle time of each flash memory chip included in the ZNS SSD device, so that the mapping of partitions to parallel block groups can be dispersed. In this way, the probability of a situation where some of the flash memory chips included in the ZNS SSD device are very busy while others are idle is reduced, thereby improving the utilization rate of the flash memory chips. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0032] Figure 1 Flowchart of a control method for a ZNS SSD device provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of the structure of a storage system in an embodiment of the present application;
[0034] Figure 3 This is a structural diagram of the ZNS SSD in an embodiment of the present application;
[0035] Figure 4 This is a schematic diagram of dynamic partition mapping in an embodiment of the present application;
[0036] Figure 5 This is a flow chart of the dynamic partition mapping mechanism in an embodiment of the present application;
[0037] Figure 6 This is a write request response flow chart in an embodiment of the present application;
[0038] Figure 7 This is a read request response flow chart in an embodiment of the present application
[0039] Figure 8 This is a structural block diagram of the control device of the ZNS SSD device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In the embodiments of this application, the term "and / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0041] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0042] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0043] In a first aspect, embodiments of the present application provide a control method of a ZNS SSD device.
[0044] The ZNS SSD device includes a plurality of flash chips, each of which includes a plurality of physical blocks, and the plurality of flash chips are divided into a plurality of chip groups, and the flash chips in the same chip group include physical blocks divided into a plurality of parallel block groups.
[0045] Here, all flash chips in the ZNS SSD device can be divided into a plurality of chip groups according to the partition parallelism defined by the device vendor, and all chips in each chip group can respond to the same request in parallel.
[0046] Optionally, among the physical blocks included in the flash chips in the same chip group, the physical blocks with the same offset address form a parallel block group; and the physical blocks included in the parallel block group correspond to the number of the parallel block group as the offset address.
[0047] Among the physical blocks included in the flash chips in the same chip group, the physical blocks with the same offset address form a parallel block group, and the number of physical blocks included in the parallel block group is equal to the parallelism of the partition, and each physical block comes from a different flash chip.
[0048] Based on this, in the embodiments of the present application, the parallel block group is used as the basic unit of dynamic mapping of the partition, which ensures the two characteristics of the partition mapping: block-level mapping and parallelism of the partition. Moreover, the mapping based on the parallel block group further reduces the memory overhead of the mapping table compared to the block-level mapping, because a parallel block group contains multiple physical blocks.
[0049] For example Figure 3 As shown in the figure, the ZNS SSD device includes chips 1 to 6, and the six chips are evenly divided into two chip groups, that is, chips 1 to 3 are in chip group 1 and chips 4 to 6 are in chip group 2. Each flash chip includes N physical blocks, and N parallel block groups can be formed in each chip group. Here, in chip group 1, the i-th physical block of chip 1, the i-th physical block of chip 2, and the i-th physical block of chip 3 form the parallel block group i of chip group 1; similarly, in chip group 2, the i-th physical block of chip 4, the i-th physical block of chip 5, and the i-th physical block of chip 6 form the parallel block group i of chip group 2, where i is an integer from 1 to N.
[0050] As Figure 1 shown, the control method of the ZNS SSD device includes the following steps 101 to 105:
[0051] Step 101: obtaining a target partition to which a parallel block group to be mapped belongs.
[0052] Here, the target partition to which the parallel block group to be mapped belongs is one of a plurality of partitions of a ZNS SSD device. Optionally, when a partition is in an idle state, the partition is not mapped to any parallel block group. When a partition starts to write data, a first parallel block group can be mapped to the partition. Optionally, one parallel block group is mapped to one partition each time.
[0053] Optionally, the step 101 of obtaining the target partition to which the parallel block group to be mapped belongs includes the following sub-steps H1 to H2:
[0054] Sub-step H1: determining a first partition associated with a write request when the write request is obtained, and determining whether a remaining physical space currently mapped by the first partition is less than a target space, wherein the target space is a physical space required by data to be written by the write request.
[0055] Sub-step H2: determining the first partition as the target partition to which the parallel block group to be mapped belongs when the remaining physical space currently mapped by the first partition is less than the target space.
[0056] Therefore, in the embodiment of the present application, when a partition starts to write data, if a remaining physical space currently mapped by the partition is insufficient (i.e., the remaining physical space is less than a physical space required by data to be written by a write request), it indicates that the partition needs to be mapped to a parallel block group. In this case, the subsequent steps 102 to 105 can be executed to map the partition to a parallel block group.
[0057] Optionally, the method further includes:
[0058] In a case where the remaining physical space currently mapped by the first partition is greater than or equal to the target space, writing the data to be written by the write request into the remaining physical space currently mapped by the first partition.
[0059] That is, when a partition starts to write data, if a remaining physical space currently mapped by the partition is sufficient (i.e., the remaining physical space is greater than or equal to a physical space required by data to be written by a write request), the data to be written by the write request can be directly written into the remaining physical space currently mapped by the partition.
[0060] Optionally, after the mapping relationship between the target partition and the target parallel block group is established, the method further includes:
[0061] Writing first data among the data required to be written by the write request into the remaining physical space currently mapped to the first partition, so as to fill up the remaining physical space currently mapped to the first partition;
[0062] Second data is written into the target parallel block group, wherein the second data includes data required to be written by the write request except the first data.
[0063] It can be seen that after mapping the target parallel block group to the target partition, the previously mapped parallel block group of the target partition can be filled first, and the remaining unwritten data can be written to the currently mapped target parallel block group.
[0064] Step 102: Acquire the next idle time information of each flash memory chip included in the ZNS SSD device.
[0065] Here, the next idle time is used to indicate the start time when the flash memory chip enters the idle state next time.
[0066] Step 103: Select a target chipset from the multiple chipsets according to the next idle time information.
[0067] Optionally, step 102, “selecting a target chipset from the multiple chipsets according to the next idle time information,” includes:
[0068] Determine, according to the next idle time information, a first flash memory chip among the flash memory chips included in the ZNS SSD device that will enter an idle state the earliest next time;
[0069] A chipset including the first flash memory chip is determined as the target chipset.
[0070] It can be seen from this that in an embodiment of the present application, the flash memory chips included in the ZNS SSD device can be sorted according to the start time sequence of entering the idle state next time, and then the flash memory chip that first enters the idle state next time is greedily selected. The chipset including the flash memory chip is the target chipset selected for the target partition, thereby improving the mapping speed of the partition. In this way, when the target partition is the partition associated with the write request, the response speed of the write request can be improved.
[0071] Step 104: Select a target parallel block group from the multiple parallel block groups corresponding to the target chipset.
[0072] Optionally, selecting a target parallel block group from a plurality of parallel block groups corresponding to the target chipset includes:
[0073] Obtaining a first parallel block group that was mapped last time among the multiple parallel block groups corresponding to the target chipset;
[0074] According to a preset order of the plurality of parallel block groups corresponding to the target chipset, selecting the next available parallel block group of the first parallel block group as the target parallel block group;
[0075] The erasure count of the available parallel block group does not exceed a preset threshold, and all the physical blocks included in the group have been erased (ie, have been recycled).
[0076] Here, in the case where physical blocks included in the flash memory chips in the same chipset have the same offset address and form a parallel block group, the preset sorting may be sorting of multiple parallel block groups corresponding to the same chipset according to the offset address.
[0077] Physical blocks in a ZNS SSD device have a certain erase limit. After exceeding this limit, the physical block becomes unusable, meaning that the physical block has a lifespan. Therefore, to avoid capacity loss before the ZNS SSD device completely fails, the controller in the ZNS SSD device typically distributes the host's write requests as evenly as possible across all physical blocks to ensure that the lifespan of all physical blocks in the ZNS SSD device is close. This method is called load balancing.
[0078] Therefore, in the embodiment of the present application, after the target chipset is selected for the target partition in step 103, a polling method can be used to map all parallel block groups in the target chipset to ensure load balancing of the flash memory chips in the ZNS SSD device. That is, a polling pointer can be maintained for each chipset to point to the last mapped parallel block group. Then, the next available parallel block group (i.e., a parallel block group whose erase count does not exceed the limit and has been recycled) is sequentially searched from the pointer and the pointer is updated to point to the parallel block group.
[0079] It should be noted that since physical blocks need to be erased before being written, some unreclaimed parallel block groups are unavailable. Therefore, the polling pointer skips these unavailable parallel block groups and searches for the next available parallel block group. After finding the next available parallel block group, the polling pointer and the status of the parallel block group are updated.
[0080] From the above, it can be seen that in the embodiment of the present application, among the multiple parallel block groups corresponding to a chipset, the available parallel block groups are selected for the partition in a polling manner, so that the flash memory chip can be wear-balanced, thereby improving the life of the ZNS SSD device.
[0081] Step 105: Establish a mapping relationship between the target partition and the target parallel block group.
[0082] In an embodiment of the present application, each partition may store a mapping table, in which all parallel block groups mapped to the partition are recorded.
[0083] It can be seen from the above steps 101 to 105 that in an embodiment of the present application, the ZNS SSD device includes multiple flash memory chips, each flash memory chip includes multiple physical blocks, wherein these flash memory chips are divided into multiple chipsets, and the physical blocks included in the flash memory chips in each chipset are divided into multiple parallel block groups. Therefore, in an embodiment of the present application, parallel block groups are used as the basic units of partition mapping. In this way, after obtaining the target partition of the parallel block group to be mapped, the next idle time information of each flash memory chip included in the ZNSSSD device can be obtained first, and then according to the next idle time information, a target chipset is selected from the multiple chipsets, and then a target parallel block group is selected from the multiple parallel block groups corresponding to the target chipset, and then a mapping relationship between the target partition and the target parallel block group is established.
[0084] It can be seen from this that in the embodiment of the present application, dynamic mapping of partitions and parallel block groups can be achieved based on the idle time of each flash memory chip included in the ZNS SSD device, so that the mapping of partitions to parallel block groups can be dispersed. In this way, the probability of a situation where some of the flash memory chips included in the ZNS SSD device are very busy while others are idle is reduced, thereby improving the utilization rate of the flash memory chips.
[0085] Optionally, the write request includes a first starting logical address and a first logical block number; in the above sub-step H1, determining the first partition associated with the write request and determining whether the remaining physical space currently mapped to the first partition is smaller than the target space includes:
[0086] determining, according to the first starting logical address, a first partition number associated with the write request, and determining the partition indicated by the first partition number as the first partition;
[0087] According to the number of the first logical blocks, it is determined whether the remaining physical space currently mapped to the first partition is smaller than the target space.
[0088] Partitions belong to the logical address space. Therefore, each partition has a corresponding logical address. Therefore, the first starting logical address included in the write request has a partition to which it belongs. Therefore, the first starting logical address can be mapped to a partition number. The partition indicated by this number is the first partition associated with the write request.
[0089] In addition, the number of first logical blocks is used to indicate the physical space required for the data to be written by the write request, that is, the size of the above-mentioned target space can be determined based on the number of first logical blocks. Therefore, based on the number of first logical blocks, it can be determined whether the remaining physical space currently mapped by the above-mentioned first partition is smaller than the target space.
[0090] Optionally, the method further includes:
[0091] In the case of obtaining a read request, determining a second partition associated with the read request;
[0092] Determine, in the parallel block group mapped to the second partition, a second parallel block group for which the read request requests to read data;
[0093] Read corresponding data in the second parallel block group.
[0094] From this, it can be seen that when a read request is obtained, the second partition associated with the read request can be determined, and then it is determined which parallel block groups or parallel block groups mapped by the second partition need to be read by the read request, thereby realizing the read request based on the mapping relationship between the partition and the parallel block group.
[0095] Optionally, the read request includes a second starting logical address; and determining the second partition associated with the read request includes:
[0096] According to the second starting logical address, a second partition number associated with the read request is determined, and the partition indicated by the second partition number is determined to be the second partition.
[0097] Partitions belong to the logical address space. Therefore, each partition has a corresponding logical address. Therefore, the second starting logical address included in the read request has a partition to which it belongs. Therefore, the second starting logical address can be mapped to a partition number. The partition indicated by this number is the second partition associated with the read request.
[0098] Optionally, the read request includes a second starting logical address; and determining, in the parallel block group mapped to the second partition, a second parallel block group for reading data requested by the read request includes:
[0099] determining a target logical address offset within the second partition according to the second starting logical address;
[0100] Determining, according to the target logical address offset, a target index of the parallel block group requested by the read request to read data;
[0101] Searching for a target number corresponding to the target index in a pre-stored mapping table of the second partition, and determining the parallel block group indicated by the target number as the second parallel block group;
[0102] The mapping table of the second partition includes a correspondence between an index of the parallel block group mapped by the second partition and a number of the parallel block group mapped by the second partition.
[0103] In addition, partitions belong to the logical address space. Therefore, each partition has a corresponding logical address. The second starting logical address included in the read request has the partition to which it belongs. Therefore, based on the second starting logical address, it can be mapped to the number of a partition and the logical address offset within the partition. A partition has a mapping relationship with at least one parallel block group. Therefore, the logical address offset within a partition can be mapped to the index of a parallel block group. Then, in the mapping table of the partition, the number of the parallel block group corresponding to the index can be found. In this way, the parallel block group whose data is requested to be read by the read request is determined.
[0104] Optionally, the read request includes the number of second logical blocks; and reading corresponding data in the second parallel block group includes:
[0105] determining a physical page offset within the second parallel block group according to the target logical address offset;
[0106] Data in a corresponding physical page in the second parallel block is read according to the physical page offset and the number of the second logical blocks.
[0107] Here, a partition is mapped to at least one parallel block group, and a parallel block group includes multiple physical blocks. In this way, the intra-partition logical address offset of a partition can map a parallel block group associated with the partition and the physical page offset within the parallel block group. Therefore, according to the second logical address included in the above-mentioned read request (that is, the intra-partition logical address offset of the second partition), the index of the above-mentioned second parallel block group and the physical page offset within the second parallel block group can be mapped, and then according to the physical page offset and the above-mentioned second logical block number, it can be determined which physical blocks in the second parallel block group need to read data.
[0108] Optionally, the method further includes:
[0109] When a reset request for the third partition is obtained, obtaining a third parallel block group that has a mapping relationship with the third partition from a pre-stored mapping table of the third partition, wherein the mapping table of the third partition includes a correspondence between an index of the parallel block group mapped to the third partition and a number of the parallel block group mapped to the third partition;
[0110] The physical blocks included in the third parallel block group are erased, and the mapping table of the third partition is cleared.
[0111] From this, it can be seen that when a reset request (or command) for a partition is obtained, all parallel block groups mapped to the partition can be indexed according to the mapping table of the partition, and all physical blocks included in these parallel block groups can be erased, and the mapping table of the partition can be cleared, thereby responding to the reset request of the partition based on the mapping relationship between the partition and the parallel block group.
[0112] Here, it should be noted that the erased parallel block group can be used for subsequent mapping.
[0113] In summary, the specific implementation of the device control method of the embodiment of the present application can be described as follows:
[0114] like Figure 2 Figure 1 shows a schematic diagram of a storage system structure using a ZNS SSD as a storage device in an embodiment of the present application. Unlike traditional block interfaces, the ZNS interface divides the entire logical address space into multiple fixed-size zones, and stipulates that each zone can only be written sequentially and rewritten after a reset.
[0115] There are two main reasons for this regulation. On the one hand, the host can place some data with similar life cycles in the partition data in the same erase unit to achieve simultaneous failure, thereby avoiding effective data migration during garbage collection, thereby reducing garbage collection overhead and write amplification; on the other hand, sequential writing and rewriting after erasing are more in line with the hardware characteristics of flash storage media.
[0116] Furthermore, the host needs to manage all partitions and use its own application information to properly place data in partitions.
[0117] In summary, the ZNS interface transfers the responsibility of data management to the host, but hides the device-specific reliability characteristics and complexity of device management from the host, enabling it to further improve the performance of contemporary ZNS SSD devices to meet the ever-growing needs of users.
[0118] However, the partition is a logical space, and its correspondence with the physical space of the flash memory needs to be determined through mapping. The mapping of logical addresses to physical addresses is an important module in the ZNS SSD device, and its efficiency affects the performance of the entire ZNS SSD device. In the embodiment of the present application, a high-performance dynamic partition mapping method is provided, which is described in detail as follows.
[0119] First, the description of parallel block groups:
[0120] In the embodiments of the present application, the ZNS SSD device internally includes a plurality of flash memory chips, each of which includes a plurality of physical blocks, each of which includes a plurality of physical pages, and each of which includes a plurality of storage grains (such as SLC, MLC, and TLC, etc.), wherein the storage grain is the place where the ZNS SSD device actually stores data; the physical page is the smallest read-write unit of the ZNS SSD device; and the physical block is the smallest erase unit of the ZNS SSD device. Here, each storage grain stores 1 bit of data, i.e., SLC; each storage grain stores 2 bits of data, i.e., MLC; and each storage grain stores 3 bits of data, i.e., TLC.
[0121] Since sequential writing is only allowed within a partition, the write amplification overhead of rewriting the entire physical block due to a small amount of data update when block-level mapping is avoided, therefore, in the ZNS SSD, the partition generally adopts a block-level mapping mechanism to reduce the memory overhead of the mapping table, i.e., mapping the partition to a certain number of physical blocks.
[0122] Although the ZNS specification does not have specific provisions for the partition mapping mechanism, device manufacturers can choose different mapping strategies. However, since each flash memory chip in the ZNS SSD device can perform basic operations such as reading, writing, and erasing in parallel, in order to speed up the request processing rate of the partition, multiple chips will be covered during partition mapping to take advantage of the parallelism of the chips. Here, the number of chips that need to be covered for partition mapping can be referred to as the parallelism of the partition, which is defined by the device manufacturer and is guaranteed to be aligned with the total number of chips.
[0123] As Figure 3 , the organization schematic structure of the ZNS SSD device in the embodiments of the present application is shown. Among them, all flash memory chips in the ZNS SSD device can be divided into a plurality of chip groups according to the partition parallelism defined by the device manufacturer (such as Figure 3 , in which the partition parallelism = 3 and the total number of chips = 6), and all flash memory chips in each chip group can respond to the same request in parallel. Further, the physical blocks at the same offset address in all flash memory chips in the chip group can form a parallel block group, and the offset address is used as the ID of the parallel block group. Obviously, the number of physical blocks included in the parallel block group is equal to the parallelism of the partition, and each physical block comes from a different flash memory chip. Based on this, in the embodiments of the present application, the parallel block group is used as the basic unit of dynamic mapping of the partition, which at the same time guarantees the two characteristics of the above-mentioned partition mapping: block-level mapping and parallelism of the partition. In addition, because a parallel block group contains a plurality of physical blocks, the mapping based on the parallel block group further reduces the memory overhead of the mapping table compared to block-level mapping.
[0124] Second aspect: description of dynamic partition mapping:
[0125] In order to enable the ZNS SSD device to make a more reasonable mapping strategy based on its internal operating status (such as chip idle time and physical block wear) to improve performance, the embodiments of the present application adopt a dynamic partition mapping strategy. The ZNS SSD device may include a partition mapping module, and the partition mapping strategy is executed by the partition mapping module.
[0126] Among them, when the remaining physical space of a partition that has been mapped is insufficient, a new parallel block group is dynamically mapped. The specific dynamic partition mapping process is as follows Figure 4 As shown in the figure, when a partition is in the "Empty" state, no parallel block groups are mapped. The first parallel block group is mapped when the partition begins writing data. Furthermore, the next parallel block group can only be mapped after the partition has filled the physical space in the mapped parallel block groups. Furthermore, each partition has its own mapping table that records the numbers of all mapped parallel block groups.
[0127] In addition, for a partition, until the partition receives a reset command, the partition's mapping table indexes all mapped parallel block groups and erases all physical blocks in all parallel block groups. Afterwards, these parallel block groups will be recycled by the partition mapping module for the next mapping.
[0128] Specifically, when a partition receives a write request and the partition's currently mapped free physical space is insufficient (i.e., the physical space required for the data to be written is less than the partition's currently mapped free physical space), the partition can initiate a mapping request to the partition mapping module to map a parallel block group. The partition mapping module is responsible for mapping a specific parallel block group to the partition based on the free space status and physical block wear status of all flash memory chips in the ZNS SSD device.
[0129] Here, the process of partition mapping module processing mapping request is as follows Figure 5 First, the partition mapping module obtains the next idle time (chip_avail_time) of all flash chips in the ZNSSSD device, writes a request, and then traverses the next idle time of all flash chips and sorts them, greedily selecting the chipset that includes the flash chip with the smallest next idle time.
[0130] Furthermore, each physical block in a ZNS SSD device has a certain erase limit. After exceeding this limit, the physical block becomes unusable, meaning that the physical block has a lifespan. Therefore, to avoid capacity loss before the ZNS SSD device completely fails, the controller in the ZNS SSD device typically distributes the host's write requests as evenly as possible across all physical blocks to ensure that the lifespan of all physical blocks in the ZNS SSD device is close. This method can be called load balancing.
[0131] Therefore, in the embodiment of the present application, after the partition that initiates the mapping request selects a chipset, it can use a polling method to map all parallel block groups in the chipset to ensure load balancing of the flash memory chips in the ZNS SSD device. That is, the partition mapping module will maintain a polling pointer for each chipset to point to the last mapped parallel block group, and then sequentially search for the next available parallel block group (i.e., a parallel block group whose erase count does not exceed the limit and has been recycled) from this pointer and update the pointer to point to this parallel block group.
[0132] It should be noted that since physical blocks must be erased before being written, some unreclaimed parallel block groups are unavailable. Therefore, the polling pointer skips these unavailable parallel block groups and searches for the next available parallel block group. After finding the next available parallel block group, the polling pointer and the status of the parallel block group are updated, and the parallel block group number is returned to the partition that initiated the mapping request.
[0133] The third aspect: Description of the write request process:
[0134] like Figure 6 The figure shows the process of ZNS SSD device processing write requests. First, based on the starting logical address (slba) in the write request, the target partition number (zone_id) and the logical address offset within the partition (ofst_in_zone) of the request are calculated. Then, based on the number of logical blocks (nlb) in the write request, it is determined whether the remaining physical space mapped to the target partition associated with the write request is sufficient. If so, the data in the target partition is directly written sequentially to the remaining physical space mapped to the target partition. If not, the target partition will initiate a mapping request to the partition mapping module and, after receiving the parallel block group number returned by the partition mapping module, it will be filled into the mapping table of the target partition. After that, the data can be written sequentially. Finally, the status of the write request processing is returned to the host.
[0135] Fourth aspect: Description of the read request process:
[0136] like Figure 7The figure shows the flow of a read request processed by a ZNS SSD device. Similarly, first, the target partition number (zone_id) and the logical address offset within the partition (ofst_in_zone) of the request are calculated based on the starting logical address (slba) in the read request. Then, based on the logical address offset within the partition, the index of the parallel block group number in the mapping table and the offset within the group (i.e., the physical page offset) of the parallel block group number to be read by the read request are further calculated. Secondly, based on the above index, the parallel block group number corresponding to the index is obtained from the mapping table of the target partition. Thirdly, based on the offset within the group, a specific physical page is indexed in the parallel block group represented by the parallel block group number, and the data of the physical page is returned. After all the data included in the number of logical blocks (nlb) in the read request is indexed, the read request is terminated and the status of the read request is returned to the host.
[0137] In summary, the device control method of the embodiment of the present application can map a group of physical blocks that can respond in parallel and quickly to requests to the partition in real time according to the idle state of the flash memory chip during the operation of the ZNS SSD device, thereby improving the performance of the ZNS SSD device in writing data. In addition, the physical blocks in the flash memory chip are mapped by polling, thereby ensuring wear leveling in the flash memory chip to improve the life of the ZNS SSD. At the same time, a group of physical blocks at the same offset address in multiple chips constitute a parallel block group, and the offset address is recorded in the mapping table as the number of the parallel block group. Compared with recording the number of each physical block, this further reduces the overhead of the mapping table during dynamic mapping.
[0138] The above describes the control method of the ZNS SSD device provided by the embodiment of the present application. The following describes the control device of the ZNS SSD device provided by the embodiment of the present application with reference to the accompanying drawings.
[0139] In a second aspect, an embodiment of the present application further provides a control device for a ZNS SSD device, wherein the ZNS SSD device includes a plurality of flash memory chips, each of the flash memory chips includes a plurality of physical blocks, the plurality of flash memory chips are divided into a plurality of chipsets, and the physical blocks included in the flash memory chips in the same chipset are divided into a plurality of parallel block groups;
[0140] like Figure 8 As shown, the control device of the ZNS SSD device includes the following modules:
[0141] A first acquisition module 801 is used to acquire a target partition of a parallel block group to be mapped;
[0142] The second acquisition module 802 is configured to acquire the next idle time information of each flash memory chip included in the ZNS SSD device;
[0143] A first selection module 803 is configured to select a target chipset from the plurality of chipsets according to the next idle time information;
[0144] A second selection module 804 is configured to select a target parallel block group from a plurality of parallel block groups corresponding to the target chipset;
[0145] The establishing module 805 is configured to establish a mapping relationship between the target partition and the target parallel block group.
[0146] Optionally, the first selection module 803 is specifically configured to:
[0147] Determine, according to the next idle time information, a first flash memory chip among the flash memory chips included in the ZNS SSD device that will enter an idle state the earliest next time;
[0148] A chipset including the first flash memory chip is determined as the target chipset.
[0149] Optionally, the second selection module 804 is specifically configured to:
[0150] Obtaining a first parallel block group that was mapped last time among the multiple parallel block groups corresponding to the target chipset;
[0151] According to a preset order of the multiple parallel block groups corresponding to the target chipset, selecting the next available parallel block group of the first parallel block group as the target parallel block group;
[0152] The erasure count of the available parallel block group does not exceed a preset threshold, and all the included physical blocks have been erased.
[0153] Optionally, the first acquisition module is specifically configured to:
[0154] When a write request is received, determining a first partition associated with the write request, and determining whether the remaining physical space currently mapped to the first partition is smaller than a target space, wherein the target space is the physical space required for the data to be written by the write request;
[0155] In a case where the remaining physical space currently mapped to the first partition is smaller than the target space, the first partition is determined as the target partition of the parallel block group to be mapped.
[0156] Optionally, the first acquisition module is further configured to:
[0157] In a case where the remaining physical space currently mapped to the first partition is greater than or equal to the target space, the data required to be written by the write request is written into the remaining physical space currently mapped to the first partition.
[0158] Optionally, the device further includes:
[0159] A first processing module is configured to write first data among the data required to be written by the write request into the remaining physical space currently mapped to the first partition, so as to fill up the remaining physical space currently mapped to the first partition;
[0160] The second processing module is configured to write second data into the target parallel block group, wherein the second data includes data required to be written by the write request except the first data.
[0161] Optionally, the write request includes a first starting logical address and a first logical block quantity;
[0162] The first acquisition module determines the first partition associated with the write request and determines whether the remaining physical space currently mapped to the first partition is smaller than the target space, specifically for:
[0163] determining, according to the first starting logical address, a first partition number associated with the write request, and determining the partition indicated by the first partition number as the first partition;
[0164] According to the number of the first logical blocks, it is determined whether the remaining physical space currently mapped to the first partition is smaller than the target space.
[0165] Optionally, the device further includes:
[0166] A first determining module is configured to, when a read request is obtained, determine a second partition associated with the read request;
[0167] A second determining module is configured to determine, in the parallel block group mapped to the second partition, a second parallel block group for which the read request requests to read data;
[0168] The third processing module is configured to read corresponding data in the second parallel block group.
[0169] Optionally, the read request includes a second starting logical address; and the first determining module is specifically configured to:
[0170] According to the second starting logical address, a second partition number associated with the read request is determined, and the partition indicated by the second partition number is determined to be the second partition.
[0171] Optionally, the read request includes a second starting logical address; and the second determining module is specifically configured to:
[0172] determining a target logical address offset within the second partition according to the second starting logical address;
[0173] Determining, according to the target logical address offset, a target index of the parallel block group requested by the read request to read data;
[0174] Searching for a target number corresponding to the target index in a pre-stored mapping table of the second partition, and determining the parallel block group indicated by the target number as the second parallel block group;
[0175] The mapping table of the second partition includes a correspondence between an index of the parallel block group mapped by the second partition and a number of the parallel block group mapped by the second partition.
[0176] Optionally, the read request further includes the number of second logical blocks; and the third processing module is specifically configured to:
[0177] determining a physical page offset within the second parallel block group according to the target logical address offset;
[0178] Data in a corresponding physical page in the second parallel block is read according to the physical page offset and the number of the second logical blocks.
[0179] Optionally, the device further includes:
[0180] a third acquisition module, configured to, upon receiving a reset request for a third partition, acquire, from a pre-stored mapping table of the third partition, a third parallel block group that has a mapping relationship with the third partition, wherein the mapping table of the third partition includes a correspondence between an index of the parallel block group mapped to the third partition and a number of the parallel block group mapped to the third partition;
[0181] The fourth processing module is configured to erase the physical blocks included in the third parallel block group and clear the mapping table of the third partition.
[0182] Optionally, among the physical blocks included in the flash memory chips in the same chipset, the physical blocks with the same offset address form a parallel block group; the offset address corresponding to the physical blocks included in the parallel block group is the number of the parallel block group.
[0183] Among them, the method and the device are based on the same application concept. Since the principles of solving problems by the method and the device are similar, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0184] It should be noted that the division of units in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0185] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0186] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.
[0187] An embodiment of the present application further provides a ZNS SSD device, comprising a plurality of flash memory chips, each of which comprises a plurality of physical blocks, the plurality of flash memory chips being divided into a plurality of chipsets, and the physical blocks of the flash memory chips in the same chipset being divided into a plurality of parallel block groups;
[0188] The ZNS SSD device also includes a memory, a transceiver and a processor:
[0189] The memory is used to store computer programs;
[0190] The transceiver is used to send and receive data under the control of the processor;
[0191] The processor is configured to read the computer program in the memory and implement the control method of the ZNS SSD device described above.
[0192] An embodiment of the present application further provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to execute the control method of the ZNS SSD device described above.
[0193] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSDs)), etc.
[0194] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) that contain computer-usable program code.
[0195] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0196] These processor-executable instructions may also be stored in a processor-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the processor-readable memory produce an article of manufacture comprising an instruction device that implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0197] These processor-executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0198] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A control method for a ZNS SSD device, characterized in that: A partitioned namespace solid-state drive (ZNS SSD) device includes a plurality of flash memory chips, each of which includes a plurality of physical blocks. The plurality of flash memory chips are divided into a plurality of chipsets, and the physical blocks included in the flash memory chips in the same chipset are divided into a plurality of parallel block groups. The method comprises: Get the target partition of the parallel block group to be mapped; Obtaining the next idle time information of each flash memory chip included in the ZNS SSD device; selecting a target chipset from the plurality of chipsets according to the next idle time information; Selecting a target parallel block group from a plurality of parallel block groups corresponding to the target chipset; Establishing a mapping relationship between the target partition and the target parallel block group; The step of selecting a target parallel block group from a plurality of parallel block groups corresponding to the target chipset includes: Obtaining a first parallel block group that was mapped last time among the multiple parallel block groups corresponding to the target chipset; According to a preset order of the plurality of parallel block groups corresponding to the target chipset, selecting the next available parallel block group of the first parallel block group as the target parallel block group; The erasure count of the available parallel block group does not exceed a preset threshold, and all the included physical blocks have been erased.
2. The method according to claim 1, characterized in that The selecting a target chipset from the plurality of chipsets according to the next idle time information includes: Determine, according to the next idle time information, a first flash memory chip among the flash memory chips included in the ZNS SSD device that will enter an idle state the earliest next time; A chipset including the first flash memory chip is determined as the target chipset.
3. The method according to claim 1, characterized in that The step of obtaining a target partition of the parallel block group to be mapped includes: When a write request is received, determining a first partition associated with the write request, and determining whether the remaining physical space currently mapped to the first partition is smaller than a target space, wherein the target space is the physical space required for the data to be written by the write request; In a case where the remaining physical space currently mapped to the first partition is smaller than the target space, the first partition is determined as the target partition of the parallel block group to be mapped.
4. The method according to claim 3, characterized in that The method further comprises: In a case where the remaining physical space currently mapped to the first partition is greater than or equal to the target space, the data required to be written by the write request is written into the remaining physical space currently mapped to the first partition.
5. The method according to claim 3, characterized in that After establishing the mapping relationship between the target partition and the target parallel block group, the method further includes: Writing first data among the data required to be written by the write request into the remaining physical space currently mapped to the first partition, so as to fill up the remaining physical space currently mapped to the first partition; Second data is written into the target parallel block group, wherein the second data includes data required to be written by the write request except the first data.
6. The method according to claim 3, characterized in that The write request includes a first starting logical address and a first logical block quantity; The determining the first partition associated with the write request and judging whether the remaining physical space currently mapped to the first partition is smaller than the target space includes: determining, according to the first starting logical address, a first partition number associated with the write request, and determining the partition indicated by the first partition number as the first partition; According to the number of the first logical blocks, it is determined whether the remaining physical space currently mapped to the first partition is smaller than the target space.
7. The method according to claim 1, characterized in that The method further comprises: In the case of obtaining a read request, determining a second partition associated with the read request; Determine, in the parallel block group mapped to the second partition, a second parallel block group for which the read request requests to read data; Read corresponding data in the second parallel block group.
8. The method according to claim 7, characterized in that The read request includes a second starting logical address; The determining the second partition associated with the read request includes: According to the second starting logical address, a second partition number associated with the read request is determined, and the partition indicated by the second partition number is determined to be the second partition.
9. The method according to claim 7, characterized in that The read request includes a second starting logical address; The step of determining, in the parallel block group mapped to the second partition, a second parallel block group for which the read request requests to read data, comprises: determining a target logical address offset within the second partition according to the second starting logical address; Determining, according to the target logical address offset, a target index of the parallel block group requested by the read request to read data; Searching for a target number corresponding to the target index in a pre-stored mapping table of the second partition, and determining the parallel block group indicated by the target number as the second parallel block group; The mapping table of the second partition includes a correspondence between an index of the parallel block group mapped by the second partition and a number of the parallel block group mapped by the second partition.
10. The method according to claim 9, characterized in that The read request also includes the number of the second logical blocks; and the reading of the corresponding data in the second parallel block group includes: determining a physical page offset within the second parallel block group according to the target logical address offset; Data in a corresponding physical page in the second parallel block is read according to the physical page offset and the number of the second logical blocks.
11. The method according to claim 1, wherein The method further comprises: When a reset request for the third partition is obtained, obtaining a third parallel block group that has a mapping relationship with the third partition from a pre-stored mapping table of the third partition, wherein the mapping table of the third partition includes a correspondence between an index of the parallel block group mapped to the third partition and a number of the parallel block group mapped to the third partition; The physical blocks included in the third parallel block group are erased, and the mapping table of the third partition is cleared.
12. The method according to any one of claims 1 to 11, characterized in that Among the physical blocks included in the flash memory chips in the same chipset, the physical blocks with the same offset address form a parallel block group; the offset address corresponding to the physical blocks included in the parallel block group is the number of the parallel block group.
13. A control device for a ZNS SSD device, characterized in that: A partitioned namespace solid-state drive (ZNS SSD) device includes a plurality of flash memory chips, each of which includes a plurality of physical blocks. The plurality of flash memory chips are divided into a plurality of chipsets, and the physical blocks included in the flash memory chips in the same chipset are divided into a plurality of parallel block groups. The device comprises: A first acquisition module is used to acquire a target partition of the parallel block group to be mapped; A second acquisition module is used to obtain the next idle time information of each flash memory chip included in the ZNS SSD device; A first selection module is configured to select a target chipset from the plurality of chipsets according to the next idle time information; A second selection module is configured to select a target parallel block group from a plurality of parallel block groups corresponding to the target chipset; An establishing module, configured to establish a mapping relationship between the target partition and the target parallel block group; Wherein, the second selection module is specifically used for: Obtaining a first parallel block group that was mapped last time among the multiple parallel block groups corresponding to the target chipset; According to a preset order of the plurality of parallel block groups corresponding to the target chipset, selecting the next available parallel block group of the first parallel block group as the target parallel block group; The erasure count of the available parallel block group does not exceed a preset threshold, and all the included physical blocks have been erased.
14. A ZNS SSD device, characterized in that: A partitioned namespace solid-state drive (ZNS SSD) device includes a plurality of flash memory chips, each of which includes a plurality of physical blocks. The plurality of flash memory chips are divided into a plurality of chipsets, and the physical blocks included in the flash memory chips in the same chipset are divided into a plurality of parallel block groups. The ZNS SSD device also includes a memory, a transceiver and a processor: The memory is used to store computer programs; The transceiver is used to send and receive data under the control of the processor; The processor is configured to read the computer program in the memory and execute the control method of the ZNS SSD device according to any one of claims 1 to 12.
15. A processor-readable storage medium, characterized in that: The processor-readable storage medium stores a computer program, and the computer program is configured to enable the processor to execute the control method of the ZNS SSD device according to any one of claims 1 to 12.
Citation Information
Patent Citations
Resource allocation method based on ZNS SSD system
CN115145493A