Solid state storage device and method of writing / reading data
Patent Information
- Application Number
- CN202210990404.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2042-08-18
AI Technical Summary
同样,32TB的SSD与16TB的SSD相比,物理块的数量也翻了一倍,如果仅简单的将32位物理地址也扩充至64位物理地址,会大大增加FTL表的大小(增加至4倍),从而增加所需DRAM的空间,提高成本
[0025] Compared to the aforementioned background technology, the solid-state storage device and the method for writing/reading data provided by the present invention can limit the exponential increase of the FTL table of large-capacity storage devices, thereby shortening the recovery time of large-capacity storage devices in the event of abnormal power loss.
Smart Images

Figure CN115328819B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of solid-state storage devices, and more particularly to a solid-state storage device and a method for writing / reading data. Background Technology
[0002] With the advancement of technology, increasingly higher demands are being placed on the storage capacity and response speed of electronic devices. Figure 1 A block diagram of an SSD (Solid Storage Device) in the prior art is shown.
[0003] Solid-state storage device 102 is coupled to a host computer to provide storage capabilities. The host computer and solid-state storage device 102 can be coupled in various ways, including but not limited to connections via SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIe (Peripheral Component Interconnect Express), NVMe (NVM Express), Ethernet, Fibre Channel, and wireless communication networks. The host computer can be an information processing device capable of communicating with the storage device via the above methods, such as a personal computer, tablet computer, server, laptop computer, network switch, router, cellular phone, or personal digital assistant. Storage device 102 includes an interface 103, a control unit 104, one or more NVM (Non-Volatile Memory) chips 105, and DRAM (Dynamic Random Access Memory) 110. NAND flash memory, phase-change memory, FeRAM, MRAM, etc., are common types of NVM. Interface 103 is adaptable to exchange data with the host via, for example, SATA, IDE, USB, PCIe, NVMe, SAS, Ethernet, Fibre Channel, etc. Control unit 104 is used to control data transfer between interface 103, NVM chip 105, and firmware memory 110, and is also used for storage management, host logical address to flash physical address mapping, erase leveling, bad block management, etc. Control unit 104 can be implemented through software, hardware, firmware, or a combination thereof. Control unit 104 can be in the form of an FPGA (Field-programmable gate array), ASIC (Application Specific Integrated Circuit), or a combination thereof. The control unit 104 may also include a processor or controller, in which software is executed to manipulate the hardware of the control unit 104 to process host I / O commands. The control unit 104 is also coupled to the DRAM 110 and can access the data in the DRAM 110.Data for host I / O commands can be stored in DRAM, including FTL tables and / or cached data.
[0004] The control unit 104 includes a flash interface controller (or flash channel controller). The flash interface controller is coupled to the NVM chip 105 and issues commands to the NVM chip 105 in accordance with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives the command execution results output from the NVM chip 105. The interface protocol of the NVM chip 105 includes well-known interface protocols or standards such as "Toggle" and "ONFI".
[0005] A memory target is one or more logic units (LUNs) within a NAND flash memory package that share a chip enable (CE) signal. Each logic unit has a logic unit number. A NAND flash memory package may include one or more dies. Typically, a logic unit corresponds to a single die. A logic unit may include multiple planes. Multiple planes within a logic unit can be accessed in parallel, while multiple logic units within a NAND flash memory chip can execute commands and report status independently of each other.
[0006] Solid-state storage devices comprise multiple NVM chips. Each NVM chip includes one or more physical dies (DIEs) or logic units (LUNs). Read and write operations can be performed in parallel between dies or logic units. Multiple read, write, or erase operations on the same die or logic unit are executed sequentially.
[0007] Data is typically stored and retrieved in pages on storage media, while data is erased in blocks. A block contains multiple pages. A page on a storage medium (called a physical page) has a fixed size, such as 17664 bytes. Physical pages can also have other sizes. A physical page can contain multiple data frames, which have a specified size, such as 4096 or 4416 bytes.
[0008] SSD firmware uses the FTL (Flash Translation Layer) to maintain the mapping between logical addresses (LBA, 32-bit) and physical addresses (PBA, 32-bit) during runtime. Logical addresses constitute the storage space of the solid-state storage device as perceived by upper-layer software such as the operating system, while physical addresses are used to access the physical storage units of the solid-state storage device. This FTL mapping table is stored in the SSD's DRAM. Since DRAM is volatile, the mapping table is lost after power loss. Therefore, the firmware needs to restore this mapping table after power is restored to ensure that original user data is not lost. In the event of an unexpected power outage, the power management unit 120 manages the backup power supply 125 to provide temporary power to the storage device for backing up metadata and processing unfinished commands. The backup power supply 125 includes supercapacitors, aluminum capacitors, tantalum polymer capacitors, and lithium batteries.
[0009] In existing technologies, the logical address corresponding to each physical page of a solid-state storage device is additionally stored within that physical page. When the solid-state storage device boots up, all physical pages need to be accessed to obtain the logical address corresponding to each physical page, and the FTL table needs to be rebuilt in DRAM.
[0010] SSDs use flash memory as their storage medium, and with the development of 3D stacking technology, flash memory capacity density is constantly increasing. For example, SSDs based on 176-layer flash memory stacking technology can achieve a capacity of 32TB or even larger on a single drive. The size of the FTL table is directly proportional to the capacity of the SSD. Therefore, while large-capacity SSDs have a certain advantage, the FTL table also becomes larger. For example, a 32TB SSD corresponds to an FTL table size of approximately 32GB.
[0011] The logical address (LBA) and physical address (PBA) are both 32 bits, dividing the FTL table into 64 parts (64 data streams). When a new write command occurs at the corresponding logical address of a data stream, the firmware records a log. Each data stream has its own independent update log. When restoring the mapping table, the firmware can utilize multiple CPUs to operate concurrently, restoring each data stream in a patching manner according to the order of log entries.
[0012] As SSD capacity increases, the number of logical and physical addresses that need to be managed also increases. Taking a 32TB SSD as an example, the logical addresses managed internally by the firmware are in 4KB units, meaning each logical address within the firmware manages one 4KB piece of data. A 32-bit logical address can manage a maximum of [number missing]. For managing 32TB of data, a 32-bit logical address is insufficient; it needs to be expanded to a 64-bit logical address. Similarly, compared to a 16TB SSD, a 32TB SSD doubles the number of physical blocks. Simply expanding the physical address from 32-bit to 64-bit would significantly increase the FTL table size (by a factor of four), thus increasing the required DRAM space and raising costs. Furthermore, the increased FTL table size leads to larger data streams and more unique update logs for each stream, significantly increasing data stream recovery time and impacting the overall SSD power-on recovery time.
[0013] Therefore, how to shorten the recovery time of abnormal power loss of large-capacity storage devices is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0014] This application provides a solid-state storage device and a method for writing / reading data, which can limit the exponential growth of the FTL table of a large-capacity storage device, thereby shortening the recovery time of the large-capacity storage device in the event of an abnormal power outage.
[0015] To solve the above-mentioned technical problems, this application provides the following technical solution: A solid-state storage device includes: a logical address space and a physical address space; the logical address space is divided into several logical blocks according to a predetermined size, and all logical blocks are divided into different logical partitions according to a predetermined rule; multiple physical DIEs of the physical address space are merged into one physical partition, and one physical partition is mapped to one LUN; the LUN index corresponding to the physical address space is determined by the logical partition index and the physical partition index, the logical partition index is determined by the logical address of the logical address space, and the physical partition index is determined by the physical DIE of the physical address space.
[0016] In the solid-state storage device described above, preferably, each logical partition is managed by an independent CPU.
[0017] In the solid-state storage device described above, preferably, the logical partition index is used as the most significant bit of the physical address, and the physical partition LUN index is used as the second most significant bit of the physical address; the calculated LUN index covers the physical partition index in the physical address, and the bits occupied by the logical partition index in the physical address are set as invalid bits of the physical address.
[0018] In the solid-state storage device described above, preferably, bits 0-22 of the physical address PBA of the 16TB SSD record the block × page, bits 23-25 of the physical address PBA of the 16TB SSD record the data frame index, and bits 26-31 of the physical address PBA of the 16TB SSD record the LUN index.
[0019] In the solid-state storage device described above, preferably, bits 0-22 of the physical address PBA of the 32TB SSD record the block × page, bits 23-26 of the physical address PBA of the 32TB SSD record the data frame index, and bits 27-31 of the physical address PBA of the 32TB SSD record the LUN index.
[0020] The solid-state storage device described above preferably further includes an FTL table; the FTL table is divided into multiple data stream concurrent units, each containing multiple data streams, and all data streams in a data stream concurrent unit are processed on a single CPU; wherein the number of data stream concurrent units is proportional to the capacity of the solid-state storage device.
[0021] A method for writing data includes the following steps: in response to receiving a write command, allocating physical space for storing the data indicated by the write command based on the logical address indicated by the write command; obtaining the logical partition to which the logical address belongs based on the logical address indicated by the write command; obtaining a LUN index based on the logical partition index and the physical partition index to which the physical space storing the data indicated by the write command belongs; recording the LUN index, data frame index, and block / page records in the physical address; recording the mapping relationship between the logical address and the physical address in the FTL table to update the FTL table; and completing the write command in response to the completion of writing data to the allocated physical space.
[0022] The data writing method described above preferably further includes: dividing the FTL table into multiple data stream concurrent units, each data stream concurrent unit containing multiple data streams, and all data streams in a data stream concurrent unit being processed on a CPU; wherein the number of data stream concurrent units is proportional to the capacity of the solid-state storage device.
[0023] A method for reading data includes the following steps: in response to receiving a read command, querying the FTL table to obtain the physical address based on the logical address indicated by the read command, wherein the physical address records a LUN index, a data frame index, and a block × page; obtaining the logical partition to which the logical address belongs based on the logical address indicated by the read command; obtaining the physical partition index based on the logical partition index and the LUN index; and reading the data indicated by the read command from the physical partition indicated by the physical partition index based on the block × page and the data frame index.
[0024] The method for reading data as described above preferably further includes: dividing the FTL table into multiple concurrent data stream units, each containing multiple data streams, and all data streams in a concurrent data stream unit being processed on a single CPU; wherein the number of concurrent data stream units is proportional to the capacity of the solid-state storage device.
[0025] Compared to the aforementioned background technology, the solid-state storage device and the method for writing / reading data provided by the present invention can limit the exponential increase of the FTL table of large-capacity storage devices, thereby shortening the recovery time of large-capacity storage devices in the event of abnormal power loss. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0027] Figure 1 A block diagram of a solid-state storage device in the prior art is shown; Figure 2 A schematic diagram of the logical address format of a solid-state storage device in a related embodiment is shown; Figure 3 A schematic diagram of the physical address format of a solid-state storage device in a related embodiment is shown; Figure 4 This is a schematic diagram of the logical address format of the solid-state storage device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the physical address format of the solid-state storage device provided in the embodiments of this application; Figure 6 This is a flowchart of the data writing method provided in the embodiments of this application; Figure 7 This is a flowchart of a data reading method provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating the division of data flow for the FTL table provided in an embodiment of this application; Figure 9A This is a schematic diagram illustrating the concurrent processing of 64 data streams by the CPU according to an embodiment of this application; Figure 9B This is a schematic diagram of CPU concurrently processing 128 data streams provided in an embodiment of this application. Detailed Implementation
[0028] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0029] The logical address (LBA) managed internally by the firmware is in 4K units, meaning that each internal logical address (LBA) manages one 4K data unit. The physical address (PBA) corresponding to the logical address (LBA) is also represented in 32-bit format. If implemented according to the traditional FTL table mapping, the physical address (PBA) of large-capacity SSDs (e.g., 16TB, 32TB SSDs) and small-capacity SSDs (e.g., 8TB SSDs) have the same format.
[0030] Please see Figure 2 , Figure 2 A schematic diagram of the logical address format of a solid-state storage device in a related embodiment is shown.
[0031] An 8TB SSD has a logical address space (LBA) consisting of n logical blocks: LBA0, LBA1, LBA2, LBA3, ..., LBAn. Similarly, the logical address space (LBA) of 16TB and 32TB SSDs is also the same as that of the 8TB SSD.
[0032] Please see Figure 3 , Figure 3 A schematic diagram illustrating the physical address format of several capacity solid-state storage devices in related embodiments is shown.
[0033] In an 8TB SSD, bits 0-20 of the Physical Address Base (PBA) record the block-to-page ratio, bits 21-24 record the data frame index, and bits 25-31 record the LUN index. "Block-to-page" refers to storage space organized in units of blocks and pages; specifically, data read / write operations are performed in units of pages, while data erasure operations are performed in units of blocks (composed of multiple pages).
[0034] Bits 0-21 of the Physical Address Base (PBA) of a 16TB SSD record the block x page, bits 22-25 of the PBA record the data frame index, and bits 26-31 of the PBA record the LUN index.
[0035] Bits 0-22 of the physical address PBA of a 32TB SSD record the block x page, bits 23-26 of the physical address PBA of a 32TB SSD record the data frame index, and bits 27-31 of the physical address PBA of a 32TB SSD record the LUN index.
[0036] Due to power consumption limitations, the maximum number of LUNs that can be operated concurrently on an SSD is 128 (32-bit representation, 2 to the power of 7 = 128). An 8TB SSD also has 128 physical dies, so the maximum number of LUNs that can be operated concurrently is the same as the number of physical dies, which meets the mapping requirements. However, a 16TB SSD has 256 physical dies, and a 32TB SSD has 512 physical dies. The maximum number of LUNs that can be operated concurrently is different from the number of physical dies; the number of physical dies exceeds the maximum number of LUNs that can be operated concurrently.
[0037] To avoid significant increases in the FTL table size of large-capacity SSDs (e.g., 16TB, 32TB), the logical address (LBA) and physical address (PBA) of large-capacity SSDs are kept at the same bit length (e.g., 32 bits), and the maximum number of LUNs that can be operated concurrently on a large-capacity SSD is kept the same as the number of physical DIEs. Please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of the logical address format of the solid-state storage device provided in the embodiments of this application.
[0038] The Logical Address Space (LBA) is a contiguous address space. Firmware divides the LBA into several regions of equal size according to a predetermined size; each region is called a logical block. As an example, the logical address space is divided into n parts of 512KB each, forming n logical blocks of the same size. For example, logical blocks LBA0, ..., LBAn.
[0039] According to a predetermined pattern, several logical blocks are divided into different logical partitions. For example, every 32 logical blocks are divided into one logical partition. As an example, logical blocks LBA0, ..., LBA31 are divided into logical partition 0; logical blocks LBA32, ..., LBA63 are divided into logical partition 1; logical blocks LBA64, ..., LBA95 are divided into logical partition 2; logical blocks LBA96, ..., LBA127 are divided into logical partition 3, ..., and so on, until logical block LBAn is divided into the last logical partition N. As another example, in a 16TB SSD, LBA 0-127 is divided into logical partition 0, LBA 128-255 into logical partition 1, LBA 256-383 into logical partition 0, LBA 384-511 into logical partition 1, and LBA 512-639 into logical partition 0; in a 32TB SSD, LBA 0-127 is divided into logical partition 0, LBA 128-255 into logical partition 1, LBA 256-383 into logical partition 2, LBA 384-511 into logical partition 3, and LBA 512-639 into logical partition 0.
[0040] Each logical partition is managed by an independent CPU, meaning that all logical partitions can operate concurrently. As an example, CPU0 manages logical partition 0, CPU1 manages logical partition 1, CPU2 manages logical partition 2, CPU3 manages logical partition 3, ..., CPUm manages logical partition N.
[0041] Please see Figure 5 , Figure 5 This is a schematic diagram of the physical address format of the solid-state storage device provided in the embodiments of this application.
[0042] In order to limit the physical address (PBA) of a large-capacity SSD to a predetermined number of bits (e.g., 32 bits), the number of bits occupied by the LUN index in the physical address PBA needs to be reduced accordingly, and the LUN index in the physical address PBA also needs to reflect the physical partition.
[0043] The logical partition index is calculated using the logical address LBA. For example, logical partition index 0 is obtained from logical address LBA30, 1 from logical address LBA60, and 3 from logical address LBA90. The LUN index of the final record in the physical address is then calculated using the logical partition index and the physical partition index. As an example, the logical partition index is used as the most significant bit (MSB) of the physical address, and the physical partition index is used as the second most significant bit. The LUN index is then calculated using both the logical and physical partition indices, and the calculated LUN index overwrites the physical partition index in the physical address. The bits occupied by the logical partition index in the physical address are set to invalid bits, thus allowing 32-bit control of the physical address. As another example, the LUN index (e.g., 0-127) = logical partition index. The maximum number of LUNs that can be operated on concurrently (e.g., 64 or 32) plus the physical partition index. By using the above method, the physical address can still be kept at 32 bits, thus controlling the FTL table to only increase with the increase of logical space, avoiding the FTL table from increasing due to the increase of physical space, which to a certain extent limits the increase of the FTL table of large-capacity SSDs.
[0044] By merging multiple physical DIEs of a large-capacity SSD into a single physical partition, and mapping each physical partition to a single LUN, a larger number of physical DIEs can be associated with a single LUN. This increases the number of blocks within each LUN while keeping the total number of LUNs constant, thus satisfying the firmware's maximum LUN limit. Furthermore, with the increased number of blocks within each LUN, the number of bits occupied by the block x page portion of the physical address also increases. Therefore, it is necessary to reduce the number of bits occupied by other parts of the physical address.
[0045] As an example, bits 0-22 of the Physical Address Base (PBA) of a 16TB SSD record the block x page, bits 23-25 record the data frame index, and bits 26-31 record the LUN index. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 26-31, and the logical partition index is temporarily recorded in bits 32. The LUN index is obtained by temporarily recording the physical partition index in bits 26-31 and the logical partition index in bits 32, and is finally recorded in bits 26-31, thus keeping the physical address PBA of the 16TB SSD at 32 bits.
[0046] As another example, bits 0-22 of the physical address PBA of a 32TB SSD record the block x page, bits 23-26 of the physical address PBA of a 32TB SSD record the data frame index, and bits 27-31 of the physical address PBA of a 32TB SSD record the LUN index. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 27-31, and the logical partition index is temporarily recorded in bits 31-33. The LUN index obtained by the physical partition index temporarily recorded in bits 27-31 and the logical partition index temporarily recorded in bits 31-33 is finally recorded in bits 27-31, so that the physical address PBA of the formed 32TB SSD remains 32 bits.
[0047] This application simplifies the physical address length for large-capacity SSDs by adding logical and physical partitions. As SSD capacity increases, the physical address length remains the same, allowing the FTL table to grow only with increasing logical addresses. This limits the growth of the FTL table in large-capacity SSDs, preventing increased DRAM space requirements and reducing costs. Furthermore, because this application limits the FTL table growth, it avoids increasing the size of each data stream and the associated update logs during firmware recovery, significantly shortening recovery time after abnormal power loss.
[0048] Please see Figure 6 , Figure 6 This is a flowchart of the method for writing data provided in the embodiments of this application.
[0049] This application provides a method for writing data, including the following steps: Step S610: In response to receiving a write command, allocate physical space to store the data indicated by the write command according to the logical address indicated by the write command.
[0050] The storage device's firmware obtains a write command from the host, which specifies the logical address and the data to be written. Furthermore, the storage device's firmware allocates physical space for the data to be written according to the logical address, and writes the data to that physical space to store the data.
[0051] Step S620: Based on the logical address indicated by the write command, obtain the logical partition to which the logical address belongs.
[0052] The Logical Address Space (LBA) is a contiguous address space. Firmware divides the LBA into several regions of equal size according to a predetermined size; each region is called a logical block. As an example, the logical address space is divided into n parts of 512KB each, forming n logical blocks of the same size. For example, logical blocks LBA0, ..., LBAn.
[0053] According to a predetermined pattern, several logical blocks are divided into different logical partitions. For example, every 32 logical blocks are divided into one logical partition. As an example, logical blocks LBA0, ..., LBA31 are divided into logical partition 0; logical blocks LBA32, ..., LBA63 are divided into logical partition 1; logical blocks LBA64, ..., LBA95 are divided into logical partition 2; logical blocks LBA96, ..., LBA127 are divided into logical partition 3, ..., until logical block LBAn is divided into the last logical partition N. As another example, in a 16TB SSD, LBA 0-127 is divided into logical partition 0, which can be simplified as LBA 0-127: logical partition 0. Similarly, LBA 128-255: logical partition 1, LBA 256-383: logical partition 0, LBA 384-511: logical partition 1, and LBA 512-639: logical partition 0. In a 32TB SSD, LBA 0-127: logical partition 0, LBA 128-255: logical partition 1, LBA 256-383: logical partition 2, LBA 384-511: logical partition 3, and LBA 512-639: logical partition 0.
[0054] After receiving the write command from the host, the firmware of the storage device also obtains the logical partition to which the logical address belongs based on a predetermined rule.
[0055] Step S630: Obtain the LUN index based on the logical partition index and the physical partition index of the physical space to which the data indicated by the write command belongs.
[0056] One or more physical DIEs of a large-capacity storage device are merged into a physical partition. Each physical partition is mapped to a LUN, which results in a larger number of physical DIEs corresponding to a LUN. Consequently, while the number of LUNs remains the same, the number of blocks contained in each LUN increases, thus satisfying the firmware's maximum number of LUNs limit.
[0057] The firmware of the storage device allocates physical space for storing the data indicated by the write command based on the logical address specified by the write command. Since this application merges one or more physical DIEs of the storage device into a single physical partition, and each physical partition corresponds to a LUN, the physical space allocated according to the write command must belong to a specific physical partition and correspond to a specific LUN. A specific LUN must belong to a specific logical partition. Therefore, this application records the LUN index in the physical address PBA of the allocated physical space. The LUN index is obtained through the physical partition index and the logical partition index.
[0058] Step S640: Record the LUN index, data frame index, and block × page records in the physical address.
[0059] As an example, bits 0-22 of the Physical Address Base (PBA) of a 16 TB SSD record the block x page, bits 23-25 record the data frame index, and bits 26-31 record the LUN index. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 26-31, and the logical partition index is temporarily recorded in bits 32. The LUN index obtained by the physical partition index temporarily recorded in bits 26-31 and the logical partition index temporarily recorded in bits 32 is finally recorded in bits 26-31, thus keeping the physical address PBA of the 16 TB SSD at 32 bits.
[0060] As another example, bits 0-22 of the physical address PBA of a 32 TB SSD record blocks and pages, bits 23-26 of the physical address PBA of a 32 TB SSD record data frame indexes, and bits 27-31 of the physical address PBA of a 32 TB SSD record LUN indexes. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 27-31, and the logical partition index is temporarily recorded in bits 31-33. The LUN index obtained through the physical partition index temporarily recorded in bits 27-31 and the logical partition index temporarily recorded in bits 31-33 is finally recorded in bits 27-31, thus keeping the physical address PBA of the 32 TB SSD at 32 bits.
[0061] Step S650: Record the mapping relationship between logical address and physical address in the FTL table to update the FTL table.
[0062] The logical address indicated by the write command and the physical address of the physical space allocated based on the logical address are recorded in the FTL table. The physical address records the LUN index, data frame index, and block / page physical address. After the logical address indicated by the write command and the physical address of the allocated physical space are recorded in the FTL table, the FTL table is updated.
[0063] Step S660: In response to the completion of writing data to the allocated physical space, the write command is completed.
[0064] After storing the data indicated by the write command into the allocated physical space and recording the mapping relationship between logical addresses and physical addresses in the FTL table, the storage device firmware sends a message to the host indicating that the write command is complete.
[0065] Please see Figure 7 , Figure 7 This is a flowchart of a data reading method provided in an embodiment of this application.
[0066] This application provides a method for reading data, including the following steps: Step S710: In response to receiving a read command, query the FTL table to obtain the physical address based on the logical address indicated by the read command. The physical address records the LUN index, data frame index, and block / page.
[0067] The storage device's firmware obtains a read command from the host, which specifies the logical address and the data to be read. Furthermore, since the FTL table records the mapping between logical and physical addresses, the storage device's firmware also queries the FTL table based on the logical address to obtain the physical address of the data to be read. This physical address contains the LUN index, data frame index, and block / page information.
[0068] As an example, bits 0-22 of the Physical Address Base (PBA) of a 16 TB SSD record the block x page, bits 23-25 record the data frame index, and bits 26-31 record the LUN index. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 26-31, and the logical partition index is temporarily recorded in bits 32. The LUN index obtained by the physical partition index temporarily recorded in bits 26-31 and the logical partition index temporarily recorded in bits 32 is finally recorded in bits 26-31, thus keeping the physical address PBA of the 16 TB SSD at 32 bits.
[0069] As another example, bits 0-22 of the physical address PBA of a 32 TB SSD record blocks and pages, bits 23-26 of the physical address PBA of a 32 TB SSD record data frame indexes, and bits 27-31 of the physical address PBA of a 32 TB SSD record LUN indexes. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 27-31, and the logical partition index is temporarily recorded in bits 31-33. The LUN index obtained through the physical partition index temporarily recorded in bits 27-31 and the logical partition index temporarily recorded in bits 31-33 is finally recorded in bits 27-31, thus keeping the physical address PBA of the 32 TB SSD at 32 bits.
[0070] Step S720: Based on the logical address indicated by the read command, obtain the logical partition to which the logical address belongs.
[0071] The Logical Address Space (LBA) is a contiguous address space. Firmware divides the LBA into several regions of equal size according to a predetermined size; each region is called a logical block. As an example, the logical address space is divided into n parts of 512KB each, forming n logical blocks of the same size. For example, logical blocks LBA0, ..., LBAn.
[0072] According to a predetermined pattern, several logical blocks are divided into different logical partitions. For example, every 32 logical blocks are divided into one logical partition. As an example, logical blocks LBA0, ..., LBA31 are divided into logical partition 0; logical blocks LBA32, ..., LBA63 are divided into logical partition 1; logical blocks LBA64, ..., LBA95 are divided into logical partition 2; logical blocks LBA96, ..., LBA127 are divided into logical partition 3, ..., and so on, until logical block LBAn is divided into the last logical partition N. As another example, in a 16TB SSD, LBA 0-127 is divided into logical partition 0, LBA 128-255 into logical partition 1, LBA 256-383 into logical partition 0, LBA 384-511 into logical partition 1, and LBA 512-639 into logical partition 0; in a 32TB SSD, LBA 0-127 is divided into logical partition 0, LBA 128-255 into logical partition 1, LBA 256-383 into logical partition 2, LBA 384-511 into logical partition 3, and LBA 512-639 into logical partition 0.
[0073] After receiving the read command from the host, the firmware of the storage device also obtains the logical partition to which the logical address belongs based on a predetermined rule.
[0074] Step S730: Obtain the physical partition index based on the logical partition index and the LUN index.
[0075] Since LUN indexes are derived from physical partition indexes and logical partition indexes, physical partition indexes are obtained based on logical partition indexes and LUN indexes. A physical partition is formed by merging one or more physical partitions (DIEs) from a large-capacity storage device.
[0076] Since one LUN in this application is mapped to one physical partition, the number of physical DIEs corresponding to one LUN is large. As a result, the number of blocks contained in each LUN increases while the number of LUNs remains the same, thus satisfying the firmware's maximum number of LUNs limit.
[0077] Step S740: In the physical partition indicated by the physical partition index, read the data indicated by the read command based on the block × page and data frame index.
[0078] After obtaining the physical partition index, block / page index, and data frame index, the storage device firmware locates the corresponding physical partition, finds the corresponding block / page within that physical partition, and then finds the corresponding data frame within that block / page. Finally, it provides the found data frame as the data to be read to the host, thereby completing the read command.
[0079] This application provides a solid-state storage device, including: a logical address space and a physical address space.
[0080] Its logical address space is divided into several logical blocks according to a predetermined size. All logical blocks are divided into different logical partitions according to a predetermined rule. The logical partition index is determined by the logical address of the logical address space.
[0081] The Logical Address Space (LBA) is a contiguous address space. Firmware divides the LBA into several regions of equal size according to a predetermined size; each region is called a logical block. As an example, the logical address space is divided into n parts of 512KB each, forming n logical blocks of the same size. For example, logical blocks LBA0, ..., LBAn.
[0082] According to a predetermined pattern, several logical blocks are divided into different logical partitions. For example, every 32 logical blocks are divided into one logical partition. As an example, logical blocks LBA0, ..., LBA31 are divided into logical partition 0; logical blocks LBA32, ..., LBA63 are divided into logical partition 1; logical blocks LBA64, ..., LBA95 are divided into logical partition 2; logical blocks LBA96, ..., LBA127 are divided into logical partition 3, ..., and so on, until logical block LBAn is divided into the last logical partition N.
[0083] As another example, in a 16TB SSD, LBA 0-127 is divided into logical partition 0, LBA 128-255 into logical partition 1, LBA 256-383 into logical partition 0, LBA 384-511 into logical partition 1, and LBA 512-639 into logical partition 0; in a 32TB SSD, LBA 0-127 is divided into logical partition 0, LBA 128-255 into logical partition 1, LBA 256-383 into logical partition 2, LBA 384-511 into logical partition 3, and LBA 512-639 into logical partition 0.
[0084] The logical partition index is calculated using the logical address LBA. For example, the logical partition index is 0 based on logical address LBA30, 1 based on logical address LBA60, and 3 based on logical address LBA90.
[0085] Each logical partition is managed by an independent CPU, meaning that all logical partitions can operate concurrently. As an example, CPU0 manages logical partition 0, CPU1 manages logical partition 1, CPU2 manages logical partition 2, CPU3 manages logical partition 3, ..., CPUm manages logical partition N.
[0086] Multiple physical DIEs in the physical address space are merged into a single physical partition, and each physical partition is mapped to a single LUN. The physical partition index is determined by the physical DIEs in the physical address space; that is, the physical partition index is determined by the indices of all physical DIEs within that physical partition. The LUN index corresponding to the physical address space is determined by both the logical partition index and the physical partition index.
[0087] Optionally, the logical partition index is used as the most significant bit (MSB) of the physical address, and the physical partition index is used as the second most significant bit. Then, a LUN index is calculated using the logical and physical partition indices. The calculated LUN index overwrites the physical partition index in the physical address, and the bits occupied by the logical partition index in the physical address are set to invalid bits. This allows for 32-bit control of the physical address. As another example, the LUN index (e.g., 0-127) = logical partition index. Maximum number of LUNs that can be operated on concurrently (e.g., 64 or 32) + physical partition indexes.
[0088] As an example, bits 0-22 of the Physical Address Base (PBA) of a 16TB SSD record the block x page, bits 23-25 record the data frame index, and bits 26-31 record the LUN index. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 26-31, and the logical partition index is temporarily recorded in bits 32. The LUN index is obtained by temporarily recording the physical partition index in bits 26-31 and the logical partition index in bits 32, and is finally recorded in bits 26-31, thus keeping the physical address PBA of the 16TB SSD at 32 bits.
[0089] As another example, bits 0-22 of the physical address PBA of a 32TB SSD record the block x page, bits 23-26 of the physical address PBA of a 32TB SSD record the data frame index, and bits 27-31 of the physical address PBA of a 32TB SSD record the LUN index. The LUN index is obtained through the physical partition index and the logical partition index. The physical partition index is temporarily recorded in bits 27-31, and the logical partition index is temporarily recorded in bits 31-33. The LUN index obtained by the physical partition index temporarily recorded in bits 27-31 and the logical partition index temporarily recorded in bits 31-33 is finally recorded in bits 27-31, so that the physical address PBA of the formed 32TB SSD remains 32 bits.
[0090] The aforementioned logical and physical addresses are recorded in the FTL table. The physical address table records the LUN index, data frame index, and block / page physical addresses. The FTL table in this application is further divided into multiple concurrent data stream units. The number of concurrent data stream units is proportional to the capacity of the solid-state storage device. Each concurrent data stream unit contains multiple data streams, and all data streams within a single concurrent data stream unit are processed on one CPU. This ensures that the log data processed on each CPU of the solid-state storage device provided in this application is more evenly distributed, resulting in a shorter overall SSD power-on recovery time.
[0091] Please see Figure 8 , Figure 8 This is a schematic diagram of the data flow division for the FTL table provided in an embodiment of this application.
[0092] The FTL table is divided into multiple concurrent data stream units, each containing multiple data streams. All data streams within a single concurrent data stream unit are processed on a single CPU. The number of concurrent data stream units is directly proportional to the SSD's capacity; a larger SSD capacity results in a larger number of concurrent data stream units in the FTL table, and vice versa.
[0093] As an example, the FTL table of a 16TB SSD can be divided into 64 parts (64 concurrent data stream units), such as: concurrent data stream unit 1, concurrent data stream unit 2, ..., concurrent data stream unit 64. Since the FTL table size of a 16TB SSD is 16GB, if it is divided into 64 parts, the size of each concurrent data stream unit will be 16GB / 64 = 250MB.
[0094] As another example, the FTL table of a 32TB SSD can be divided into 64 parts (64 concurrent data stream units), for example: concurrent data stream unit 1, concurrent data stream unit 2, ..., concurrent data stream unit 64. Since the FTL table size of a 32TB SSD is 32GB, if it is divided into 64 parts, the size of each concurrent data stream unit will be 32GB / 64 = 500MB.
[0095] Divide the FTL table of a 32TB SSD into 128 parts (128 concurrent data stream units), for example: concurrent data stream unit 1, concurrent data stream unit 2, ..., concurrent data stream unit 128. Since the FTL table size of a 32TB SSD is 32GB, dividing it into 128 parts results in each concurrent data stream unit being 32GB / 128 = 250MB in size. This way, the size of each data stream remains unchanged, the managed logical address range also remains unchanged, and the number of log entries recorded on each data stream will not change significantly when new writes occur. Reducing the number of log entries recorded on each data stream can reduce the power-on recovery time of large-capacity SSDs.
[0096] During abnormal power-on recovery, multiple CPUs will recover their respective concurrent data stream units in parallel. Since the number of concurrent data stream units is much greater than the number of CPUs, multiple concurrent data stream units may queue up and wait on a single CPU. Therefore, dividing the FTL table of a 32TB SSD into 128 parts compared to dividing it into 64 parts results in fewer log entries recorded by each concurrent data stream unit. This ensures that the log data processed on each CPU is more evenly distributed, thus shortening the overall SSD power-on recovery time.
[0097] Based on the above, on the one hand, by adding FTL partitions, the problem of insufficient PBA address bit representation caused by the increase in FTL table size is solved; on the other hand, by increasing the number of data streams in the FTL table, the number of logs recorded for each data stream when new write commands are received is reduced, thereby improving the concurrency of CPU processing during power-on recovery and ensuring load balancing of concurrent processing units for FTL table reconstruction. These two optimizations combined ensure a shorter recovery time even for large-capacity SSDs in the event of abnormal power loss, helping businesses recover quickly. Please refer to [link to relevant documentation]. Figure 9A , Figure 9A This is a schematic diagram of CPU concurrently processing 64 data streams according to an embodiment of this application.
[0098] As an example, the FTL table of a 32TB SSD is divided into 64 concurrent data stream units. CPU0 processes concurrent data stream unit 10 (simply labeled as data stream 10 in the diagram, and the same applies below) and concurrent data stream unit 18; CPU1 processes concurrent data stream units 11 and 21; CPU2 processes concurrent data stream units 12 and 30; CPU3 processes concurrent data stream units 13 and 43; CPU4 processes concurrent data stream units 14 and 49; and CPU5 processes concurrent data stream units 15 and 60. Since concurrent data stream unit 21 is relatively large, CPU1 will continue processing concurrent data stream unit 21 even after the other concurrent data stream units have finished processing, resulting in a longer overall power-on recovery time for the SSD.
[0099] Please see Figure 9B , Figure 9B This is a schematic diagram of CPU concurrently processing 128 data streams provided in an embodiment of this application.
[0100] As another example, the FTL table of a 32TB SSD is divided into 128 concurrent data stream units. CPU0 processes concurrent data stream units 10, 18, 30, and 39; CPU1 processes concurrent data stream units 11, 21, 31, and 42; CPU2 processes concurrent data stream units 12, 25, 33, and 43; CPU3 processes concurrent data stream units 13, 26, 34, and 50; CPU4 processes concurrent data stream units 14, 27, 37, and 56; and CPU5 processes concurrent data stream units 15, 28, 38, and 60. Although the data flow concurrency unit 42 and data flow concurrency unit 43 are also relatively large, the size of each data flow concurrency unit is not very large because the FTL table is divided into many parts. Therefore, the time for CPU1 to continuously process data flow concurrency unit 42 and CPU2 to continuously process data flow concurrency unit 43 is relatively short, resulting in a shorter overall SSD power-on recovery time.
[0101] This application limits the exponential growth of the FTL table in large-capacity SSDs, avoiding increased DRAM space requirements and saving costs. Furthermore, this application can limit the growth of the FTL table in large-capacity SSDs to a certain extent and also reduces the size of each data stream, thus avoiding an increase in update logs unique to each data stream. This significantly shortens the recovery time after abnormal power loss of large-capacity SSDs, helping business deployments recover quickly and meeting market demands.
[0102] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0103] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A solid-state storage device, characterized in that, include: Logical address space and physical address space; The logical address space is divided into several logical blocks of a predetermined size, and all logical blocks are further divided into different logical partitions according to a predetermined rule. Each logical partition is managed by an independent CPU. Multiple physical DIEs in the physical address space are merged into one physical partition, and one physical partition is mapped to one LUN; Use the logical partition index as the most significant bit of the physical address and the physical partition LUN index as the second most significant bit of the physical address. The calculated LUN index is overwritten in the physical address to replace the physical partition LUN index, and the bits occupied by the logical partition index in the physical address are set to invalid bits in the physical address. Where, LUN index = logical partition index Maximum number of LUNs that can be operated on concurrently + physical partition indexes.
2. The solid-state storage device according to claim 1, characterized in that, Bits 0-22 of the Physical Address Base (PBA) of a 16TB SSD record the block x page, bits 23-25 of the PBA record the data frame index, and bits 26-31 of the PBA record the LUN index.
3. The solid-state storage device according to claim 1, characterized in that, Bits 0-22 of the Physical Address Base (PBA) of a 32TB SSD record the block and page information, bits 23-26 of the PBA record the data frame index, and bits 27-31 of the PBA record the LUN index.
4. The solid-state storage device according to claim 1, characterized in that, Also includes: FTL table; The FTL table is divided into multiple concurrent data stream units, each containing multiple data streams. All data streams in a concurrent data stream unit are processed on one CPU. The number of concurrent data stream units is directly proportional to the capacity of the solid-state storage device.
5. A method for writing data, characterized in that, Includes the following steps: In response to receiving a write command, allocate physical space to store the data indicated by the write command based on the logical address indicated by the write command; Based on the logical address indicated by the write command, the logical partition to which the logical address belongs is obtained, and each logical partition is managed by an independent CPU; The logical partition index is used as the most significant bit of the physical address, and the physical partition LUN index is used as the second most significant bit of the physical address. A physical partition is formed by merging multiple physical DIEs in the physical address space, and one physical partition is mapped to one LUN. Based on the logical partition index and the physical partition index of the physical space where the write command indicates the data, a LUN index is obtained, where the LUN index equals the logical partition index. Maximum number of LUNs that can be operated on concurrently + physical partition indexes; The LUN index, data frame index, and block × page record are stored in the physical address, and the LUN index overwrites the physical partition LUN index in the physical address, and the bits occupied by the logical partition index in the physical address are set to invalid bits of the physical address; The mapping relationship between logical addresses and physical addresses is recorded in the FTL table to update the FTL table; The write command is complete when the data has been written to the allocated physical space.
6. The method for writing data according to claim 5, characterized in that, Also includes: The FTL table is divided into multiple concurrent data stream units, each containing multiple data streams. All data streams in a concurrent data stream unit are processed on one CPU. The number of concurrent data stream units is directly proportional to the capacity of the solid-state storage device.
7. A method for reading data, characterized in that, Includes the following steps: In response to receiving a read command, the physical address is obtained by querying the FTL table based on the logical address indicated by the read command. The physical address contains the LUN index, data frame index, and block / page records. Based on the logical address indicated by the read command, the logical partition to which the logical address belongs is obtained, and each logical partition is managed by an independent CPU; Based on the logical partition index and the LUN index, the physical partition index is obtained, where the LUN index equals the logical partition index. Maximum number of LUNs that can be operated on concurrently + physical partition indexes; In the physical partition indicated by the physical partition index, the data indicated by the read command is read according to the block × page and data frame index. The physical partition is formed by merging multiple physical DIEs in the physical address space, and one physical partition is mapped to one LUN. The process of recording the LUN index into the physical address includes the following steps: Use the logical partition index as the most significant bit of the physical address and the physical partition LUN index as the second most significant bit of the physical address. The calculated LUN index is overwritten in the physical address to replace the physical partition LUN index, and the bits occupied by the logical partition index in the physical address are set to invalid bits in the physical address.
8. The method for reading data according to claim 7, characterized in that, Also includes: The FTL table is divided into multiple concurrent data stream units, each containing multiple data streams. All data streams in a concurrent data stream unit are processed on one CPU. The number of concurrent data stream units is directly proportional to the capacity of the solid-state storage device.
Citation Information
Patent Citations
Logical block address-to-physical block address mapping method for high-capacity solid-state disk
CN106021159A
Virtual LUN Management
CN109324753A
System and method for address space slicing with strong CPU core affinity
US20210034430A1