Data compression storage device and method based on zns standard
By compressing and decompressing data within the storage device and maintaining logical address mapping under the ZNS standard, the increased complexity caused by data compression is resolved, achieving high-efficiency data storage density and host access transparency.
Patent Information
- Application Number
- CN202011622910.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2040-12-30
AI Technical Summary
Existing technologies increase the complexity of data addressing and management during data compression, affecting how the host accesses storage devices, and fail to achieve transparency in data compression and decompression.
By adopting the storage area namespace under the ZNS standard, data is compressed and decompressed inside the storage device, and address mapping is maintained at the logical address level, ensuring that the host can access the storage device using existing commands and avoiding modification of the protocol.
It increases data storage density while maintaining the host's transparency to storage devices, reducing the impact of data compression on the host's complexity.
Smart Images

Figure CN114691020B_ABST
Abstract
Description
Technical Field
[0001] This application relates to storage technology, and more particularly to a method for providing compression using the ZNS (Zoned Namespace) standard, a storage device thereof, and a host using the storage device. Background Technology
[0002] Figure 1 A block diagram of the storage device is shown. Storage device 102 is coupled to a host computer to provide storage capabilities. The host computer and 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 interface 103, control unit 104, one or more NVM chips 105, and DRAM (Dynamic Random Access Memory) 110.
[0003] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory), XPoint memory, etc. are common NVMs.
[0004] Interface 103 can be adapted to exchange data with the host via methods such as SATA, IDE, USB, PCIe, NVMe (NVM Express), SAS, Ethernet, and Fibre Channel.
[0005] The control unit 104 is used to control data transfer between the interface 103, the NVM chip 105, and the DRAM 110. It is also used for memory management, host logical address to flash physical address mapping, erase leveling, bad block management, etc. The control unit 104 can be implemented in various ways, including software, hardware, firmware, or a combination thereof. For example, the control unit 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof. The control unit 104 may also include a processor or controller, in which software executes to manipulate the hardware of the control unit 104 to process I / O (Input / Output) commands. The control unit 104 can also be coupled to the DRAM 110 and can access the data in the DRAM 110. FTL tables and / or cached I / O command data can be stored in the DRAM.
[0006] The control unit 104 includes a flash interface controller (or media interface controller, flash channel controller), which 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. Known NVM chip interface protocols include "Toggle", "ONFI", etc.
[0007] Data is typically stored and retrieved in pages on storage media, while data is erased in blocks. A block (also called a physical block) contains multiple pages. A page on a storage medium (called a physical page) has a specified size, such as 17664 bytes. Physical pages can also have other sizes.
[0008] In storage devices, the FTL (Flash Translation Layer) is used to maintain mapping information from logical addresses to physical addresses. The FTL is implemented by, for example, software, firmware running in the CPU of the control unit, and / or hardware as part of an ASIC.
[0009] Figure 2 This is a schematic diagram of FTL.
[0010] Storage devices provide logical address space to the host. The host uses logical addresses to access the storage device. FTL maps the logical addresses provided by the host to physical addresses.
[0011] Logical addresses constitute the storage space of a solid-state storage device as perceived by upper-level software such as the operating system. The smallest unit addressable by a logical address is called, for example, a logical block or a sector (for simplicity, unless otherwise specified, the terms logical block and sector are used interchangeably below), and the logical address that addresses a logical block is also called the Logical Block Address (LBA). Logical blocks have a specified size, such as 512 bytes, 2KB, 4KB, or 16KB. Physical addresses are the addresses of physical storage units (e.g., physical pages) used to access the NVM of the storage device. In related technologies, address mapping can also be implemented using intermediate address formats. For example, a logical address can be mapped to an intermediate address, and then the intermediate address can be further mapped to a physical address.
[0012] The table structure that stores mapping information from logical addresses to physical addresses is called the FTL table. The FTL table is important metadata in storage devices. Typically, FTL table entries record address mappings in units of logical blocks within the storage device. Optionally, each entry in the FTL table represents multiple logical blocks to balance the size of the FTL table with the granularity of storage space management; for example, eight logically contiguous logical blocks.
[0013] The FTL table includes, for example, multiple FTL entries, each corresponding to one or more consecutive logical blocks. The value of the FTL entry records the address of the storage space provided for the one or more consecutive logical blocks (for clarity, this storage space is referred to as an NVM data frame, and the address of this storage space is referred to as the NVM data frame address).
[0014] The FTL table is stored, for example, in DRAM 110 (see also...). Figure 1 It can be stored in either SRAM or FTL. Based on the accessed logical address, the index of the corresponding FTL entry is obtained, and the NVM data frame that provides storage space for the logical block is obtained from the FTL entry.
[0015] The NVM data frame address is, for example, the physical address of accessing a physical page of the NVM chip, the physical address of accessing multiple combined physical pages of the NVM chip (combined physical pages are, for example, physical pages located on multiple planes of the same or different logical units (LUNs), or the physical address of accessing a portion of the data units within a physical page of the NVM chip.
[0016] For some storage devices, the FTL (Framework Time Limit) is provided by the host coupled to the storage device. The host's memory stores the FTL table, and the host's CPU executes the software to provide the FTL. Other times, a storage management device positioned between the host and the storage device provides the FTL.
[0017] Such as the NVMe protocol (in https: / / nvmexpress.org / wp-content / uploads / NVM-Express- 1_4-2019.06.10-Ratified.pdf The NVMe architecture defines how data is exchanged between the host and storage devices. The NVMe organization is also discussing Zones (storage zones) and Zoned Namespaces (ZNSs). https: / / nvmexpress.org / wp-content / uploads / NVM-Express-1.4-Ratified-TPs-1.zip (Available). A Zone is a contiguous range of Logical Block Addresses (LBAs) managed as a single unit, while a ZNS is a namespace that includes multiple Zones. Some Zones need to be written sequentially in logical address order. The host ensures that the I / O commands provided to the Zones meet the requirements.
[0018] Figure 3A This is a diagram of the Zone.
[0019] Storage devices provide, for example, a logical address space (LBA range) of 1000GB. The logical address space consists of multiple (n+1) Zones, each occupying a logical address space corresponding to its assigned number. A host can treat a Zone as a storage object and access a specific logical address space of the storage device based on the Zone number and its offset within the Zone. The size of the logical address space occupied by a Zone is called the Zone Size. Figure 3A In the example, the Zone size is, for example, 512MB.
[0020] Continue reading Figure 3A Zone 0 includes storage space (or logical address range) (310, 320, and 340). Storage space 310 is the storage space in Zone 0 that has already been written to. Storage space 320 has not yet been written to and can be written to, but due to storage space alignment and other reasons, the host may not write data to storage space 340. The maximum number of logical blocks that can be written to a Zone is called the Zone Capacity, for example, the size indicated by storage spaces 310 and 320. Therefore, the Zone Capacity is no greater than the Zone size. WP (WritePointer) indicates the starting position of storage space 320 in Zone 0.
[0021] When writing data to the Zone, it always writes to a specified size of storage space starting from the location indicated by WP and with consecutive addresses.
[0022] Figures 3B-3D This diagram illustrates the process of writing data to the Zone.
[0023] The host uses two commands (write command and append command) to write data to the Zone. Figure 3B Demonstrated writing commands. Figure 3C The additional command was displayed.
[0024] A write command instructs the writing of data to a Zone. The write command specifies the starting address for the write operation, which should be consistent with the current Write Warrant (WP). The data is written to the Zone's contiguous logical address space starting from the address indicated by the current WP. Each Zone is limited to processing only one write command at a time; a new write command can only be issued to a Zone after the previous one has been processed. See also... Figure 3B The squares represent the logical address space of a Zone, with rightward movement being the positive direction. The leftmost square contains the starting logical address of the Zone (denoted as Zone_sLBA). W0, W1, and W2 each represent write commands issued to the Zone. Write command W0 writes 4KB of data to the Zone. Upon receiving write command W0, WP indicates the logical address Zone_sLBA. After write command W0 is processed, data is written to the 4KB logical address range of the Zone starting from logical address 0, and WP is updated to point to logical address Zone_sLBA+4KB (WP0). Next, upon receiving write command W1 (with 8KB of data to be written), after write command W1 is processed, data is written to the 8KB logical address range of the Zone starting from logical address Zone_sLBA+4KB, and WP is updated to point to logical address Zone_sLBA+12KB (WP1). Next, a write command W2 is received (the size of the data to be written is 16KB). After the write command W2 is processed, the 16KB logical address range of Zone starting from the logical address Zone_sLBA+12KB is written with data, and WP is updated to point to the logical address Zone_sLBA+28KB (WP2).
[0025] An append command instructs the writing of data to a contiguous logical address space within a Zone, starting from the location indicated by the current WP. There is no limit to the number of append commands a Zone can process simultaneously. A host is allowed to issue multiple append commands to a Zone concurrently, or to issue an append command to a Zone before a previous append command has been processed. See also Figure 3CThree append commands (AP0, AP1, and AP2) are concurrently provided to the Zone. For example, the initial position indicated by the WP is the starting logical address of the Zone (denoted as Zone_sLBA). When using append commands, the host does not care about the logical address where the data corresponding to the append command is written; therefore, the append command does not indicate the specific value of the logical address where the data is written. Instead, the storage device determines the logical address of the append command based on the position of the WP when processing the append command, and returns the determined logical address to the host after the append command is processed or submitted. This allows the host to know the storage location of the data corresponding to the append command within the Zone, and the host can use this storage location to retrieve the written data. See also... Figure 3C The storage device receives three append commands (AP0, AP1, and AP2), and determines the processing order of these three append commands. For example, the storage device decides to process these three append commands in the order of AP0, AP1, and AP2. How the storage device internally processes write and append commands is not the focus of this application. For example, the storage device writes the data corresponding to append command AP0 to a 4KB contiguous logical address space starting from logical address Zone_sLBA, writes the data corresponding to append command AP1 to an 8KB contiguous logical address space starting from logical address Zone_sLBA+4KB, and writes the data corresponding to append command AP2 to a 16KB contiguous logical address space starting from logical address Zone_sLBA+12KB.
[0026] For both write and append commands, after processing or committing them, the storage device returns the starting address (denoted as sLBA) of the logical address space containing the data corresponding to the write or append command to the host. See also... Figure 3D This record shows the distribution of the three command-related data (write or append commands) within the Zone after processing. For example, the Zone's sector size is 512 bytes, and the starting address is Zone_sLBA. The logical address space occupied by write command W0 (or append command AP0) starts at Zone_sLBA+0 (in sectors) and has a length of 8 (in sectors); the logical address space occupied by write command W1 (or append command AP1) starts at Zone_sLBA+8 and has a length of 16; the logical address space occupied by write command W2 (or append command AP2) starts at Zone_sLBA+24 and has a length of 32.
[0027] Optionally, the host records the starting address (denoted as sLBA) of the logical address space corresponding to each write / append command. Again, optionally, the host also records the length of the data corresponding to each write / append command (or the length of the logical address space storing the data). The data corresponding to each write / append command is referred to as an object, and its attributes include the starting address and length of the logical address space storing the object, thus allowing the object to be retrieved based on its attributes.
[0028] To read data from the Zone, the host sends a read command to the storage device, specifying the starting address and length. The storage device then reads the specified length of data starting from the starting address and provides it to the host as a response to the read command. Summary of the Invention
[0029] Data can be compressed. By compressing data, the data storage density of storage devices can be increased. Therefore, there is a desire to provide storage devices with data compression capabilities. However, compression changes the size of data, thereby introducing additional complexity to data addressing and management. The goal is to eliminate or minimize the impact of the complexity introduced by compression on the host, allowing the host to access the storage device in its existing manner, while the storage device provides data compression and / or decompression, and this compression and / or decompression is transparent to the host. Thus, the host does not need to be aware that data is being compressed and / or decompressed within the storage device, nor does it need to modify the protocol; instead, it can access the storage device using existing write, append, and / or read commands.
[0030] The introduction of Zones further supports achieving this inventive objective. To access a Zone, the host maintains the starting address (sLBA) and (uncompressed) length of the corresponding data (object) for write / append commands, and uses the starting address (sLBA) and (uncompressed) length to read the object from the storage device in read commands. The storage device according to embodiments of this application, without altering the semantics of write, append, and / or read commands provided to the host, internally compresses / decompresses objects and stores the compressed data on the NVM, thereby increasing data storage density without introducing additional complexity to the host for accessing compressed data.
[0031] According to a first aspect of this application, a method for processing a first I / O command according to the first aspect of this application is provided, comprising: a host providing a first command to a storage device for writing data to a first storage zone; the storage device allocating a first logical address index for the data to be written by the first command based on a write pointer (WP) of the first storage zone, the first logical address index defining a first logical address space with a first size of the data to be written by the first command; compressing the data to be written by the first command to obtain compressed data; storing the compressed data; recording the address where the compressed data is stored in association with the first logical address index; and providing the first logical address index to the host; the host recording, in association, a first host logical address (HLBA) accessed by the first command and the first logical address index.
[0032] According to the method of processing a first I / O command according to the first aspect of this application, a method of processing a second I / O command according to the first aspect of this application is provided, wherein the storage device uses the write pointer (WP) of the first storage region as the first logical address index, or uses a key generated based on the write pointer (WP) of the first storage region as the first logical address index; the method further includes: the storage device updating the write pointer (WP) of the first storage region according to the size of the compressed data.
[0033] According to the method for processing a first or second I / O command according to the first aspect of this application, a method for processing a second I / O command according to the first aspect of this application is provided, further comprising: a host providing a second command to a storage device for writing data to a first storage zone; the storage device allocating a second logical address index for the data to be written by the second command according to an updated write pointer, the second logical address index and a second size of the data to be written by the second command defining a second logical address space; wherein even if the difference between the second logical address index and the first logical index is less than the first size, the second logical address space does not overlap with the first logical address space.
[0034] According to the third method for processing I / O commands according to the first aspect of this application, a fourth method for processing I / O commands according to the first aspect of this application is provided, further comprising: the storage device compressing the data to be written by the second command to obtain second compressed data; storing the second compressed data; recording the address where the second compressed data is stored in association with the second logical address index; and updating the write pointer according to the size of the second compressed data.
[0035] According to a first aspect of this application, a method for processing a fifth I / O command according to the first aspect of this application is provided, comprising: a host providing a first command to a storage device for writing data to a first storage zone, wherein the first command indicates a first logical address index; the storage device compressing the data to be written by the first command to obtain compressed data; storing the compressed data; recording the address where the compressed data is stored in association with the first logical address index; generating a second logical address index based on the first logical address index and the size of the compressed data, and providing the second logical address index to the host; the host recording a first host logical address (HLBA) accessed by the first command in association with the first logical address index.
[0036] A method for processing a fifth I / O command according to a first aspect of this application is provided, and a method for processing a sixth I / O command according to a first aspect of this application is provided, wherein a first logical address index and a first size of data to be written by the first command define a first logical address space.
[0037] A method for processing I / O commands according to the fifth or sixth aspect of the first aspect of this application is provided, and a method for processing I / O commands according to the sixth aspect of the first aspect of this application is provided, further comprising: the storage device updating the write pointer of the first storage area according to the size of the compressed data; and the host updating the write pointer of the first storage area using the second logical address index.
[0038] One of the methods for processing I / O commands according to the fifth to seventh aspects of the first aspect of this application is provided, and an eighth method for processing I / O commands according to the first aspect of this application is provided, further comprising: a host providing a second command to a storage device for writing data to a first storage zone, wherein the second command indicates a second logical address index; the storage device compressing the data to be written by the second command to obtain second compressed data; storing the second compressed data; recording the address where the second compressed data is stored in association with the second logical address index; generating a third logical address index based on the second logical address index and the size of the second compressed data; and providing the third logical address index to the host; wherein the second logical address index and the second size of the data to be written by the second command define a second logical address space.
[0039] One of the first to eighth methods for processing I / O commands according to the first aspect of this application is provided, and a ninth method for processing I / O commands according to the first aspect of this application is provided, further comprising: for generating the first command, the host allocates an available storage area as the first storage area, or obtains a storage area capable of accommodating the data to be written by the first command as the first storage area; and associatedly recording the first host logical address (HLBA) accessed by the first command with the first storage area.
[0040] One of the methods for processing I / O commands according to the first to ninth aspects of the present application is provided, and a tenth method for processing I / O commands according to the first aspect of the present application is provided, wherein the first logical address index indicates the first storage region.
[0041] One of the methods for processing I / O commands according to the first aspect of this application is provided, and an eleventh method for processing I / O commands according to the first aspect of this application is provided, wherein the host further records the first logical address index in association with a first size of the data to be written by the first command.
[0042] One of the methods for processing I / O commands according to the first to eleventh aspects of the present application is provided, and a twelfth method for processing I / O commands according to the first aspect of the present application is provided, wherein one or more host logical addresses of the host do not have an associated logical address index; in response to reading data from a third host logical address, if the host does not record a logical address index associated with the third host logical address, it indicates that an error has occurred; if the host obtains a third logical address index associated with the third host logical address, it provides a third command to the storage device for reading data from the third logical address index.
[0043] One of the methods for processing I / O commands according to the first to eleventh aspects of this application is provided, and a thirteenth method for processing I / O commands according to the first aspect of this application is provided, wherein one or more host addresses of the host do not have an associated logical address index; in response to reading data from a third host logical address, if the host does not record a logical address index associated with the third host logical address, it determines the third logical address space corresponding to the third host logical address based on the recorded logical address index and its associated size, uses the third logical address index defining the third logical address space as the logical address index associated with the third host logical address, and obtains the starting position of the data to be read from the third host logical address in the third logical address space based on the difference between the third host logical address and the host logical address associated with the third logical address recorded by the host, and provides a third command to the storage device for reading data from the third logical address index; if the host obtains a third logical address index associated with the third host logical address, it provides a third command to the storage device for reading data from the third logical address index.
[0044] One of the methods for processing I / O commands according to the first aspect of this application is provided, from the first to the eleventh, and a fourteenth method for processing I / O commands according to the first aspect of this application is provided, further comprising: for generating the first command, the host allocates a first zLBA space from the zLBA space of the first storage region, the size of the first zLBA space being able to accommodate the data to be written by the first command; wherein the zLBA space of the first storage region is a one-dimensional linear space, the size of which is the same as the capacity of the first storage region, and each element of which is addressed by zLBA; the host records the first host logical address (HLBA) accessed by the first command in association with the first zLBA space, and the elements of the host logical address (HLBA) space defined by the first host logical address (HLBA) and the first size correspond to the elements of the first zLBA space.
[0045] A method for processing I / O commands according to the fourteenth aspect of the present application is provided, and a method for processing I / O commands according to the fifteenth aspect of the present application is provided, further comprising: in response to reading data from a third host logical address, the host obtains a third zLBA associated with the third host logical address, determines a third logical address space corresponding to the third zLBA based on a recorded logical address index and its associated size, uses the third logical address index defining the third logical address space as a logical address index associated with the third host logical address, and provides a third command to the storage device for reading data from the third logical address index.
[0046] A method for processing an I / O command according to the first aspect of this application is provided, and a method for processing an I / O command according to the first aspect of this application is provided, wherein the host further obtains the starting position of the data to be read from the third host logical address in the third logical address space based on the difference between the third zLBA and the zLBA associated with the third logical address index recorded by the host, and uses a specified size of data starting from the starting position in the third logical address space as the data to be read from the third host logical address.
[0047] One of the first to sixteenth methods for processing I / O commands according to the first aspect of this application is provided, and a seventeenth method for processing I / O commands according to the first aspect of this application is provided, further comprising: a host providing a fourth command to a storage device for writing data to a second namespace; the storage device allocating a physical address for the data to be written by the fourth command; recording and storing, in association with the allocated physical address, the host logical address accessed by the fourth command; wherein the second namespace is different from the namespace where the first storage zone is located, and wherein the data to be written by the fourth command is metadata for the data to be written by the first command.
[0048] One of the methods for processing I / O commands according to the first to seventeenth aspects of the first aspect of this application is provided, and an eighteenth method for processing I / O commands according to the first aspect of this application is provided, wherein logical address indexes in the storage device that are not associated with NVM addresses are invalid logical address indexes; and logical indexes associated with NVM addresses are valid logical address indexes; and wherein the storage area capacity of the storage area is obtained by summing the sizes of all logical address spaces defined by all valid logical address indexes of the storage area.
[0049] One of the first to eighteenth methods for processing I / O commands according to the first aspect of this application is provided, and a nineteenth method for processing I / O commands according to the first aspect of this application is provided, wherein the host provides the storage device with a fifth command for reading data from a fifth logical address index; the method further includes the storage device identifying whether the fifth logical address index is a valid logical address index; if the fifth logical address index is a valid logical address index, reading fifth compressed data according to the fifth logical address index; decompressing the fifth compressed data to obtain fifth decompressed data; and using all or part of the fifth decompressed data as the processing result of the fifth command.
[0050] A nineteenth method for processing I / O commands according to the first aspect of this application is provided, and a twentieth method for processing I / O commands according to the first aspect of this application is provided, wherein if the fifth logical address index is not a valid logical address index, the storage device sends the processing result of the fifth command to the host, and the processing result of the fifth command indicates that the fifth command has an error.
[0051] A method for processing I / O commands according to the nineteenth or twentieth aspect of the first aspect of this application is provided, and a method for processing I / O commands according to the twenty-first aspect of the first aspect of this application is provided, wherein the fifth command indicates a fifth length, the method further comprising: if the size of the fifth decompressed data is less than the fifth length, the storage device further reads a sixth compressed data following the fifth compressed data according to the address of the fifth compressed data; decompresses the sixth compressed data to obtain a sixth decompressed data; repeats the above process until the sum of the sizes of all the decompressed data read is not less than the fifth length; and takes the portion of all the decompressed data read as a whole, starting from the beginning and equal to the fifth length, as the processing result of the fifth command.
[0052] One of the nineteenth to twenty-first methods for processing I / O commands according to the first aspect of this application is provided, and a twenty-second method for processing I / O commands according to the first aspect of this application is provided, further comprising: the host providing the storage device with a sixth command for reading data from a sixth logical address index, wherein the sixth command indicates a plurality of logical addresses and a plurality of lengths corresponding to each of the plurality of logical addresses; if the first logical address of the plurality of logical addresses is a valid logical address index, reading compressed data according to the first logical address and decompressing it to obtain complete data of the sixth logical address space corresponding to the first logical address; and obtaining multiple data segments from the complete data of the sixth logical address space according to the plurality of logical addresses indicated by the sixth command and the plurality of lengths corresponding to each of the plurality of logical addresses, as the processing result of the sixth command.
[0053] According to a second aspect of this application, a method for processing a first I / O command according to the second aspect of this application is provided, comprising: a host providing a first command to a storage device for reading data from a first storage zone; wherein the first command indicates a first logical address index; the storage device identifying whether the first logical address index is a valid logical address index; if the first logical address index is a valid logical address index, reading first compressed data according to the first logical address index; decompressing the first compressed data to obtain first decompressed data; and providing part or all of the first decompressed data as the processing result of the first command to the host.
[0054] According to the method for processing a first I / O command according to the second aspect of this application, a method for processing a second I / O command according to the second aspect of this application is provided, further comprising: if a first logical address index is not a valid logical address index, the storage device sending a processing result of the first command to the host, wherein the processing result of the first command indicates that there is an error in the first command.
[0055] According to the method for processing IO commands according to the first or second aspect of this application, a method for processing IO commands according to the second aspect of this application is provided, wherein the length of the first compressed data read by the storage device according to the first logical address index is obtained from the NVM according to the first logical address index, or determined according to the distance between the first logical address index and the next valid logical address index.
[0056] According to one of the first to third methods for processing I / O commands according to the second aspect of this application, a fourth method for processing I / O commands according to the second aspect of this application is provided, wherein the first command further indicates a first length of data to be read; the method further includes: if the size of the first decompressed data is less than the first length, reading second compressed data after the first compressed data on the NVM according to the address of the first compressed data on the NVM; decompressing the second compressed data to obtain second decompressed data; repeating the above process until the sum of the sizes of all decompressed data read is not less than the first length; and taking the portion of all decompressed data read as a whole that is equal to the first length from the beginning as the processing result of the first command.
[0057] According to one of the first to fourth methods for processing I / O commands according to the second aspect of this application, a fifth method for processing I / O commands according to the second aspect of this application is provided, further comprising: a host providing a second command to a storage device for reading data from a first storage zone; wherein the second command indicates a plurality of logical addresses and a plurality of lengths corresponding to each of the plurality of logical addresses; if the first logical address of the plurality of logical addresses is a valid logical address index, reading compressed data according to the first logical address and decompressing it to obtain complete data of a second logical address space corresponding to the first logical address; and obtaining multiple data segments from the complete data of the second logical address space according to the plurality of logical addresses indicated by the second command and the plurality of lengths corresponding to each of the plurality of logical addresses, as the processing result of the second command.
[0058] According to one of the methods for processing I / O commands according to the first to fifth aspects of the second aspect of this application, a method for processing I / O commands according to the second aspect of this application is provided, further comprising: a host providing a storage device with a third command for reading data from a first storage zone, wherein the third command indicates a third logical address index and a third length; if the third logical address index is a valid logical address index, the storage device reads third compressed data according to the third logical address index; decompresses the third compressed data to obtain third decompressed data; if the length of the third decompressed data is less than the third length, further obtaining the next valid logical address index adjacent to the third logical address index from the FTL table according to the third logical address index, reading fourth compressed data according to the address of the next valid logical address index, decompressing the fourth compressed data to obtain fourth decompressed data; and taking the portion of all the decompressed data read as a whole, starting from the beginning and equal to the third length, as the processing result of the third command.
[0059] According to one of the first to fifth methods for processing I / O commands according to the second aspect of this application, a sixth method for processing I / O commands according to the second aspect of this application is provided, wherein if the sum of the length of the third decompressed data and the length of the fourth decompressed data is less than the third length, the next valid logical address index is obtained from the FTL table, and the compressed data is read from the NVM according to the obtained valid logical address index address, wherein the sum of the lengths of the decompressed data of all the directly read compressed data is not less than the third length.
[0060] According to one of the first to sixth methods for processing I / O commands according to the second aspect of this application, a seventh method for processing I / O commands according to the second aspect of this application is provided, further comprising: a host providing a fourth command to a storage device for writing data to a first storage zone; the storage device allocating a fourth logical address index for the fourth command, the fourth logical address index defining a fourth logical address space with a fourth size of the data to be written by the fourth command; compressing the data to be written by the fourth command to obtain compressed data; storing the compressed data; recording the address where the compressed data is stored in association with the fourth logical address index; and providing the fourth logical address index to the host; the host recording, in association, a fourth host logical address (HLBA) accessed by the fourth command and the fourth logical address index.
[0061] According to one of the first to sixth methods for processing I / O commands according to the second aspect of this application, an eighth method for processing I / O commands according to the second aspect of this application is provided, further comprising: a host providing a fourth command to a storage device for writing data to a first storage zone, wherein the fourth command indicates a fourth logical address index; the storage device compressing the data to be written by the fourth command to obtain compressed data; storing the compressed data; recording the address where the compressed data is stored in association with the fourth logical address index; generating a fifth logical address index based on the fourth logical address index and the size of the compressed data, and providing the fifth logical address index to the host; the host recording the fourth host logical address (HLBA) accessed by the fourth command and the fourth logical address index in association.
[0062] According to a third aspect of this application, a method for processing I / O commands according to the third aspect of this application is provided, comprising: obtaining a first command for writing data to a first storage zone; allocating a first logical address index for the data to be written by the first command according to a write pointer (WP) of the first storage zone, the first logical address index defining a first logical address space with a first size of the data to be written by the first command; compressing the data to be written by the first command to obtain compressed data; storing the compressed data; recording the address where the compressed data is stored in association with the first logical address index; and providing the first logical address index as a response to the first command.
[0063] According to a fourth aspect of this application, a method for processing I / O commands according to the fourth aspect of this application is provided, comprising: obtaining a first command for writing data to a first storage zone, wherein the first command indicates a first logical address index; compressing the data to be written by the first command to obtain compressed data; storing the compressed data; recording, in association with the first logical address index, the address where the compressed data is stored; generating a second logical address index based on the first logical address index and the size of the compressed data; and providing the second logical address index as a response to the first command.
[0064] According to a fifth aspect of this application, a storage system is provided, wherein the storage system includes a host and a storage device; the host issues a command to the storage device for writing data to a first storage zone; the storage device executes the method according to a third aspect of this application to process the command for writing data; the host obtains the processing result of the command for writing data provided by the storage device, and records in association the logical address index indicated by the processing result of the command for writing data and the host logical address accessed by the command for writing data.
[0065] According to a sixth aspect of this application, a storage system according to the sixth aspect of this application is provided, wherein the storage system includes a host and a storage device; the host issues a command to the storage device for writing data to a first storage area; the storage device executes the method according to the fourth aspect of this application to process the command for writing data; the host obtains the processing result of the command for writing data provided by the storage device, and updates the write pointer of the first storage area according to the logical address index indicated by the processing result of the command for writing data.
[0066] According to a seventh aspect of this application, a method for processing I / O commands according to the seventh aspect of this application is provided, comprising: obtaining a first command for reading data from a first storage zone; wherein the first command indicates a first logical address index; identifying whether the first logical address index is a valid logical address index; if the first logical address index is a valid logical address index, reading first compressed data according to the first logical address index; decompressing the first compressed data to obtain first decompressed data; and using part or all of the first decompressed data as the processing result of the first command.
[0067] According to an eighth aspect of this application, an information processing apparatus according to the eighth aspect of this application is provided, including a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the method according to the third, fourth, or seventh aspect of this application.
[0068] According to a ninth aspect of this application, a method for processing an I / O command according to the ninth aspect of this application is provided, comprising: providing a first command to a storage device for writing data to a first storage zone; obtaining a first logical address index provided by the storage; and recording in association a first host logical address (HLBA) accessed by the first command and the first logical address index.
[0069] According to a tenth aspect of this application, a method for processing I / O commands according to the tenth aspect of this application is provided, comprising: providing a storage device with a first command for writing data to a first storage zone, wherein the first command indicates a first logical address index; obtaining a second logical address index provided by the storage device; recording in association a first host logical address (HLBA) accessed by the first command and the first logical address index; and updating a write pointer of the first storage zone according to the first logical address index.
[0070] According to the eleventh aspect of this application, a method for processing a first I / O command according to the eleventh aspect of this application is provided, comprising: obtaining a first command for writing data; allocating a first logical address index and a first size for the data to be written by the first command, the first logical address index and the first size defining a first logical address space, the first size being the size of the first logical address space, the first size being capable of accommodating uncompressed data to be written by the first command; compressing the data to be written by the first command to obtain compressed data; storing the compressed data in an NVM; and recording, in association with the first logical address index, the address in the NVM where the compressed data is stored.
[0071] According to a twelfth aspect of this application, a method for processing a first I / O command according to the twelfth aspect of this application is provided, comprising: obtaining a third command for reading data, wherein the third command indicates a third logical address and a third length; if the third address is a valid logical address index, reading third compressed data from an NVM according to the third address; decompressing the third compressed data to obtain third decompressed data; and taking the portion of the third data equal to the third length starting from the beginning as the processing result of the third command.
[0072] According to a thirteenth aspect of this application, a first storage system according to a thirteenth aspect of this application is provided, wherein the storage system includes a host and a storage device; the host issues a command for writing data to the storage device; the storage device executes a method for processing I / O commands according to an eleventh aspect of this application to process the command for writing data; the host obtains the processing result of the command for writing data provided by the storage device, records the logical address index indicated by the processing result of the command for writing data as a logical address corresponding to the command for writing data; and records the data length corresponding to the command for writing data.
[0073] According to a first storage system according to a thirteenth aspect of this application, a second storage system according to a thirteenth aspect of this application is provided, wherein a host issues a command for reading data to the storage device; the storage device executes a method according to one of the methods for processing I / O commands according to a twelfth aspect of this application to process the command for reading data; and the host obtains the processing result of the command for reading data provided by the storage device.
[0074] According to the fourteenth aspect of this application, an information processing apparatus is provided, including a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement a method for processing I / O commands according to the eleventh or twelfth aspect of this application. Attached Figure Description
[0075] To more clearly illustrate the technical solutions in the embodiments of this application 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0076] Figure 1 A block diagram showing a storage device using existing technology;
[0077] Figure 2 This is a schematic diagram of FTL;
[0078] Figure 3A This is a diagram of the Zone;
[0079] Figures 3B-3D This diagram illustrates the process of writing data to the Zone.
[0080] Figure 4A A schematic diagram illustrating transparent compression according to an embodiment of this application is shown;
[0081] Figure 4B A schematic diagram illustrating address space mapping according to an embodiment of this application is shown;
[0082] Figure 5A This is a schematic diagram of the logical address space of existing technology;
[0083] Figure 5B This is a schematic diagram of the logical address space according to an embodiment of this application;
[0084] Figure 6A A flowchart illustrating the process of reading compressed data according to an embodiment of this application is shown;
[0085] Figure 6BA schematic diagram illustrating the reading of compressed data according to yet another embodiment of this application;
[0086] Figure 6C A flowchart illustrating the reading of compressed data according to another embodiment of this application is shown;
[0087] Figure 6D A schematic diagram illustrating the reading of compressed data according to another embodiment of this application is shown.
[0088] Figure 7 A schematic diagram illustrating the Zone capacity of a compressed ZNS according to an embodiment of this application is shown;
[0089] Figure 8 A schematic diagram illustrating a storage device providing a hybrid NS according to an embodiment of this application is shown;
[0090] Figure 9 A schematic diagram illustrating the use of a hybrid NS according to embodiments of this application is shown; and
[0091] Figure 10A A schematic diagram illustrating a host using compressed ZNS according to an embodiment of this application is shown;
[0092] Figure 10B and Figure 10C A flowchart illustrating the use of compressed ZNS by a host according to an embodiment of this application is shown;
[0093] Figure 11A A schematic diagram of the zLBA space of the Zone for compression of ZNS according to an embodiment of this application is shown;
[0094] Figure 11B A schematic diagram illustrating the use of compressed ZNS by a host according to another embodiment of this application is shown;
[0095] Figure 11C and Figure 11D A flowchart illustrating the use of compressed ZNS by a host according to an embodiment of this application is shown. Detailed Implementation
[0096] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0097] Figure 4A A schematic diagram of transparent compression provided according to an embodiment of this application is shown.
[0098] exist Figure 4AThe text uses two commands (CMD1 and CMD2) as examples to demonstrate the process of a storage device compressing the data corresponding to a command. Figure 4A Steps 410 to 418 shown on the left are the methods used to process the two commands. Command CMD1 writes 128KB of data (D1), and command CMD2 writes 60KB of data (D2).
[0099] Understandably, commands that instruct the writing of data to a storage device include, for example, write commands and append commands, where the write command indicates the address carrying the data to be written.
[0100] In response to receiving commands (CMD1 and CMD2) (410), the data to be written by the commands is compressed (412). The data D1 of command CMD1 is compressed to obtain compressed data (CD1) of size 16KB, and the data D2 of command CMD2 is compressed to obtain compressed data (CD2) of size 4KB. Understandably, the size of the compressed data may not be an integer multiple of the logical block size (e.g., 3.7KB). In this case, the compressed data is aligned to the logical block size (e.g., if the logical block size is 512 bytes, 8 logical blocks are allocated for the 3.7KB compressed data). In one example, the data (e.g., D1) corresponding to a command (e.g., CMD1) is compressed as a whole, resulting in compressed data that can be decompressed as a whole, while parts of the compressed data cannot be decompressed. In another example, the data (e.g., D1) corresponding to a command is segmented and compressed to obtain one or more segments, each segment being large enough to fit within one sector, and each segment being decompressable independently.
[0101] Allocate logical address space (414) to hold the uncompressed data (D1 and D2). For a write command, the starting address of the allocated logical address space is the address indicated in the write command. For an append command, the starting address of the allocated logical address space is, for example, the starting address of the currently writable logical address space, or for ZNS, for example, the logical address indicated by WP.
[0102] According to embodiments of this application, the starting address of the allocated logical address space is called the logical address index. Only the logical address index is used to index the FTL table. Addresses other than the starting address in the allocated logical address space are not used to index the FTL table. The allocated logical address space is defined by both the logical address index and the size of the allocated logical address space. Only the logical address index is used to describe the starting address of the logical address space allocated for the data to be written by the command; other logical addresses in the logical address space are not used to describe the starting address. The capacity of the logical address space allocated for the data to be written by the command is defined only by the size of the allocated logical address space; therefore, the difference between the logical address indices of the logical address spaces allocated for two adjacent commands does not represent the capacity of the logical address space allocated for the preceding command.
[0103] According to embodiments of this application, the difference between the logical address indices of the logical address spaces allocated to two adjacent commands represents the size of the compressed data corresponding to the preceding command (aligned by logical block size). It will be appreciated that, according to embodiments of this application, the logical address space index corresponding to the next command can only be known after the size of the compressed data to be written for a command has been obtained.
[0104] For example, the starting address of the currently writable logical address space (or the WP for ZNS, or the logical address indicated by the CMD1 write command) is denoted as sLBA. A logical address space of 256 logical blocks (512B in size) is allocated to CD1 starting from sLBA.
[0105] Generally, the size of the data (uncompressed) to be written by the command is denoted as DS, and the logical block size is denoted as SS. Then, the length of the logical address range allocated for the uncompressed data to be written is [DS / SS] (DS / SS is rounded up). Thus, according to the embodiments of this application, the uncompressed write data is distributed in the logical address space, and the size occupied by the write data in the logical address space corresponds to the size of the uncompressed data.
[0106] The logical address allocated to CMD2 is denoted as sLBA2, where sLBA2 = sLBA + 32, and 32 is the number of logical blocks occupied by the compressed data CD1 corresponding to CMD1. The logical address space allocated to CMD2 starts from sLBA + 32 and has a length of 120 logical blocks.
[0107] For append commands, after allocating logical address space, the Write-on-Plate (WP) also needs to be updated. Generally, the compressed size of the data to be written by the command is denoted as CS, and the logical block size is denoted as SS. Then, the increment of WP after allocating logical address space is [CS / SS] (CS / SS is rounded up). The increment of WP also represents the increment of the logical address index used for the next command after allocating logical address space for the command.
[0108] Physical addresses for the NVM are also allocated for the compressed data (CD1 and CD2). The allocated physical address range must be large enough to accommodate the compressed data. For example, starting from the physical address indicated by the sPBA in the NVM, a 16KB storage space is allocated to store the compressed data CD1, and the next 4KB storage space is allocated to store the compressed data CD2. Those skilled in the art will recognize that the physical storage space for storing the compressed data can be distributed in other ways, such as located in different NVMs or different physical blocks. The starting address and corresponding physical address of the allocated logical address range are recorded in the FTL table.
[0109] The compressed data (CD1 and CD2) is written to the NVM (416) indicated by the allocated physical address. The logical address index allocated in step 414 is also returned to the host (418) to inform the host of the logical address space allocated for the command (CMD1 or CMD2). The host may record these allocated logical address indices to retrieve the corresponding data (D1 or D2) later using these indices. The host is also notified that command processing is complete.
[0110] It should be noted that, according to the embodiments of this application, data compression is transparent to the host. The host does not require additional processing to access the compressed data in the NVM. Nor does it require modification of the protocol used by the host to access the storage device. From the host's perspective, data D1 corresponding to command CMD1 is written to logical address sLBA with a data length of 128KB, while data D2 corresponding to command CMD2 is written to logical address sLBA+32 with a data length of 60KB. The host reads 128KB of data starting from logical address sLBA to obtain data D1, and reads 60KB of data starting from logical address sLBA+32 to obtain data D2.
[0111] Step 416 does not need to occur before step 418. The storage device can use a cache to record the data (CD1 and CD2) to be written to the NVM, and notify the host that the commands (CMD1 and CMD2) are complete before data CD1 and / or CD2 are written to the NVM. Optionally, the host provides additional flush commands to instruct the storage device to write the cached data (CD1 and CD2) to the NVM.
[0112] Figure 4B A schematic diagram illustrating address space mapping according to an embodiment of this application is shown.
[0113] See also Figure 4A After processing commands CMD1 and CMD2, the FTL table entries record the NVM address corresponding to the logical address index sLBA (i.e., sLBA+0) (this NVM address stores the compressed data CD1, which is 16KB in size). The FTL table entries also record the NVM address corresponding to the logical address index sLBA+32 (this NVM address stores the compressed data CD2, which is 4KB in size). The FTL table entries also record the NVM address corresponding to the logical address index sLBA+40 (this NVM address stores the corresponding command CMD3...). Figure 4B The compressed data (CD2, not shown in the image) is shown.
[0114] Figure 4B The physical address space indicates the data stored in the NVM, addressed by physical addresses (i.e., NVM addresses). Optionally, the NVM also provides additional storage space to hold metadata for the data, including, for example, the logical address of the corresponding data, the length of the compressed data, and / or the length of the data before compression. Based on the length of the compressed data, it can be determined, for example, from the NVM address recorded in the FTL table, what physical address range of data belongs to the compressed data derived from the same data.
[0115] Figure 4B The logical address space indicates the data written or read by the host to the logical address index of the storage device. Data D1 occupies a 128KB address space range in the logical address space, while data D2 occupies a 60KB address space range in the logical address space. Data D1 in the logical address space corresponds to the compressed data CD1 in the physical address space, data D2 in the logical address space corresponds to the compressed data CD2 in the physical address space, and data D3 in the logical address space corresponds to the compressed data CD3 in the physical address space. Therefore, according to the embodiments of this application, the data written by the user to the storage device occupies the logical address space with its original size, and occupies the physical address space with its compressed size.
[0116] It should be noted that, according to the embodiments of this application, the logical address space and the physical address space are not in one-to-one correspondence. The size of the logical address space exceeds the size of the physical address space. The logical address space allocated to the data corresponding to each command is defined by two dimensions: the logical address space index (the starting address of the logical address space) and the size of the logical address space. Only the logical address space index is used as the index of the FTL table; other logical addresses in the logical address space cannot be used as indexes of the FTL table. Optionally, in some embodiments, the position of an FTL table entry in the FTL table implies the logical address index corresponding to that entry, but some entries are not used or are not filled with valid NVM addresses because they do not have a corresponding logical address space index. For example, see... Figure 4B The FTL table entries corresponding to logical address indices sLBA+1 to sLBA+31 are not used or filled with valid NVM addresses.
[0117] Figure 5A This is a schematic diagram of the logical address space of existing technology.
[0118] Figure 5B This is a schematic diagram of the logical address space according to an embodiment of this application.
[0119] pass Figure 5A and Figure 5B The illustration compares the distribution of data written by each command (CMD1, CMD2, and CMD3) in the logical address space of the prior art and the logical address space according to the embodiments of this application. CMD1 indicates that the data (D1) to be written is 128KB, CMD2 indicates that the data (D2) to be written is 60KB, and CMD3 indicates that the data (D3) to be written is 32KB. The three commands are processed in the order of CMD1, CMD2, and CMD3, and the starting addresses of the logical address spaces corresponding to the three commands are denoted as sLBA1, sLBA2, and sLBA3, respectively. The logical block size is 512B. The starting address of the overall logical address space is sLBA.
[0120] See Figure 5AAccording to existing technology, the logical address space is a one-dimensional space, and the distribution of data in the space is described by logical addresses. The data corresponding to command CMD1 occupies the range of logical addresses sLBA+0 to sLBA+255 (256 logical blocks) in the logical address space, with the starting address sLBA1 = sLBA+0. The data corresponding to command CMD2 occupies the range of logical addresses sLBA+256 to sLBA+315 (120 logical blocks) in the logical address space, with the starting address sLBA2 = sLBA+256. The data corresponding to command CMD3 occupies the range of logical addresses sLBA+316 to sLBA+379 (64 logical blocks) in the logical address space, with the starting address sLBA3 = sLBA+316.
[0121] See Figure 5B For the same three commands (CMD1, CMD2, and CMD3), according to the embodiments of this application, the logical address space is a two-dimensional space. The logical address space that accommodates the data corresponding to each command is expressed by two dimensions: one dimension is the logical address index of the logical address space, and the other dimension is the size of the logical address space. Since the logical address index and the size of the logical address space are two (orthogonal) dimensions, these two dimensions are not additive, and the result of adding the values of the two dimensions cannot be used for addressing the logical address space. The logical address space occupied by the data corresponding to command CMD1 is represented by <logical address index sLBA+0, size 128KB>, and the logical address space occupied by the data corresponding to command CMD2 is represented by <logical address index sLBA+32, size 60KB>. In the logical address space, the data corresponding to each command starts from the position described by the logical address index and extends in the direction described by the size dimension of the logical address space, rather than extending in the direction of the next element of the logical address index dimension.
[0122] According to embodiments of this application, the element values of the logical address index dimension of the logical address space do not need to be consecutive. Figure 5B In the example, the first element of the logical address index dimension of the logical address space is sLBA+0, the second element is sLBA+32, and the third element is sLBA+40. Other values, such as sLBA+1 to sLBA+31, are not elements of the logical address index dimension, do not have a corresponding logical address space size dimension, and cannot be used to read data.
[0123] In one implementation, in the logical address index dimension of the logical address space, the numerical difference between adjacent elements (e.g., 32 = sLBA2 - sLBA1) represents the number of logical blocks occupied by the compressed data corresponding to the preceding element in that pair of adjacent elements (e.g., 32 represents occupying 32 logical blocks). The value of each element is the sum of the number of logical blocks occupied by the compressed data corresponding to all elements preceding that element. Thus, the value of the logical address index can be used to index the existing FTL table, which can be used to map the logical address index to a physical address according to embodiments of this application. Values not used by the logical address index (such as sLBA+1 to sLBA+31) will not be found in the FTL table or will be marked as corresponding to a specified value such as "null".
[0124] In another implementation, the logical address index is not taken as a numerical value, but as an index such as a "key", and the FTL obtains the corresponding physical address by mapping the "key" to the "value".
[0125] See again Figure 5A and Figure 5B In both implementations, for each of the three processed commands (CMD1, CMD2, and CMD3), the host records the starting address (sLBA1, sLBA2, and sLBA3) and data length of the logical address space corresponding to each command. Thus, in both implementations, the host performs the same operation (only the starting address value differs, and this value comes from the parameters returned by the storage device, without requiring host calculation). Therefore, according to the embodiments of this application, data compression is provided transparently to the host without introducing additional operations.
[0126] Figure 6A A flowchart illustrating the process of reading compressed data according to an embodiment of this application is provided.
[0127] The host issues a read command to the storage device to retrieve data that has been written to the storage device (610). The read command indicates, for example, two parameters: the starting address (denoted as sLBA) and the length of the data to be read. The starting address sLBA in the read command is the starting address of the logical address space of the data written to the storage device, which is maintained by the host and received from the storage device in response to previous write commands. According to an embodiment of this application, the starting address returned by the storage device is a logical address index, which the host treats as the starting address of the logical address space, thus the host does not need to change the way the starting address is handled in the prior art.
[0128] In response to receiving a read command, the starting address sLBA and length are extracted from the read command. The storage device checks whether the starting address sLBA is a valid logical address index (615). For example, it identifies whether the retrieved sLBA is a valid logical address index by looking up the FTL table. A valid logical address index is recorded in the FTL table. Conversely, if there is no record in the FTL table, or if the FTL table indicates that the physical address corresponding to the logical address index is a specified value such as null, then the retrieved sLBA is identified as not being a valid logical address index. In response to the sLBA not being a valid logical address index (615), the storage device indicates to the host that there is an error in the read command (618).
[0129] In response to the obtained sLBA being a valid logical address index (615), the compressed data corresponding to the sLBA stored in the NVM is retrieved (620). For example, the FTL table is accessed according to the sLBA to obtain the corresponding physical address, and the NVM is accessed according to the physical address to read the data, which is the compressed data. Optionally, in order to read the data from the NVM, it is also necessary to obtain the length of the compressed data, because according to the embodiments of this application, the physical address space corresponding to each entry in the FTL table has a variable size (see also...). Figure 4B The compressed data CD1 is 16KB in size, while the compressed data CD2 is 4KB in size. In one example, length information is obtained from a specified location in the storage region indicated by the physical address (e.g., front or out-of-band storage), which indicates the number of sectors in the physical address space of the compressed data to be read. Understandably, this length information is also written to the NVM when writing data to it. In another example, the next valid logical address index (denoted as sLBA+a) after the logical address index sLBA obtained in step 610 is searched in the FTL table, and the difference (a) between the two logical address indices corresponds to the number of sectors in the physical address space of the compressed data. See also, for example, Figure 5B The logical address index corresponding to CMD1 is sLBA1. In the FTL table, the next valid logical address index after sLBA1 is sLBA2. The difference between sLBA2 and sLBA1, 32, represents the number of sectors (32) of the corresponding data of CMD1 after compression in the physical address space. In yet another example, one or more sectors of compressed data are read starting from the physical address corresponding to sLBA, until all the compressed data corresponding to the uncompressed data has been read (e.g., based on the end marker or successful decompression). The compressed data obtained in step 620 is then decompressed (625).
[0130] In yet another example, the compressed data stored in the NVM is segmented. For instance, multiple compressed packets are formed during the compression process, each packet not exceeding the size of a sector and capable of being decompressed independently. These multiple compressed packets are stored in consecutive sectors. Accordingly, compressed data from one sector is read starting from the physical address corresponding to the sLBA, and the compressed data is decompressed (625). The length of the decompressed data is compared with the length obtained from the read command in step 610. If the decompressed data is less than the length indicated by the read command, the next sector is read from the next position after the physical address corresponding to the sLBA, and the compressed data in that sector is decompressed (625). The accumulated decompressed data length is then checked to see if it reaches the length obtained from the read command. If the length of data to be read still does not reach the length indicated by the read command, the above process is repeated to read and decompress compressed data from one or more other sectors (625) until the accumulated decompressed data reaches the length of data to be read.
[0131] It should be noted that the length of data to be read by the read command (the length obtained in step 610, denoted as L) may differ from the length of data written by the previous write command. For example, see also Figure 5B The data written by command CMD1 is 128KB in length, corresponding to the logical address index sLBA1. The read command provided by the host can specify the logical address sLBA1, but the length is, for example, 58KB. The length of data to be read indicated in the read command is the length of data starting from the starting address sLBA indicated by the read command. Therefore, in step 630, the decompressed data of length L (e.g., 50KB) starting from the beginning is provided to the host as the processing result of the read command.
[0132] The host provides different formats for some read commands to the storage device. For example, some read commands do not carry length information but instead indicate the length of data to be read; for instance, each read command may specify a fixed length of data. In other cases, read commands may indicate the reading of multiple non-contiguous data segments. Figure 6B This demonstrates how such read commands are handled.
[0133] Figure 6B A schematic diagram illustrating the reading of compressed data according to yet another embodiment of this application is shown.
[0134] For example, read command 640 instructs the reader to read 2KB of data from logical address sLBA+0, 2KB of data from logical address sLBA+5, and 3KB of data from logical address sLBA+50. Each logical block size is, for example, 512B.
[0135] The FTL table records the logical address indices (sLBA+0 and sLBA+32) and the physical addresses of the NVM corresponding to each logical address index. The NVM stores compressed data (compressed data CD1 of size 16KB and compressed data CD2 of size 4KB) corresponding to these two logical address indices. The uncompressed data corresponding to compressed data CD1 is 128KB, and is stored in the logical address space according to the embodiments of this application.<sLBA+0,128KB> What it represents.
[0136] Read command 640 specifies three addresses to be read, denoted as follows:<sLBA+0,2KB> (642)<sLBA+5,2KB> (644) and<sLBA+50,3KB> (646). According to an embodiment of this application, the first address among a plurality of addresses to be read according to read command 640.<sLBA+0,2KB> (642) uses the address sLBA+0 indicated by it as a logical address index and uses it to access the FTL table to obtain the physical address of the compressed data CD1. Other addresses to be read by the read command 640 are not used as logical address indexes.
[0137] See Figure 6B Read the compressed data CD1 and decompress it to obtain the corresponding logical address space.<sLBA+0,128KB> Data D1.
[0138] The read command 640 will be used to read multiple addresses.<sLBA+0,2KB> (642)<sLBA+5,2KB> (644) and<sLBA+50,3KB> (646) Based on the relative position and length of each address with respect to the starting address of data D1 in the logical address space, linearly map it to the logical address space of data D1.<sLBA+0,128KB> The logical address space size dimension. For example, three addresses...<sLBA+0,2KB> (642)<sLBA+5,2KB> (644) and<sLBA+50,3KB> (646) Data in the logical address space size dimension corresponds to the range from 0 to 2KB, the range from 2.5KB to 2KB, and the range from 25KB to 3KB, respectively. Data in these ranges is obtained from data D1 and provided to the host as the processing result of read command 640.
[0139] Figure 6C A flowchart illustrating the reading of compressed data according to another embodiment of this application is provided.
[0140] Figure 6C The illustrated embodiments have the same Figure 6A The illustrated embodiments use the same steps (610, 615, 618, 620, 625).
[0141] According to Figure 6C In this embodiment, after decompressing all the data read from the starting address sLBA (which serves as the logical address index) in step 625, it is further determined whether the size of the decompressed data meets the data length (L) required by the read command in step 610 (650). If the size of the decompressed data exceeds the data length (L), in step 654, the decompressed data of length L from the beginning is provided to the host as the processing result of the read command. In step 650, if the size of the decompressed data is still less than the data length (L), the next valid logical address index (denoted as sLBA+a) after the logical address index sLBA obtained in step 610 is searched in the FTL table (652). Returning to step 620, the compressed data stored in the NVM corresponding to sLBA+a is obtained based on the next valid logical address index (sLBA+a). Then, the process continues through step 625 and subsequent steps until step 650, when it is identified that the cumulative length of the decompressed data after multiple reads is not less than the length of the data to be read (L), and in step 654, data of length L is output to the host as a response to the read command in step 610.
[0142] Figure 6D A schematic diagram illustrating the reading of compressed data according to yet another embodiment of this application is shown.
[0143] For example, read command 680 instructs the reading of 140KB of data from logical address sLBA+0. Each logical block size is, for example, 512B.
[0144] same Figure 6B The scenario is similar; the FTL table records the logical address indices (sLBA+0 and sLBA+32) and the physical address of the NVM corresponding to each logical address index. The NVM stores compressed data (compressed data CD1 of size 16KB and compressed data CD2 of size 4KB) corresponding to these two logical address indices. The uncompressed data corresponding to compressed data CD1 is 128KB, which is contained within the logical address space according to the embodiments of this application.<sLBA+0,128KB> The compressed data CD2 corresponds to 60KB of uncompressed data, which is represented by the logical address space according to the embodiments of this application.<sLBA+32,60KB> What it represents.
[0145] The size of the data to be read by read command 680 (140KB) exceeds the size of the decompressed data (128KB) corresponding to logical address index sLBA+0. Therefore, according to the embodiment of this application, the next logical address index (sLBA+32) immediately following logical address index sLBA+0 in the FTL table continues to provide data for read command 680. The size of the decompressed data corresponding to logical address indices sLBA+0 and sLBA+32 is 188KB, which meets the requirement of read command 680. Therefore, read command 680 corresponds to two read commands, respectively denoted as accessing the logical address space.<sLBA+0,128KB> The read command (682) and access to the logical address space<sLBA+32,12KB> The read command (684). Understandably, also see... Figure 6C When processing read command 680, steps 620 and 625 are equivalent to processing read command (682). In step 650, it is identified that not all the data required for read command 680 has been obtained, and the processing of read command (684) continues. The 128KB data read by read command 682 and the 12KB data read by read command 684 are combined as a response to read command 640.
[0146] Because of compression, the logical address space provided by the storage device is expanded.
[0147] When a host accesses a ZNS conforming to the NVMe protocol, each Zone provides the host with a logical address space that can be written sequentially, and the host maintains the starting address of the logical address space returned by the ZNS for each command. According to embodiments of this application, a compressed ZNS (referred to as a compressed ZNS) is provided to the host in a transparent manner without requiring additional host intervention. According to embodiments of this application, to provide a compressed ZNS, it is based on, for example... Figure 4A and Figure 4B The illustrated embodiment provides a method for processing commands (write or append commands) provided by the host to the compressed ZNS, and uses the allocated logical address index returned by the host as the starting address of the logical address space used for the command. The logical address space of the Zone presented to the host is a two-dimensional logical address space according to the embodiments of this application. However, the host does not need to be aware that the logical address space provided according to the embodiments of this application has two dimensions, but instead uses a method such as accessing a one-dimensional logical address space in the prior art to retrieve the data written to the storage device using the starting address and data length. See also [link to previous documentation] Figure 5BThe host wrote data D1 to a 128KB logical address space starting at sLBA+0, data D2 to a 60KB logical address space starting at sLBA+32, and data D3 to a 32KB logical address space starting at sLBA+40. Although the host would find that the starting addresses of the logical address spaces containing data D1 and D2 are only 32 logical blocks apart, and might wonder why 32 logical blocks can hold 128KB of data, this does not affect the host's access to the data written to the ZNS on the storage device. Furthermore, the host can know that the data within the ZNS is compressed.
[0148] Figure 7 A schematic diagram illustrating the zone capacity of a compressed ZNS according to an embodiment of this application is shown.
[0149] According to the NVMe protocol, Zone Nodes (ZNSs) have attributes including Zone size and Zone capacity. The Zone size represents the number of logical blocks in a Zone, while the Zone capacity represents the maximum number of logical blocks that can be used to write user data when the Zone is empty. Zone capacity is a crucial parameter for host management of Zones. For example, the host determines when to reset or reclaim a Zone, and / or selects Zones to be reclaimed, based on Zone capacity or the proportion of invalid data within that Zone. Zone capacity also influences the host's choice of Zone management strategies.
[0150] According to embodiments of this application, the Zone size provided by the storage device to the host is, for example, the number of its available logical address indices, while the Zone capacity is the sum of the size of the logical address space allocated to each piece of data after the Zone is full (represented by, for example, the number of logical blocks). Because the data is compressed, the value of the Zone capacity can exceed the Zone size.
[0151] Figure 7 A Zone according to an embodiment of this application is shown. The number of available logical address indices for the Zone is m (denoted as sLBA0, sLBA1, ..., sLBA). (m-1) ), where logical address indices (sLBA0, sLBA32, and sLBA40) are allocated logical address space to hold data (D1, D2, and D3) respectively. The Zone size attribute value of this Zone is m. Optionally, available logical address indices include unused logical address indices. Thus, for Figure 7 The demonstrated Zone can have fewer than m logical address indexes available for indexing FTL tables, for example, Figure 7In this context, the logical address index sLBA+1 cannot be used to index the FTL table, as it is not a valid logical address index.
[0152] As an example, the FTL table of a ZNS is stored in a flat array. When the ZNS is created, the size m of the Zone is specified, and m elements are reserved in the FTL table to hold logical address indices (corresponding to sLBA0, sLBA1, ..., sLBA1 respectively). (m-1) These m elements are initialized to a specified value or a null value to indicate that they are not yet valid logical address indices.
[0153] In response to a command to write data to a Zone within the ZNS, the physical address of the NVM containing the compressed data to be written is recorded in the FTL table element corresponding to the logical address index (denoted as sLBA_i) allocated to the command. The size of the (uncompressed) data (denoted as Di) to be written by the command is denoted as data length(sLBA_i). The size of the compressed data (denoted as CDi) obtained by compressing Di is denoted as CSi, and the logical block size is denoted as SS. The next valid logical address index for this Zone is then sLBA_i + [CS / SS], while logical address indices from sLBA_i + 1 to sLBA_i + [CS / SS] - 1 are not valid logical address indices. For invalid logical address indices...
[0154] The zone will remain full until it reaches its maximum capacity and then remain unchanged until the zone is reset or reclaimed.
[0155] Since the zone capacity equals the number of sectors occupied by all user data written to that zone by the host, the elements (e.g., sectors) of the address space maintained by the host for that zone correspond one-to-one with the logical blocks of the logical address space provided by the storage device for that zone. The addresses available to the host in read commands accessing that zone correspond one-to-one with the valid logical address indexes of the storage device for that zone; these valid logical addresses can be used to index entries in the FTL table. The zone's data compression ratio is obtained by dividing the zone capacity by the zone size; the zone's data compression ratio can be greater than 1.
[0156] Figure 8 A schematic diagram of a storage device providing a hybrid NS according to an embodiment of this application is shown.
[0157] The NVMe protocol defines namespaces. A namespace can be viewed as a logical storage device. A storage device can provide multiple namespaces simultaneously.
[0158] See Figure 8 The storage device provides namespaces (NS0 and NS1). Namespace NS0 is a compressed ZNS according to embodiments of this application, which, for example, includes Zone0 and Zone1. Namespace NS1 is a namespace according to the prior art.
[0159] As an example, the FTL table is a flat array, so the index of an FTL table entry is its memory location. The FTL table provides m entries for Zone0 and Zone1 respectively. Therefore, the size of Zone0 and Zone1 is m. The FTL table provides n-2m-1 entries for NS1, each entry corresponding to, for example, a logical address space of 4KB, so the capacity of NS1 is 4K*(n-2m-1).
[0160] Zone0 and Zone1 are compressed, and the index for the FTL table entry in Zone0 or Zone1 is the logical address index for Zone0 or Zone1. Figure 8 In Zone 0, for example, the FTL table entries indexed by sLBA+0, sLBA+4, and sLBA+5 record valid NVM addresses. Therefore, sLBA+0, sLBA+4, and sLBA+5 are valid logical address indexes, while logical address indexes such as sLBA+1 to sLBA+3 are not valid. For Zone 0, each entry in the FTL table corresponds to, for example, a 4KB physical storage space. The physical address space corresponding to the sLBA+0 logical address index stores a portion of the compressed data CD1. Since the compressed data CD1 is 16KB in size, it occupies four consecutive 4KB physical address spaces. These four physical address spaces correspond to four logical address indices (FTL table entries) from sLBA+0 to sLBA+3. However, the compressed data CD1 is only indexed by the logical address index sLBA+0, making logical address indices from sLBA+1 to sLBA+3 unusable. These logical address indices are marked as unusable by setting null or specified values in the FTL table entries corresponding to them. Therefore, the host can only access the compressed data CD1 through the logical address index sLBA+0, and not through the logical address indices from sLBA+1 to sLBA+3.
[0161] Therefore, in the ZNS, the size of the compressed data corresponding to a valid logical address index also determines the position of the next valid logical address index in the FTL table. Figure 8In Zone0, the logical address index sLBA+0 indexes 16KB of compressed data CD1, making the next valid logical address index sLBA+4, which indexes 4KB of compressed data CD2, and the next valid logical address index after that is sLBA+5, which indexes compressed data CD3.
[0162] In the ZNS, compressed data is stored in the physical address space, while from the perspective of the host or user, uncompressed data is contained in the logical address space. The host obtains the uncompressed data using existing techniques with the starting address and data length of the logical address space. Therefore, although the stored data is compressed in the ZNS, the host does not need additional adjustments to access the compressed data; thus, the ZNS according to this embodiment is transparent to the host. The logical space corresponding to compressed data CD1 contains data D1 (128KB in size). The logical space corresponding to compressed data CD2 contains data D2 (60KB in size). The logical space corresponding to compressed data CD3 contains data D3.
[0163] In comparison, the physical address space and logical address space of namespace NS1 have a one-to-one correspondence; a 4KB region in the physical address space corresponds to a 4KB region in the logical address space. The logical address space of namespace NS1 is defined by a logical address range, that is, by the index of FTL table entries. Therefore, the logical address space of namespace NS1 extends from sLBA+2m to sLBA+n. When a user accesses the logical address space of namespace NS1 (e.g., sLBA+2m to sLBA+n), they will obtain the data corresponding to the logical address space of each entry in the FTL table indexed by logical addresses sLBA+2m to sLBA+n. However, the logical address space of NS0 does not extend from logical addresses sLBA0 to sLBA+2m-1, but is a combination of the logical address spaces corresponding to all valid logical address indices from sLBA+0 to sLBA+2m-1. Therefore, when a user accesses the logical address space of namespace NS0 (e.g., sLBA0 to sLBA+2m-1), they will obtain the logical address space to hold data D1, the logical address space to hold data D2, the logical address space to hold data D3, and so on, as well as the logical address space corresponding to the last valid logical address index from sLBA+0 to sLBA+2m-1. Thus, as an example, if the capacity of namespace NS0 is C0, and the host issues a read command indicating the starting address sLBA0 and the size C0, when processing this command, data D1 will be read starting from sLBA+0, which serves as the logical address index. Next, the next valid logical address index (sLBA+4) will be obtained from the entry for NS0 in the FTL table, along with the data D2 corresponding to that valid logical address, and so on, until the last valid logical address index in the entry for NS0 in the FTL table is obtained, and its corresponding data is retrieved. The sum of the lengths of all these data is C0. Understandably, after retrieving data D1 or compressed data CD1 based on the valid logical address index sLBA+0, the position of the next valid logical address index in the FTL table can be determined based on the size of the compressed data CD1 (the increment of the position of the next valid logical address index relative to the position of the current valid logical address index is [CS1 / SS], where CS1 is the size of the compressed data CD1 and SS is the logical block size). Optionally, the valid logical address index can also be identified by traversing the FTL table starting from the current valid logical address index (e.g., sLBA+0) and based on the value of the FTL table entry.
[0164] Therefore, according to embodiments of this application, the storage device simultaneously provides multiple namespaces with different attributes. For example, namespace NS0 has high storage capacity or high density (due to data compression) (relative to NS1), while namespace NS1 has high performance and better QoS (Quality of Service) (relative to NS0). Users can record data in different namespaces according to their needs.
[0165] Figure 9 A schematic diagram illustrating the use of a hybrid NS according to an embodiment of this application is shown.
[0166] The creation, use, and reclamation of Zones require host management. The host also needs to ensure that data written to a Zone is in address order, as Zones do not support random writes. However, some scenarios or data itself require random writes, such as Zone capacity. Zone capacity is metadata describing a Zone. During the process of writing data to a Zone according to embodiments of this application, the Zone capacity may change as data is written. Random writes can better update metadata such as Zone capacity.
[0167] See Figure 9 The storage device provides a compressed ZNS namespace NS0, where the host creates and uses a Zone (denoted as host Zone0). The storage device's NS1 namespace is a namespace that supports random writes, where the host records metadata for host Zone0 in NS1. This fully utilizes the high storage density of NS0 and the better performance of NS1.
[0168] See also Figure 9 According to embodiments of this application, a host Zone 0 is also provided. Host Zone 0 is also compressed. For example, the host-managed Host Zone 0 is mapped to two zones (Zone 0 and Zone 1) on the storage device. The host may desire a different zone capacity than the storage device provides, depending on the application's needs. The host can combine two or more zones from the storage device into a single host Zone. When a single host Zone is created or reclaimed, all storage device zones providing that host Zone are created or reclaimed together. To provide host zones, the host also manages the mapping from host zones to storage device zones. Figure 9In the example, the logical address index range used by host Zone0 is the entire range of available logical address indexes (sLBA+0 to sLBA+2m-1) of storage devices Zone0 and Zone1, thereby determining which Zone of the storage device provides the logical address index based on the logical address index accessing host Zone0, and accessing the Zone of the storage device using the logical address index in accordance with the manner described in the foregoing embodiments of this application.
[0169] Figure 10A A schematic diagram illustrating a host using compressed ZNS according to an embodiment of this application is shown.
[0170] The host is coupled to a storage device according to an embodiment of this application. The storage device 1030 according to an embodiment of this application provides compressed ZNS.
[0171] Application 1010 runs on the host and accesses the storage device according to an embodiment of this application using the host logical address space. The elements of the host logical address space are referred to as host logical addresses (denoted as HLBA). The host logical addresses are the same as the logical addresses used in existing technologies such as Linux and Windows operating systems to access storage devices such as hard disks. Optionally, application 1010 uses the host logical address and host logical address space in a manner consistent with existing technologies, but the way the host provides the host logical address and host logical address space to application 1010 according to an embodiment of this application differs from existing technologies.
[0172] According to an embodiment of this application, the host further includes a host address translation unit 1020. The host address translation unit 1020 translates the host logical address into a logical address index (sLBA) for ZNS according to an embodiment of this application. For example, the host address translation unit 1020 maintains a mapping between host logical addresses (HLBAs) and logical address indexes (sLBAs). For instance, the host address translation unit 1020 includes a host FTL table, the entries of which record the mapping between host logical addresses (HLBAs) and logical address indexes (sLBAs). Optionally, the entries in the host FTL table also record the size of the logical address space corresponding to its logical address index (sLBA) (also the size of the data written to that logical address index (sLBA)).
[0173] The host accesses storage device 1030 by issuing commands such as read, write, or append to it. For example, read and write commands indicate a logical address index (sLBA), while append commands imply that storage device 1030 provides a logical address index (sLBA) to carry the written data. Optionally, in response to processing write and / or append commands, storage device 1030 also returns to the host the logical address index (sLBA) of the logical address space carrying the written data. Optionally, storage device 1030 also indicates to the host the next available logical address index (sLBA), allowing the host to update its write pointer (WP) to that next available logical address index (sLBA). For example, append commands only indicate the Zone number (as a part of the logical address index (sLBA), while storage device 1030, in response to processing append commands, indicates to the host the logical address index (sLBA) of the logical address space carrying the written data. In one example, the write command indicates the complete logical address index (sLBA) of the Zone number, and the storage device 1030, in response to processing the write command, indicates to the host the next available logical address index (sLBA), and optionally indicates the logical address index (sLBA) of the logical address space carrying the data to be written, wherein the logical address index (sLBA) of the logical address space carrying the data to be written may be the same as the logical address index indicated by the write command.
[0174] Figure 10B and Figure 10C A flowchart illustrating the use of compressed ZNS by a host according to an embodiment of this application is shown.
[0175] See Figure 10B The host writes data to storage device 1030. This is performed by the host's drivers, file system, and / or operating system memory, etc. Figure 10BThe process is illustrated. Application 1010 indicates a write operation to write data to the host logical address space, where the host logical address (HLBA) and the data to be written are specified, and the data to be written has a size (denoted as size). Write operation 1040 is obtained. For example, the host address translation unit (1020) allocates a Zone (1042) for the obtained write operation. The allocated Zone is represented by, for example, a Zone number (denoted as Zone#). Optionally, a Zone capable of accommodating the data to be written is allocated based on the data size corresponding to the write operation and the Zone's capacity. Understandably, if a currently allocated Zone has capacity to accommodate the data to be written, no new Zone needs to be allocated. For write commands, the logical address index for the allocated zone is also obtained. A write command or append command is submitted to storage device 1030 based on the allocated Zone, and optionally, the logical address index (sLBA) returned by storage device 103 for the write command / append command is also obtained (1044). The host address translation unit (1020) records the host logical address (HLBA) obtained in step 1040 and the logical address index (sLBA) corresponding to the write operation in the host FTL table (1046), so that the logical address index (sLBA) can be obtained by retrieving the host logical address (HLBA) from the host FTL table. For example, if step 1044 provides the storage device 1030 with a write command, the logical address index (sLBA) indicated by the write command and the host logical address (HLBA) are recorded in the host FTL table; or, for example, if step 1044 provides the storage device 1030 with an append command, the logical address index (sLBA) responded by the storage device and the host logical address (HLBA) are recorded in the host FTL table. Optionally, the size of the data written to the logical address index (sLBA) is also recorded in the host FTL table in association with the host logical address (HLBA) and the logical address index (sLBA). The size of the written data recorded in the host FTL table is not mandatory.
[0176] Optionally, for write commands, storage device 1030 also returns a logical address index (sLBA) to indicate that the write command processing is complete. The host determines the logical address index (sLBA) to be used for the next write command for the same zone based on the returned logical address index (sLBA). For a newly allocated zone, when data is first written to it, the logical address index indicated by the write command is a specified value (e.g., zone# and the value 0).
[0177] See Figure 10C The host reads data from storage device 1030. This is executed by the host's drivers, file system, and / or operating system memory, etc. Figure 10CThe process is illustrated. Application 1010 instructs a read operation to read data from the host logical address space, indicating the host logical address (HLBA) and the size of the data to be read. The read operation is obtained 1050. The host address translation unit 1020 queries the host FTL table using the host logical address (HLBA) indicated by the read operation and obtains the corresponding logical address index (sLBA) (1052). Optionally, if the corresponding logical address index (sLBA) cannot be obtained through the host FTL table, it indicates that the read command has an error and an incorrect host logical address HLBA has been accessed.
[0178] A read command (1054) is submitted to storage device 1030 based on the obtained logical address index (sLBA) and the size of the data to be read. The data read by the read command is then retrieved from storage device 1030 (1056).
[0179] Referring back to step 1052, optionally, if the host FTL table entries record the data size corresponding to the logical address index (sLBA), then the data size recorded in the host FTL table entries allows for a linear mapping between the host logical address space and the two-dimensional logical address space provided by the compressed ZNS zone of storage device 1030. For example, the logical address spaces indicated by each logical address index (sLBA) are sorted according to the size of the logical address index (sLBA) and sequentially correspond to spaces of the same size in the host logical address space as the logical address spaces indicated by the logical address index (sLBA).
[0180] Therefore, in step 1052, if for a certain host logical address (HLBA), there is no corresponding logical address index (sLBA) recorded in the host FTL table, then the host logical address (HLBA) is mapped to one of the two-dimensional logical address spaces of the compressed ZNS based on its position in the host logical address space, and the logical address index (sLBA) corresponding to that two-dimensional logical address space is obtained. For example, see also Figure 10AIn the host FTL table, the host logical address HLBA1 indicates a host logical address of 0KB, and the logical address index sLBA1 indicates the first logical address space of Zone 0, with a size of 10KB; the host logical address HLBA2 indicates a host logical address of 10KB, and the logical address index sLBA2 indicates the second logical address space of Zone 0, with a size of 20KB; the host logical address HLBA3 indicates a host logical address of 30KB, and the logical address index sLBA3 indicates the third logical address space of Zone 0, with a size of 30KB. If application 1010 wants to read, for example, 2KB of data starting at host logical address (HLBA) 18K in the host logical address space, then the 2KB of data starting at host logical address (HLBA) 18K is mapped to the 8KB to 10KB range of the logical address space indicated by the compressed ZNS logical address index sLBA2. If application 1010 wants to read, for example, 20KB of data starting at host logical address (HLBA) 18K in the host logical address space... Therefore, data of size 2KB starting from host logical address (HLBA) 18K is mapped to the 8KB to 20KB range of logical address space indicated by logical address index sLBA2 of compressed ZNS, and the 0KB to 8KB range of logical address space indicated by logical address index sLBA3.
[0181] Continuing with step 1052, when the host logical address space corresponds to a two-dimensional logical address space provided by multiple zones, within each zone, the logical address space indicated by each logical address index (sLBA) is sorted according to the size of the logical address index (sLBA). Between zones, they are sorted according to the size of the host logical address corresponding to each zone in the host FTL table. For example, in the host FTL table, host logical address HLBA1 indicates host logical address 0KB, logical address index sLBA1 indicates the first logical address space of Zone 100, Size1 is 10KB; host logical address HLBA2 indicates host logical address 10KB, logical address index sLBA2 indicates the second logical address space of Zone 100, Size2 is 20KB; host logical address HLBA3 indicates host logical address 30KB, logical address index sLBA3 indicates the first logical address space of Zone 1, Size3 is 30KB. If application 1010 wants to read, for example, 20KB of data starting from host logical address (HLBA) 18K in the host logical address space. Therefore, data starting at 18K and in the first 20KB of the host logical address (HLBA) is mapped to the 8KB to 20KB range of the logical address space indicated by the logical address index sLBA2 of Zone 100, and the 0KB to 8KB range of the logical address space indicated by the logical address index sLBA3 of Zone 1. Understandably, the logical address index also indicates the Zone number.
[0182] according to Figure 10A , Figure 10B and Figure 10C In the illustrated embodiment, optionally, application 1010 accesses storage device 1030 in KV (key-value) format, where the host logical address (HLBA) serves as the key, and the host logical address space is the set of all possible values for the key. In the operation of adding a key-value pair to storage device 1030 (Push(K, V)), the logical address index (sLBA) corresponding to key K and the value V are provided to storage device 1030 in a write command (or in an append command, value V is written to storage device 1030 and the corresponding logical address index (sLBA) is obtained). Host address translation unit 1020 records the key (replacing the host logical address (HLBA)) and the logical address index, and optionally the size of the value (V), in the host FTL table. In the operation of retrieving the value corresponding to the same key from storage device 1030 (Get(K)), host address translation unit 1020 queries the host FTL table using key K to obtain the corresponding logical address index and submits it to storage device 1030 in a read command.
[0183] Therefore, according to Figures 10A-10CIn the illustrated embodiment, application 1010 is unaware that storage device 1030 compresses the stored data. Application 1010 accesses storage device 1030 using the host logical address HLBA space. Storage device 1030 transparently provides compressed ZNS to application 1010. In an alternative implementation, host 1010 may be aware that storage device 1030 differs from prior art block devices that support ZNS because when application 1010 accesses the host logical address HLBA space, it only uses a subset of its elements (host logical addresses HLBA) that have corresponding logical address indices (sLBA) in the host FTL table. Application 1010 cannot use other elements in the host logical address HLBA space, and when accessing these elements, application 1010 will receive an error and be unable to retrieve the corresponding data.
[0184] Figure 11A A schematic diagram of the zLBA space of the Zone for compression of ZNS according to an embodiment of this application is shown.
[0185] According to embodiments of this application, each zone of the compressed ZNS provides a zLBA space to the host. The zLBA space is a one-dimensional linear space, and its elements are denoted as zLBA. The elements of the zLBA space correspond to or have a one-to-one correspondence with the elements of the host HLBA space corresponding to that zone. When the logical block (sector) size of the host HLBA space is the same as the logical block size of the zLBA space, the elements of the zLBA space correspond one-to-one with the elements of the host HLBA space corresponding to that zone.
[0186] Figure 11A It shows a single zone, whose size is the number of available logical address indexes, and whose total capacity is the sum of the sizes of the two-dimensional logical address spaces corresponding to all valid logical address indexes after the zone is filled. The size of its zLBA space is the same as the zone capacity.
[0187] In accordance with the order of valid logical address indices (e.g., size order), the two-dimensional logical address spaces corresponding to each valid logical address index are sequentially mapped to the zLBA space. Figure 11A In the example, the effective logical address sLBA+0 corresponds to a two-dimensional logical address space of 128KB (D1), and the corresponding zLBA space consists of 256 logical blocks starting from 0 (each logical block is 512 bytes in size); the effective logical address sLBA+32 corresponds to a two-dimensional logical address space of 60KB (D2), and the corresponding zLBA space consists of 120 logical blocks starting from 256; the effective logical address sLBA+40 corresponds to a two-dimensional logical address space of 32KB (D2), and the corresponding zLBA space consists of 64 logical blocks starting from 376.
[0188] By introducing the zLBA space, the two-dimensional logical address space provided by the compressed ZNS according to the embodiments of this application is mapped to a one-dimensional space to be consistent with the host logical address space HLBA in the prior art, thereby facilitating the host to use the storage device according to the embodiments of this application.
[0189] Figure 11B A schematic diagram illustrating a host using a compressed ZNS according to another embodiment of this application is shown.
[0190] The host is coupled to storage device 1130 according to an embodiment of this application. Storage device 1130 according to an embodiment of this application provides compressed ZNS. Application 1110 runs on the host and accesses storage device 1130 according to an embodiment of this application using host logical address (HLBA).
[0191] According to an embodiment of this application, the host further includes (maintaining) a host FTL table 1120 for maintaining the mapping between host logical addresses HBA and zLBA. Entries in the host FTL table 1120 do not need to record the size of the zLBA space corresponding to their zLBA. Optionally, the zLBA in an entry of the host FTL table includes the zone number (zone#) and the offset value in the zLBA space provided by that zone. Since the zLBA space is one-dimensional linear, the host logical address HLBA in the host FTL table 1120 can also be one-dimensional linear, and each element of the host logical address HLBA space can obtain a corresponding zLBA in the host FTL table 1120.
[0192] The host also includes (maintains) a compression table 1125. Entries in compression table 1125 record the logical address index of a zone and its corresponding two-dimensional logical address space size. Optionally, entries in compression table 1125 also record the zone number (zone#) to which their logical address index belongs. Optionally, a portion of the logical address index indicates the zone#.
[0193] By using compression table 1125, zLBA can be mapped to the logical address space corresponding to the logical address index. See also the mapping method. Figure 11A .
[0194] The host accesses storage device 1130 by issuing commands such as read, write, or append to it. For example, read and write commands specify a logical address index (sLBA), while append commands imply that storage device 1130 provides a logical address index (sLBA) to carry the written data. Optionally, in response to processing write and / or append commands, storage device 1130 also returns to the host a logical address index (sLBA) of the logical address space carrying the written data.
[0195] Figure 11C and Figure 11D A flowchart illustrating the use of compressed ZNS by a host according to an embodiment of this application is shown.
[0196] See Figure 11C The host writes data to storage device 1130. This is performed by the host's drivers, file system, and / or operating system memory, etc. Figure 11C The process is illustrated. Application 1110 indicates a write operation to write data to the host logical address space, where the host logical address (HLBA) and the data to be written have a size (denoted as size) are specified. A write operation 1140 is retrieved. zLBA space is allocated for the retrieved write operation (1142). The allocated zLBA space is represented by one or more zLBAs. A zLBA includes, for example, a Zone number (Zone#) and an offset value within the zLBA space provided for that zone. The size of the allocated zLBA space is determined based on the size (size) of the data to be written in the write operation.
[0197] Write or append commands are submitted to storage device 1130 based on the allocated zLBA space. For write commands, the logical address index (sLBA) of the zone for the allocated zLBA space is indicated in the write command. For append commands, the logical address index (sLBA) returned by storage device 1130 to indicate that the write command processing is complete is obtained (1144). Optionally, for write commands, storage device 1130 also returns a logical address index (sLBA) to indicate that the write command processing is complete, and the host determines the logical address index (sLBA) to be used for the next write command for the same zone based on the returned logical address index (sLBA). For newly allocated zones, when data is written to them for the first time, the logical address index indicated by the write command is a specified value (e.g., zone# and the value 0).
[0198] The host logical address (HLBA) obtained in step 1140 and the zLBA space obtained in step 1042 (1146) are recorded in the host FTL table 1120. Optionally, if the data to be written in the write operation corresponds to multiple host logical addresses HLBA, multiple entries are recorded in the host FTL table 1120, each entry corresponding to one of the host logical addresses HLBA, and each entry also records the zLBA corresponding to the same HLBA.
[0199] Record the logical address index obtained in step 1144 and the size of the written data (1148) in the compression table 1125.
[0200] See Figure 11DThe host reads data from storage device 1130. This is executed by the host's drivers, file system, and / or operating system memory, etc. Figure 11D The process is illustrated. Application 1110 instructs a read operation to read data from the host logical address space, indicating the host logical address (HLBA) and the size of the data to be read. Read operation 1150 is obtained. The host FTL table is queried using the host logical address (HLBA) indicated by the read operation, and a zLBA is obtained (1152). Based on the obtained zLBA, the logical address index (sLBA) corresponding to zLBA is determined according to compression table 1125 (1154). Optionally, two or more logical address indices (sLBAs) corresponding to the host logical address space to be read are determined based on the obtained zLBA, the size of the data to be read, and compression table 1125.
[0201] The length of the data to be read is determined based on the size to be read obtained in step 1150 (1156). Optionally, if the data to be read corresponds to multiple logical address indices, the length of the data to be read for each logical address index is also determined, or the range of the two-dimensional logical address space corresponding to each logical address index is determined.
[0202] A read command (1158) is submitted to storage device 1130 based on the obtained logical address index (sLBA) and the corresponding data length (Length). The data read by the read command is then retrieved from storage device 1130 (1159).
[0203] Refer back to step 1154.
[0204] For example, in the host FTL table, host logical address HLBA1 indicates logical block 0 in the host logical address space, zLBA1 indicates logical block 0 in Zone 100, host logical address HLBA2 indicates logical block 20 in the host logical address space, zLBA2 indicates logical block 20 in Zone 100, host logical address HLBA3 indicates logical block 60 in the host logical address space, and zLBA3 indicates logical block 0 in Zone 1. The values of HLBA2 and HLBA1 also imply that the host logical address space from HLBA1 to HLBA2 is 20 (=20-0) logical blocks (e.g., 10KB), while the values of HLBA2 and HLBA3 imply that the host logical address space from HLBA2 to HLBA3 is 40 (=60-40) logical blocks (e.g., 20KB). Similarly, the values of zLBA1 and zLBA2 imply that the zLBA space from zLBA1 to zLBA2 is 20 logical blocks, and the values of zLBA2 and zLBA3 imply that the zLBA space from zLBA2 to zLBA3 is 40 logical blocks. Furthermore, since zLBA3 corresponds to the starting logical block of another zone (Zone 1), it also implies that the introduction of the zLBA space between zLBA2 and zLBA3 has filled the zLBA space provided by Zone 100. The compressed table 1125 records all two logical address indices (sLBA1 and sLBA) of zone 100, along with their corresponding two-dimensional logical address space sizes. These two two-dimensional logical address spaces are sequentially mapped to the zLBA space of zone 100. Since HLBA3 follows HLBA2 in the host FTL table 1120, it implies that the zLBA space provided by zone 1 (where zLBA3 resides) is ordered after the zLBA space provided by zone 100 (where zLBA2 resides). Therefore, based on the host FTL table 1120, the zLBA space corresponding to the host logical address HLBA space is obtained. And based on the compressed table 1125, the position of the two-dimensional logical address space corresponding to each logical address index in the compressed table 1125 within the zLBA space is obtained. Thus, the mapping between the host logical address HLBA and the logical address index sLBA is established through the zLBA space.
[0205] Understandably, some host logical address HLBAs in host FTL table 1120 are not mapped to the starting point of the two-dimensional logical address space, but are mapped to the inside of the two-dimensional logical address space. In step 1154, the logical address index (sLBA) corresponding to the two-dimensional logical address space to which such zLBA is mapped is obtained as the determined logical address index (sLBA).
[0206] Therefore, according to Figure 11A-11DIn the illustrated embodiment, host FTL table 1120 maintains a linear host logical address HLBA space to a linear zLBA space. Thus, neither application 1110 nor host FTL table 1120 needs to be aware that storage device 1130 has compressed the stored data. Application 1010 accesses storage device 1030 using the host logical address HLBA space. Storage device 1130 transparently provides the compressed zNS to application 1110 and host FTL table 1120. Optionally, each element of the host logical address HLBA space can be read by application 1110.
[0207] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application. Clearly, those skilled in the art can make various alterations and variations to this application without departing from its spirit and scope. Thus, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for processing I / O commands, comprising: The host provides the storage device with a first command for writing data to the first storage zone; The storage device allocates a first logical address index for the data to be written by the first command according to the write pointer WP of the first storage area. The first logical address index and the first size of the data to be written by the first command define a first logical address space. The first size is the size of the first logical address space, and the first size can accommodate the uncompressed data to be written by the first command; Compress the data to be written in the first command to obtain compressed data; store the compressed data. The address where the compressed data is stored is recorded in association with the first logical address index; And provide the first logical address index to the host, inform the host of the first logical address space allocated for the first command, the first logical address space is defined by the first logical address index and the size of the logical address space, the data to be written by the first command occupies the first logical address space with its original size, and occupies the physical address space with its compressed size; The host records the first host logical address HLBA accessed by the first command and the first logical address index in association.
2. The method according to claim 1, wherein the storage device uses the write pointer WP of the first storage region as the first logical address index, or uses the key generated based on the write pointer WP of the first storage region as the first logical address index; The method further includes: The storage device updates the write pointer WP of the first storage area according to the size of the compressed data.
3. The method according to claim 1, further comprising: The host provides a second command to the storage device for writing data to the first storage zone; The storage device allocates a second logical address index for the data to be written by the second command according to the updated write pointer. The second logical address index and the second size of the data to be written by the second command define a second logical address space. Even if the difference between the second logical address index and the first logical address index is less than the first size, the second logical address space does not overlap with the first logical address space.
4. The method according to claim 3, further comprising: The storage device compresses the data to be written by the second command to obtain the second compressed data; Store the second compressed data; The address where the second compressed data is stored is recorded in association with the second logical address index; and the write pointer is updated according to the size of the second compressed data.
5. A method for processing I / O commands, comprising: The host provides a first command to the storage device for writing data to a first storage zone, wherein the first command indicates a first logical address index; The first logical address index and the first size of the data to be written by the first command define the first logical address space; The storage device compresses the data to be written by the first command to obtain compressed data; the compressed data is then stored. The address where the compressed data is stored is recorded in association with the first logical address index; a second logical address index is generated based on the first logical address index and the size of the compressed data; and the second logical address index is provided to the host. The host records the first host logical address HLBA accessed by the first command and the first logical address index in association; The host also records, in association, the first logical address index and the first size of the data to be written by the first command.
6. The method according to claim 5, further comprising: The storage device updates the write pointer of the first storage area according to the size of the compressed data; as well as The host updates the write pointer of the first storage area using the second logical address index.
7. The method according to claim 5 or 6, further comprising: The host provides a second command to the storage device for writing data to the first storage zone, wherein the second command indicates the second logical address index; The storage device compresses the data to be written by the second command to obtain the second compressed data; and stores the second compressed data. The address where the second compressed data is stored is recorded in association with the second logical address index; a third logical address index is generated based on the second logical address index and the size of the second compressed data, and the third logical address index is provided to the host; wherein the second logical address index and the second size of the data to be written by the second command define the second logical address space.
8. The method according to claim 5, further comprising: To generate the first command, the host allocates an available storage area as the first storage area, or obtains a storage area that can accommodate the data to be written by the first command as the first storage area; And associatedly record the first host logical address HLBA accessed by the first command and the first storage area.
9. The method of claim 5, wherein the first logical address index indicates the first storage region.
10. The method of claim 5, wherein One or more host logical addresses of the host do not have an associated logical address index; In response to the request to read data from a third host logical address, if the host does not record a logical address index associated with the third host logical address, it indicates an error; if the host obtains a third logical address index associated with the third host logical address, it provides a third command to the storage device for reading data from the third logical address index.
11. The method according to claim 5, wherein, One or more host addresses of the host do not have associated logical address indexes; in response to reading data from a third host logical address, if the host does not record a logical address index associated with the third host logical address, it determines the third logical address space corresponding to the third host logical address based on the recorded logical address index and its associated size, uses the third logical address index defining the third logical address space as the logical address index associated with the third host logical address, and obtains the starting position of the data to be read from the third host logical address in the third logical address space based on the difference between the third host logical address and the host logical address associated with the third logical address recorded by the host, and provides a third command to the storage device for reading data from the third logical address index; if the host obtains a third logical address index associated with the third host logical address, it provides a third command to the storage device for reading data from the third logical address index.
12. The method according to claim 5, further comprising: To generate the first command, the host allocates a first zLBA space from the zLBA space of the first storage area, the size of which is sufficient to accommodate the data to be written by the first command. The zLBA space of the first storage area is a one-dimensional linear space with the same size as the capacity of the first storage area, and each element is addressed by zLBA. The host records the first host logical address HLBA accessed by the first command and the first zLBA space in association, and the elements of the host logical address HLBA space defined by the first host logical address HLBA and the first size correspond to the elements of the first zLBA space.
13. The method of claim 12, further comprising: In response to the need to read data from a third host logical address, the host obtains a third zLBA associated with the third host logical address, determines the third logical address space corresponding to the third zLBA based on the recorded logical address index and its associated size, uses the third logical address index defining the third logical address space as the logical address index associated with the third host logical address, and provides a third command to the storage device for reading data from the third logical address index.
14. The method according to claim 13, wherein, The host also obtains the starting position of the data to be read from the third host logical address in the third logical address space based on the difference between the third zLBA and the zLBA associated with the third logical address index recorded by the host, and uses a specified size of data starting from the starting position in the third logical address space as the data to be read from the third host logical address.
15. The method of claim 5, further comprising: The host provides a fourth command to the storage device for writing data to the second namespace; The storage device allocates a physical address for the data to be written by the fourth command; The logical address of the host accessed by the fourth command is recorded and stored in association with the allocated physical address; wherein the second namespace is different from the namespace of the first storage area Zone, and wherein the data to be written by the fourth command is metadata for the data to be written by the first command.
16. The method of claim 5, wherein logical address indexes in the storage device that are not associated with NVM addresses are invalid logical address indexes; and logical indexes associated with NVM addresses are valid logical address indexes; and wherein the storage area capacity of the storage area is obtained by summing the sizes of all logical address spaces defined by all valid logical address indexes of the storage area.
17. The method of claim 5, wherein the host provides the storage device with a fifth command for reading data from a fifth logical address index; the method further comprises: the storage device identifying whether the fifth logical address index is a valid logical address index; if the fifth logical address index is a valid logical address index, reading the fifth compressed data according to the fifth logical address index; decompressing the fifth compressed data to obtain fifth decompressed data; and using all or part of the fifth decompressed data as the processing result of the fifth command.
18. The method of claim 17, wherein if the fifth logical address index is not a valid logical address index, the storage device sends the processing result of the fifth command to the host, wherein the processing result of the fifth command indicates that the fifth command has an error.
19. The method of claim 17, wherein the fifth command indicates a fifth length, the method further comprising: If the size of the fifth decompressed data is less than the fifth length, the storage device further reads the sixth compressed data following the fifth compressed data according to the address of the fifth compressed data; decompresses the sixth compressed data to obtain the sixth decompressed data; repeats the process of reading the next segment of compressed data according to the address of the compressed data and decompressing it, until the sum of the sizes of all the decompressed data read is not less than the fifth length; and takes the portion of all the decompressed data read as a whole that is equal to the fifth length from the beginning as the processing result of the fifth command.
20. The method of claim 17, further comprising: The host provides the storage device with a sixth command for reading data from a sixth logical address index, wherein the sixth command indicates a plurality of logical addresses and a plurality of lengths corresponding to each of the plurality of logical addresses; if the first logical address of the plurality of logical addresses is a valid logical address index, the compressed data is read according to the first logical address and decompressed to obtain the complete data of the sixth logical address space corresponding to the first logical address; according to the plurality of logical addresses indicated by the sixth command and the plurality of lengths corresponding to each of the plurality of logical addresses, multiple data segments are obtained from the complete data of the sixth logical address space as the processing result of the sixth command.
21. A method for processing I / O commands, comprising: The host provides the storage device with a first command to read data from the first storage zone; The first command indicates the first logical address index; The first logical address index and the first size of the data to be written by the first command define the first logical address space; The storage device identifies whether the first logical address index is a valid logical address index; if the first logical address index is a valid logical address index, it reads the first compressed data according to the first logical address index; and decompresses the first compressed data to obtain the first decompressed data. Provide part or all of the first decompressed data to the host as the processing result of the first command; It also includes: if the first logical address index is not a valid logical address index, the storage device sends the processing result of the first command to the host, and the processing result of the first command indicates that there is an error in the first command; The length of the first compressed data read by the storage device according to the first logical address index is obtained from the NVM according to the first logical address index, or determined according to the distance between the first logical address index and the next valid logical address index.
22. The method of claim 21, wherein the first command further indicates a first length of data to be read; the method further comprises: If the size of the first decompressed data is less than the first length, the second compressed data following the first compressed data on the NVM is read from the address of the first compressed data on the NVM; the second compressed data is decompressed to obtain the second decompressed data; the process of reading the next segment of compressed data and decompressing it according to the address of the compressed data is repeated until the sum of the sizes of all the decompressed data read is not less than the first length; the part of all the decompressed data read as a whole that is equal to the first length from the beginning is taken as the processing result of the first command.
23. The method of claim 21, further comprising: The host provides a second command to the storage device for reading data from the first storage zone; The second command indicates multiple logical addresses and multiple lengths corresponding to each of the multiple logical addresses; if the first logical address of the multiple logical addresses is a valid logical address index, the compressed data is read out according to the first logical address, and decompressed to obtain the complete data of the second logical address space corresponding to the first logical address; Based on the plurality of logical addresses indicated by the second command and the plurality of lengths corresponding to each of the plurality of logical addresses, multiple data segments are obtained from the complete data of the second logical address space as the processing result of the second command.
24. The method of claim 21, further comprising: The host provides a third command to the storage device for reading data from the first storage zone, wherein the third command indicates a third logical address index and a third length; If the third logical address index is a valid logical address index, the storage device reads the third compressed data according to the third logical address index; decompresses the third compressed data to obtain the third decompressed data; if the length of the third decompressed data is less than the third length, it also obtains the next valid logical address index adjacent to the third logical address index from the FTL table according to the third logical address index, reads the fourth compressed data according to the address of the next valid logical address index, decompresses the fourth compressed data to obtain the fourth decompressed data; and takes the portion of all the decompressed data read as a whole, starting from the beginning and equal to the third length, as the processing result of the third command.
25. The method of claim 24, wherein if the sum of the length of the third decompressed data and the length of the fourth decompressed data is less than the third length, the next valid logical address index is obtained from the FTL table, and the compressed data is read from the NVM according to the obtained valid logical address index, wherein the sum of the lengths of the decompressed data of all the directly read compressed data is not less than the third length.
26. The method of claim 21, further comprising: The host provides a fourth command to the storage device for writing data to the first storage zone; The storage device allocates a fourth logical address index for the fourth command, and the fourth logical address index and the fourth size of the data to be written by the fourth command define a fourth logical address space; Compress the data to be written in the fourth command to obtain compressed data; store the compressed data. The address where the compressed data is stored is recorded in association with the fourth logical address index; And provide the fourth logical address index to the host; the host records the fourth host logical address HLBA accessed by the fourth command and the fourth logical address index in association.
27. The method of claim 21, further comprising: The host provides a fourth command to the storage device for writing data to the first storage zone, wherein the fourth command indicates a fourth logical address index; The storage device compresses the data to be written by the fourth command to obtain compressed data; and stores the compressed data. The address where the compressed data is stored is recorded in association with the fourth logical address index; a fifth logical address index is generated based on the fourth logical address index and the size of the compressed data, and the fifth logical address index is provided to the host; the host records the fourth host logical address HLBA accessed by the fourth command and the fourth logical address index in association.
28. A method for processing I / O commands, comprising: Obtain the first command for writing data to the first storage zone; The first logical address index is allocated to the data to be written by the first command according to the write pointer WP of the first storage area. The first logical address index and the first size of the data to be written by the first command define the first logical address space. The first size is the size of the first logical address space and can accommodate the uncompressed data to be written by the first command. Compress the data to be written in the first command to obtain compressed data; store the compressed data. The address where the compressed data is stored is recorded in association with the first logical address index; And provide the first logical address index as a response to the first command, thereby informing the host of the first logical address space allocated for the first command. The first logical address space is defined by two dimensions: the first logical address index and the size of the logical address space. The data to be written by the first command occupies the first logical address space with its original size, and occupies the physical address space with its compressed size.
29. A storage system, wherein the storage system includes a host and a storage device; the host issues a first command to the storage device for writing data to a first storage zone; The first command acquired by the storage device; The first logical address index is allocated to the data to be written by the first command according to the write pointer WP of the first storage area. The first logical address index and the first size of the data to be written by the first command define the first logical address space. The first size is the size of the first logical address space and can accommodate the uncompressed data to be written by the first command. Compress the data to be written in the first command to obtain compressed data; store the compressed data. The address for storing the compressed data is recorded in association with the first logical address index; the data to be written by the first command is compressed to obtain compressed data; the compressed data is stored; the address for storing the compressed data is recorded in association with the first logical address index; And provide the first logical address index as a response to the first command; The host obtains the processing result of the first command for writing data provided by the storage device, and records in association the logical address index indicated by the processing result of the first command for writing data and the host logical address accessed by the first command for writing data.
30. A storage system, wherein the storage system includes a host and a storage device; the host issues a first command to the storage device for writing data to a first storage area; The storage device obtains the first command, wherein the first command indicates a first logical address index; The first logical address index and the first size of the data to be written by the first command define a first logical address space; the data to be written by the first command is compressed to obtain compressed data; the compressed data is stored; the address where the compressed data is stored is recorded in association with the first logical address index; a second logical address index is generated according to the first logical address index and the size of the compressed data, and the second logical address index is provided as a response to the first command; the host obtains the response to the first command provided by the storage device, and updates the write pointer of the first storage area according to the logical address index indicated by the response to the first command; the host records the first host logical address HLBA accessed by the first command and the first logical address index in association; wherein the host also records the first logical address index and the first size of the data to be written by the first command in association.
Citation Information
Patent Citations
Storage device for compressing and storing data
WO2015162755A1