Host-Managed Hardware Compression with Partitioned Namespaces
By introducing a compression engine into the controller of a solid-state driver, the data is compressed from multiple logic blocks to a small number of logic blocks when processing large-scale data writing, the problem of complexity of compression algorithms in the prior art is solved and simpler and more reliable data storage is achieved.
Patent Information
- Application Number
- CN202110639618.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-02-24
- Filing Date
- 2021-06-08
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-06-08
AI Technical Summary
Complexity of compression algorithms leads to increased costs and production plans when existing storage devices process large-scale data writes, while uncertain compression reliability.
The compression engine is introduced into the controller of the solid-state drive, receiving additional commands for ZNS partitions, compressing data from multiple logical blocks into a small number of logical blocks, and writing compressed data to the medium, recording the media logical block address and host logical block address.
By simplifying the compressed data method, the complexity of storage device hardware and firmware is reduced, the increase in costs and production plans is reduced, while improving the reliability of compression.
Smart Images

Figure CN114077547B_ABST
Abstract
Description
[0001] Cross - Reference to Related Applications
[0002] This application claims the benefit of U.S. Provisional Patent Application Serial No. 63 / 066,739, filed on August 17, 2020, which is incorporated herein by reference. Background Art Technical Field
[0004] Embodiments of the present disclosure generally relate to storage devices, such as solid - state drives (SSDs).
[0005] Description of the related art
[0006] Storage devices such as SSDs can be used in computers for applications that require relatively low latency and high - capacity storage. For example, SSDs can exhibit lower latency than hard disk drives (HDDs), especially for random reads and writes. Generally, the controller of an SSD receives commands to read or write data from a host device
[0007] to a memory device. Data is read and written to one or more blocks in the memory device. Each block is associated with a logical block address such that the SSD and / or the host device knows where the data is stored.
[0008] One or more blocks can be grouped together by their respective logical block addresses to form multiple partitions in a zoned - namespace (ZNS) architecture. Within any particular partition, data from the host can only be written to the media sequentially. When there are no more writable blocks within a partition, the partition is full or full - loaded. The host can request the SSD to reset the full or full - loaded partition. When the partition is reset, the data stored in that partition is erased so that the host can write new data to the newly erased partition.
[0009] The controller of the SSD maintains a write pointer for each partition, indicating where new host data will be appended to that partition. The host can issue a write operation via a ZNS partition append command. Whenever the host appends data to a partition using the ZNS partition append command, the SSD returns the LBA or sector of the first block of the written data. The returned LBA or sector of the first block of the written data indicates the location of the programmed data on the media. The host can use this information to manage and track the layout of data on the media.
[0010] The host device can send write commands of any size to the storage device. Since the write commands can be of any size, the aggregated size of the data written to the storage device can quickly reach the storage capacity of the storage device. However, by utilizing a compression algorithm, the size of the data written to a block can be smaller than the size of the data received from the host. Current compression solutions can complicate the storage device hardware and firmware, resulting in increased costs and production schedules, as well as uncertainty in compression reliability.
[0011] Therefore, a new method for compressing data is needed. SUMMARY OF THE INVENTION
[0012] The present disclosure generally relates to data storage devices, such as solid state drives. The data storage device includes a controller that includes a compression engine. The controller receives a ZNS partition append command for writing data to a medium, such as non-volatile memory. The compression engine compresses the data from a first number of logical blocks to a second number of logical blocks. The compressed data is programmed to the medium. The compressed data has a media logical block address and a host logical block address, where the media logical block address is the actual LBA where the data storage device places the data on the medium, and the host logical block address is the location of the data stored on the medium from the perspective of the host.
[0013] In one embodiment, a data storage device includes: non-volatile storage units, where the capacity of the non-volatile storage units is divided into multiple partitions; and a controller coupled to the non-volatile storage units. The controller includes a compression engine. The controller is configured to receive from a host device one or more commands for writing data to a first partition of the multiple partitions, where each command includes one or more data chunks, compress one or more of the one or more data chunks into compressed data using the compression engine, where the one or more chunks are compressed into one or more grains, and write the compressed data to a first location in the first partition.
[0014] In another embodiment, a data storage device includes: non-volatile storage units, where the capacity of the non-volatile storage units is divided into multiple partitions; and a controller coupled to the non-volatile storage units. The controller includes a compression engine. The controller is configured to receive from a host device one or more commands for writing data to a first partition of the multiple partitions, receive data associated with the one or more commands from the host device, group the received data into chunks, compress the data associated with the one or more commands from chunks to an integer number of grains using the compression engine at a compression ratio, write the compressed data associated with the one or more commands to a first location in the first partition, record the first location, where the first location includes a media logical block address (LBA) and a host LBA, and report the host LBA to the host device.
[0015] In another embodiment, a data storage device includes: non-volatile storage units, wherein the capacity of the non-volatile storage units is divided into a plurality of partitions. The data storage device further includes: means for compressing data received from a host device, wherein the means for compressing data is coupled to the non-volatile storage units; means for writing the compressed data to a logical block address (LBA) range in at least one of the plurality of partitions, wherein the means for writing the compressed data is coupled to the non-volatile storage units; and means for reporting a host LBA range to the host device, wherein the host LBA range is different from the LBA range to which the compressed data is written, and wherein the means for reporting is coupled to the non-volatile storage units. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Accordingly, a more particular description of the above-described features of the present disclosure, as well as a more specific description of the present disclosure, and the above brief summary, can be obtained by reference to the embodiments, some of which are illustrated in the accompanying drawings. It should be noted, however, that the drawings only illustrate typical embodiments of the present disclosure and should not be considered as limiting its scope, as the present disclosure may admit other equally effective embodiments.
[0017] Figure 1 is a schematic block diagram showing a storage system according to one embodiment.
[0018] Figure 2A shows a partitioned namespace utilized in a storage device according to one embodiment.
[0019] Figure 2B shows, according to one embodiment, for Figure 2A a state diagram of a partitioned namespace of a storage device.
[0020] Figure 3A shows a conventional compression solution according to one embodiment.
[0021] Figure 3B shows host-managed compression utilizing the ZNS protocol according to one embodiment.
[0022] Figure 4 shows data compression from chunks to multiple grains according to one embodiment.
[0023] Figure 5A shows a linear logical block address range according to one embodiment.
[0024] Figure 5B shows a non-linear logical block address range according to another embodiment.
[0025] Figure 6Illustrates appending a header to a media LBA according to one embodiment.
[0026] Figure 7 Illustrates a specific implementation of host-managed compression using the ZNS protocol according to one embodiment.
[0027] Figure 8 Illustrates a method for writing data to a location in a non-volatile memory according to one embodiment.
[0028] Figure 9 Illustrates a method for reading data from a location in a non-volatile memory according to one embodiment.
[0029] For ease of understanding, wherever possible, the same reference numerals are used to denote the same elements common to the figures. It is contemplated that elements disclosed in one embodiment may be advantageously utilized in other embodiments without specific recitation. Detailed Description
[0030] In the following, reference is made to embodiments of the present disclosure. However, it should be understood that the present disclosure is not limited to the specifically described embodiments. Instead, any combination of the following features and elements (whether or not associated with different embodiments) is contemplated to implement and practice the present disclosure. Further, although embodiments of the present disclosure may achieve advantages over other possible solutions and / or over the prior art, whether a particular advantage is achieved by a given embodiment is not a limitation of the present disclosure. Thus, the following aspects, features, embodiments, and advantages are illustrative only and are not to be considered elements or limitations of the appended claims unless expressly recited therein. Similarly, references to "the present disclosure" should not be construed as a generalization of any inventive subject matter disclosed herein and should not be considered an element or limitation of the appended claims unless expressly recited therein.
[0031] The present disclosure generally relates to data storage devices, such as solid state drives. The data storage device includes a controller that includes a compression engine. The controller receives a ZNS partition append command for writing data to a medium such as a non-volatile memory. The compression engine compresses the data from a first number of logical blocks to a second number of logical blocks. The compressed data is programmed to the medium. The compressed data has a media logical block address and a host logical block address, where the media logical block address is the actual LBA where the ZNS append places the data on the media, and the host logical block address is the location of the data stored on the media from the perspective of the host.
[0032] Figure 1FIG. 0 is a schematic block diagram showing a storage system 100 according to one or more techniques of the present disclosure, where a data storage device 106 can be used as a storage device for a host device 104. For example, the host device 104 can utilize a non-volatile memory (NVM) 110 included in the data storage device 106 to store and retrieve data. The host device 104 includes a host DRAM 138. In some examples, the storage system 100 can include multiple data storage devices that can operate as a storage array, such as the data storage device 106. For example, the storage system 100 can include multiple data storage devices 106 that are configured to collectively serve as a redundant array of inexpensive / independent disks (RAID) for the mass storage device of the host device 104.
[0033] The storage system 100 includes a host device 104 that can store data to and / or retrieve data from one or more storage devices such as the data storage device 106. As Figure 1 shown, the host device 104 communicates with the data storage device 106 via an interface 114. The host device 104 can include any of a variety of devices, including computer servers, network-attached storage (NAS) units, desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, cellular phones such as so-called "smart" phones, so-called "smart" tablets, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc.
[0034] The data storage device 106 includes a controller 108, an NVM 110, a power supply 111, a volatile memory 112, an interface 114, and a write buffer 116. In some examples, for clarity, the data storage device 106 can include Figure 1 additional components not shown in FIG. For example, the data storage device 106 can include a printed circuit board (PCB) to which the components of the data storage device 106 are mechanically attached, and the printed circuit board includes conductive traces that electrically interconnect the components of the data storage device 106, etc. In some examples, the physical size and connector configuration of the data storage device 106 can conform to one or more standard form factors. Some exemplary standard form factors include, but are not limited to, 3.5" data storage devices (e.g., HDD or SSD), 2.5" data storage devices, 1.8" data storage devices, peripheral component interconnect (PCI), PCI extension (PCI-X), PCI Express (PCIe) (e.g., PCIe x1, x4, x8, x16, PCIe Mini Card, MiniPCI, etc.). In some examples, the data storage device 106 can be directly coupled (e.g., directly soldered) to the motherboard of the host device 104.
[0035] The interface 114 of the data storage device 106 may include one or both of a data bus for exchanging data with the host device 104 and a control bus for exchanging commands with the host device 104. The interface 114 may operate according to any suitable protocol. For example, the interface 114 may operate according to one or more of the following protocols: Advanced Technology Attachment (ATA) (e.g., Serial ATA (SATA) and Parallel ATA (PATA)), Fibre Channel Protocol (FCP), Small Computer System Interface (SCSI), Serial Attached SCSI (SAS), PCI and PCIe, Non-Volatile Memory Express (NVMe), OpenCAPI, GenZ, Cache Coherent Interface Accelerator (CCIX), Open Channel SSD (OCSSD), etc. The electrical connections of the interface 114 (e.g., the data bus, the control bus, or both) are electrically connected to the controller 108, thereby providing an electrical connection between the host device 104 and the controller 108 and allowing data to be exchanged between the host device 104 and the controller 108. In some examples, the electrical connections of the interface 114 may also allow the data storage device 106 to receive power from the host device 104. For example, as Figure 1 shown, the power supply 111 may receive power from the host device 104 via the interface 114.
[0036] The data storage device 106 includes an NVM 110, which may include a plurality of memory devices or storage units. The NVM 110 may be configured to store and / or retrieve data. For example, the storage units of the NVM 110 may receive data and a message from the controller 108 indicating to store the data in the storage unit. Similarly, the storage units of the NVM 110 may receive a message from the controller 108 indicating to retrieve data from the storage unit. In some examples, each of the storage units may be referred to as a die. In some examples, a single physical chip may include multiple dies (i.e., multiple storage units). In some examples, each storage unit may be configured to store a relatively large amount of data (e.g., 128 MB, 256 MB, 512 MB, 1 GB, 2 GB, 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB, 256 GB, 512 GB, 1 TB, etc.).
[0037] In some examples, each storage unit of the NVM 110 may include any type of non-volatile memory device, such as a flash memory device, a phase change memory (PCM) device, a resistive random access memory (ReRAM) device, a magnetoresistive random access memory (MRAM) device, a ferroelectric random access memory (F-RAM), a holographic memory device, and any other type of non-volatile memory device.
[0038] The NVM 110 may include multiple flash memory devices or storage cells. The flash memory devices may include NAND- or NOR-based flash memory devices and may store data based on the charge contained in the floating gate of the transistor for each flash memory cell. In a NAND flash memory device, the flash memory device may be divided into multiple blocks, and these blocks may be divided into multiple pages. Each of the multiple blocks within a particular memory device may include multiple NAND cells. The rows of NAND cells may be electrically connected using word lines to define the pages among the multiple pages. The corresponding cells in each of the multiple pages may be electrically connected to corresponding bit lines. Additionally, the NAND flash memory device may be a 2D or 3D device and may be a single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), or quad-level cell (QLC). The controller 108 may write data to and read data from the NAND flash memory device at the page level and erase data from the NAND flash memory device at the block level.
[0039] The data storage device 106 includes a power supply 111, which may supply power to one or more components of the data storage device 106. When operating in a standard mode, the power supply 111 may supply power to one or more components using power provided by an external device such as the host device 104. For example, the power supply 111 may supply power to one or more components using the power received from the host device 104 via the interface 114. In some examples, the power supply 111 may include one or more power storage components configured to supply power to one or more components when operating in a shutdown mode, such as in the case of ceasing to receive power from an external device. In this way, the power supply 111 may serve as an on-board backup power supply. Some examples of the one or more power storage components include, but are not limited to, capacitors, supercapacitors, batteries, etc. In some examples, the amount of electrical energy that may be stored by the one or more power storage components may be a function of the cost and / or size (e.g., area / volume) of the one or more power storage components. In other words, as the amount of electrical energy stored by one or more power storage components increases, the cost and / or size of the one or more power storage components also increases.
[0040] The data storage device 106 also includes a volatile memory 112, which may be used by the controller 108 to store information. The volatile memory 112 may include one or more volatile memory devices. In some examples, the controller 108 may use the volatile memory 112 as a cache. For example, the controller 108 may store the cached information in the volatile memory 112 until the cached information is written to the non-volatile memory 110. As Figure 1As shown, the volatile memory 112 may consume power received from the power supply 111. Examples of the volatile memory 112 include, but are not limited to, random access memory (RAM), dynamic random access memory (DRAM), static RAM (SRAM), and synchronous dynamic RAM (SDRAM (e.g., DDR1, DDR2, DDR3, DDR3L, LPDDR3, DDR4, LPDDR4, etc.)).
[0041] The data storage device 106 includes a controller 108 that may manage one or more operations of the data storage device 106. The controller 108 includes a compression engine 120 that may utilize a data compression algorithm to reduce the size of data received by the controller before programming the data into the NVM 110. For example, the controller 108 may manage reading data from the NVM 110 and / or writing data to the NVM 110. In some embodiments, when the data storage device 106 receives a write command from the host device 104, the controller 108 may initiate a data storage command to store the data in the NVM 110 and monitor the progress of the data storage command. The controller 108 may determine at least one operating characteristic of the storage system 100 and store the at least one operating characteristic in the NVM 110. In some embodiments, when the data storage device 106 receives a write command from the host device 104, the controller 108 temporarily stores the data associated with the write command in an internal memory or a write buffer 116 before sending the data to the NVM 110.
[0042] Figure 2A A view of a zoned namespace (ZNS) 202 used in a storage device 200 according to one embodiment is shown. The storage device 200 may present the ZNS 202 view to the host device. Figure 2B A state diagram 250 of the ZNS 202 of the storage device 200 according to one embodiment is shown. The storage device 200 may be Figure 1 the storage device 106 of the storage system 100. The storage device 200 may have one or more ZNSs 202, and each ZNS 202 may have a different size. In addition to the one or more zoned namespaces 202, the storage device 200 may also include one or more conventional namespaces. Further, the ZNS 202 may be a zoned block command (ZBC) for SAS, a zoned device ATA command set (ZAC) for SATA, and / or a zoned namespace for NVMe. Due to the relationship between possible logical and physical activities, host-side zoning activities may be more directly related to media activities in the zoned drive.
[0043] In storage device 200, the ZNS 202 is the number of NVMs that can be formatted into logical blocks such that the capacity is divided into multiple partitions 206a - 206n (collectively referred to as partitions 206). The NVM can be Figure 1 a memory cell or the NVM 110. Each of the partitions 206 includes a plurality of physical blocks or chunks (not shown) of memory cells or NVM 204, and each of the chunks in the chunk is associated with a plurality of logical blocks (not shown). Each of the partitions 206 in the partitions 206 can have a size aligned with the capacity of one or more chunks of the NVM or NAND device. When the controller 208 receives a command, such as from a host device (not shown) or a submission queue of the host device, the controller 208 can read data from and write data to the plurality of logical blocks associated with the plurality of chunks of the ZNS 202. Each of the logical blocks in the logical blocks is associated with a unique LBA or sector.
[0044] In one embodiment, the NVM 204 is a NAND device. The NAND device includes one or more dies. Each of the one or more dies includes one or more planes. Each of the one or more planes includes one or more chunks. Each of the one or more chunks includes one or more word lines (e.g., 256 word lines). Each of the one or more word lines can be addressed in one or more pages. For example, an MLC NAND die can use an upper page and a lower page to achieve two bits in each cell of the entire word line (e.g., 16 KiB per page). Additionally, each page can be accessed at a granularity equal to or less than a full page. The controller can frequently access the NAND with a user data granularity logical block address (LBA) size of 512 bytes. Thus, as mentioned in the following description, the NAND location is equal to a granularity of 512 bytes. Therefore, the LBA size is 512 bytes and the page size of two pages of MLC NAND is 16 KiB, which results in 32 LBAs per word line. However, the NAND location size is not intended to be limiting and is only used as an example.
[0045] When writing data to a partition, one or more logical blocks are correspondingly updated within the partition 206 to track the location of the data within the NVM 204. The data can be written to one partition 206 at a time until the partition 206 is full, or written to multiple partitions 206 such that multiple partitions 206 can be partially full. Similarly, when writing data to a specific partition 206, the data can be written one block at a time, in the order of NAND positions, page by page or word line by word line, to the multiple blocks until moving to an adjacent block (i.e., writing to the first block until the first block is full before moving to the second block), or the data can be written multiple blocks at a time, in the order of NAND positions, page by page or word line by word line, to the multiple blocks to partially fill each block in a parallel manner (i.e., writing the first NAND position or page of each block before writing to the second NAND position or page of each block). This sequential programming of each NAND position is a typical non - restrictive requirement for many NAND blocks.
[0046] When the controller 208 selects the block to store data for each partition, the controller 208 will be able to select the block during the partition open time, or it can select the block when the need to fill the first word line of that specific block is reached. This may be more different when using the method of completely filling one block before starting the next block as described above. The controller 208 can utilize this time difference to select a more optimized block on an immediate basis. The decision of which block is assigned and designated to each partition and its consecutive LBAs can occur within the controller 208 for zero or more concurrent partitions.
[0047] Each partition in the partition 206 is associated with a partition starting logical block address (ZSLBA) or a partition starting sector. The ZSLBA is the first available LBA in the partition 206. For example, the first partition 206a is associated with Z a SLBA, the second partition 206b is associated with Z b SLBA, the third partition 206c is associated with Z c SLBA, the fourth partition 206d is associated with Z d SLBA, and the nth partition 206n (i.e., the last partition) is associated with Z n SLBA. Each partition 206 is identified by its ZSLBA and is configured to receive sequential writes (i.e., writing data to the NVM 110 in the order in which write commands are received).
[0048] When data is written to partition 206, the write pointer 210 is advanced or updated to point to or indicate the next available block in partition 206 for writing data, so as to track the next write starting point (i.e., the completion point of the previous write is equal to the starting point of the subsequent write). Thus, the write pointer 210 indicates where the subsequent write to partition 206 will start. The subsequent write command is a "partition append" command, and the data associated with this subsequent write command is appended to partition 206 at the position indicated by the write pointer 210 as the next starting point. A sorted list of LBAs within partition 206 can be stored for write sorting. Each partition 206 can have its own write pointer 210. Thus, when a write command is received, the partition is identified by its ZSLBA, and the write pointer 210 determines the position where data writing starts within the identified partition.
[0049] Figure 2B A state diagram 250 of the ZNS 202 for Figure 2A is shown. In the state diagram 250, each partition can be in a different state, such as empty, open, closed, full, read-only, or offline. When a partition is empty, the partition contains no data (i.e., no block in the partition currently stores data), and the write pointer is at the ZSLBA (i.e., WP = ZSLBA). For example, when the NVM is a NAND flash memory, when a partition is empty, all blocks in the partition have just been erased. Once a write is scheduled to the partition or a partition open command is issued by the host, the empty partition will switch to an open and active partition. Partition management (ZM) commands can be used to move a partition between the partition open and partition closed states (both are active states). If a partition is active, the partition includes open blocks that can be written to, and a description of the recommended time in the active state can be provided to the host. The controller 208 includes ZM. Partition metadata can be stored in ZM and / or the controller 208.
[0050] The term "write" includes programming user data at 0 or more NAND positions in a block and / or at partially filled NAND positions in a block when the user data has not filled all available NAND positions. The term "write" can also include moving a partition to the full state due to internal drive processing needs (open block data retention issues caused by faster bit error accumulation on open blocks), the storage device 200 closing or filling a partition due to resource limitations (such as too many open partitions to track or detected defective states, etc.), or the host device closing a partition due to problems such as no more data to send to the drive, the computer shutting down, error handling on the host, limited host resources for tracking, etc.
[0051] An active partition can be open or closed. An open partition is an empty or partially filled partition that is ready to be written to and has currently allocated resources. Data received from a host device using a write command or a partition append command can be programmed into open blocks that are currently not filled with previous data. A closed partition is an empty or partially filled partition that is not currently receiving writes continuously from the host. Moving a partition from an open state to a closed state allows the controller 208 to reallocate resources to other tasks. These tasks can include, but are not limited to, other open partitions, other regular non-partitioned areas, or other controller requirements.
[0052] In both open and closed partitions, the write pointer points to a location between the ZSLBA and the end of the last LBA of the partition (i.e., WP>ZSLBA). An active partition can be switched between open and closed states according to a designation by the ZM, or this switch can occur when writes are scheduled to the partition. Additionally, the ZM can reset the active partition to clear or erase the data stored in the partition, such that the partition switches back to an empty state. Once an active partition is full, the partition switches to a full state. A full partition is a partition that is completely filled with data and has no more available sectors or LBAs for writing data (i.e., WP = ZSLBA + partition capacity (ZCAP)). In a full partition, the write pointer points to the end of the writable capacity of the partition. Read commands for the data stored in a full partition can still be executed.
[0053] A partition can have any total size, such as 256 MiB or 512 MiB. However, a small portion of each partition may be inaccessible for writing data but can still be read, such as the portion of each partition that stores parity data and one or more excluded blocks. For example, if the total size of partition 206 is 512 MiB, then the ZCAP may be 470 MiB, which is the capacity available for writing data, while 42 MiB is not available for writing data. The partition capacity (ZCAP) or writable capacity of a partition is equal to or less than the total partition storage size. The storage device 200 can determine the ZCAP of each partition when the partition is reset. For example, the controller 208 or the ZM can determine the ZCAP of each partition. When a partition is reset, the storage device 200 can determine the ZCAP of that partition.
[0054] ZM can reset a full partition, thereby scheduling the erasure of data stored in the partition, such that the partition switches back to an empty partition. When resetting a full partition, although the partition may be marked as an empty partition available for writing, the data in the partition may not be immediately cleared. However, the reset partition must be erased before switching to an open and active partition. The partition can be erased at any time between ZM reset and ZM open. When resetting a partition, the storage device 200 can determine the new ZCAP of the reset partition and update the writable ZCAP attribute in the partition metadata. An offline partition is a partition to which data cannot be written. An offline partition can be in a full state, an empty state, or a partially full state without being active.
[0055] Since resetting a partition clears all data stored in the partition or schedules the erasure of all data stored in the partition, the need for garbage collection of individual blocks is eliminated, thereby improving the overall garbage collection process of the storage device 200. The storage device 200 can mark one or more blocks for erasure. When a new partition is to be formed and the storage device 200 anticipates ZM open, the one or more blocks marked for erasure can be erased. The storage device 200 can also decide and create the physical support for the partition when erasing the blocks. Thus, once the new partition is open and the blocks are selected for forming the partition, the blocks will be erased. Additionally, each time a partition is reset, a new order of the LBA of the partition 206 and the write pointer 210 can be selected, such that the partition 206 can tolerate receiving commands out of order. Optionally, the write pointer 210 can be turned off, such that commands can be written to any starting LBA indicated by the command.
[0056] Re-reference Figure 2A When the host sends a write command to write data to the partition 206, the controller 208 pulls in the write command and identifies the write command as a write to the newly opened partition 206. The controller 208 selects a set of blocks to store the data associated with the write command for the newly opened partition 206, and the newly opened partition 206 switches to the active partition 206. The write command can be a command for writing new data or a command for moving valid data to another partition for garbage collection purposes. The controller 208 is configured to DMA read new commands from a submission queue filled by the host device.
[0057] In the empty partition 206 that has just switched to the active partition 206, data is assigned to partition 206 and a set of associated sequential LBAs of that partition starting from the ZSLBA, because the write pointer 210 designates the logical block associated with the ZSLBA as the first available logical block. This data can be written to one or more blocks or NAND locations that have been allocated for the physical location of partition 206. After writing the data associated with the write command to partition 206, the write pointer 210 is updated to point to the next LBA available for host writing (i.e., the completion point of the first write). The write data from this host write command is sequentially programmed into the next available NAND location in the block selected for the physical support of the partition.
[0058] For example, the controller 208 may receive a first write command for the third partition 206c, or a first partition append command. The host sequentially identifies which logical block of partition 206 is to be written with the data associated with the first command. Then the data associated with the first command is written to the first or next or multiple available LBAs in the third partition 206c as indicated by the write pointer 210, and the write pointer 210 is advanced or updated to point to the next available LBA for host writing (i.e., WP>0). If the controller 208 receives a second write command for the third partition 206c, or a second partition append command, then the data associated with the second write command is written to the next available LBA in the third partition 206c identified by the write pointer 210. Once the data associated with the second command is written to the third partition 206c, the write pointer 210 is again advanced or updated to point to the next available LBA for host writing. Resetting the third partition 206c moves the write pointer 210 back to the Z c SLBA (i.e., WP = 0), and the third partition 206c switches to an empty partition.
[0059] Figure 3A A conventional compression solution according to one embodiment is shown. A host such as Figure 1 host device 104 sends a write command to a storage device 302 such as Figure 1 data storage device 106 to write multiple logical blocks (NLBs) at the starting LBA. The write command may require multiple buffers, such as approximately 4 data buffers, to store the data associated with the write command. The NVMe front-end module 304 of the storage device 302 receives the NLBs and the starting LBA location. After processing the write command, the storage device 302 moves the data and buffers associated with the write command to the hardware (HW) compression module 306, where the NLBs are compressed. The compressed data is stored in a medium 308 such as Figure 1In the NVM 110, and the resulting LBA of the compressed data stored in the medium 308 is recorded at the flash translation layer (FTL) mapping table 310. After the compressed data is written to the medium 308 and the location of the compressed data is recorded in the FTL mapping table 310, the storage device 302 returns a command completion response to the host, indicating that the write command has been completed.
[0060] Figure 3B Illustrates host-managed compression using the ZNS protocol according to one embodiment. A host such as Figure 1 The host device 104 sends a write command to the storage device 302 such as Figure 1 The data storage device 106 to write multiple logical blocks (NLBs) at the partitioned LBA. Since the host can command the placement of NLBs into a partition in the memory of the storage device, such as Figure 1 The first partition of the NVM 110, the host can have a record of the data written to the NVM. The NVMe front-end module 354 of the storage device 352 receives the NLB and the target LBA of the partition. After processing the write command, the storage device 352 moves the data and buffer associated with the write command to the HW compression module 356, where the NLB is compressed. The compressed data is stored in the medium 358 (such as Figure 1 The NVM110). After the compressed data is written to the medium 358, the storage device 352 returns a command completion response to the host, indicating that the write command has been completed. In addition, the LBA allocated for the programmed write command is returned to the host, thereby notifying the host of the location of the compressed data in the NVM.
[0061] Figure 4 Illustrates compression from chunks to multiple grains according to one embodiment. A hardware compression module such as Figures 3A to 3B The HW compression modules 306, 356 operates on data chunks. A data chunk is a multiple of a power of two of logical blocks. For example, a data chunk may include approximately 2, approximately 4, approximately 8, approximately 16, approximately 32, etc. logical blocks. Each logical block may have a size of approximately 4KB, where the write to a logical block may be aligned with each 4KB logical block size. In addition, each logical block of approximately 4KB size may be referred to as a grain. Depending on the compression ratio, the data chunk is compressed to an integer number of grains. For example, the first data chunk includes approximately 16KB of data or approximately 4 grains. When the maximum compression ratio is approximately 4:1, approximately 16KB of data can be compressed to approximately 4KB of data or approximately 1 grain. However, 4:1 compression can compress 16KB of data into approximately 1 grain, approximately 2 grains, or approximately 3 grains. In some embodiments, the compression may not work, and the resulting "compressed" data size is equal to the data size before compression. The maximum achievable compression ratio may be limited by the number of grains in the uncompressed chunk.
[0062] For example, in Figure 4 , each chunk 402, 404, 406, 408 includes 4 logical blocks. If the compression ratio is approximately 4:1, the maximum compression of logical blocks from the chunk size to the granule size is approximately 4 times. The compression ratio can be determined by dividing the chunk size by the granule size. For example, if a data chunk includes 4 granules, and each granule is 4 KB in size, then the size of the chunk is approximately 16 KB. The maximum achievable compression ratio can be calculated as 16 KB / 4 KB or approximately 4:1. The first chunk 402 includes 4 logical blocks A - D. After compression, the corresponding granule of the first chunk 402 is the first compressed chunk 410 that includes 2 granules. Thus, although the maximum compression ratio is 4:1, for chunk 402, the compression can only compress the data at a ratio of 2:1. Similarly, the second chunk 404 compresses from 4 logical blocks or granules to 3 logical blocks or granules in the second compressed chunk 412, resulting in a compression ratio of 4:3 instead of the maximum 4:1. The third chunk 406 compresses from 4 logical blocks or granules to 1 logical block or granule in the third compressed chunk 414 to achieve perfect compression. The compression from 4 logical blocks or granules to 1 logical block or granule can represent a fully compressed chunk or the best - case scenario. However, if the data cannot be compressed at all, the number of logical blocks between the chunk and the associated granule remains the same. For example, the fourth chunk 408 includes 4 logical blocks or granules. After compressing the fourth chunk 408, 4 logical blocks or granules remain in the fourth uncompressed chunk 416, indicating that the 4 logical blocks or granules associated with the fourth chunk 408 are not compressed. In the description herein, for exemplary purposes, the term "logical block" may be interchangeably referred to as "granule".
[0063] Figure 5A shows a linear host logical block address range according to one embodiment. The block sequence in the host includes a first chunk having logical blocks A - D, a second chunk having logical blocks E - H, a third chunk having logical blocks I - L, and a fourth chunk having logical blocks M - P. The host attaches 16 blocks to a partition, such as the first partition among the plurality of partitions. When a compression engine (such as Figure 1 compression engine 120 of the controller 108) receives logical blocks, the compression engine compresses the data with respect to a compression ratio (such as approximately 4:1). After compressing the logical blocks of the plurality of chunks into an integer number of granules, the compressed data is written to the first partition. As described herein, the host LBA refers to the logical block address used by the host to communicate with the drive, and the media LBA refers to the data location where the ZNS append command places data within the NVM. The host LBA and the media LBA can have a relationship such as host LBA = (media LBA * constant)+offset of the block within the compressed block (e.g., the number of granules relative to the start of the compressed chunk segment).
[0064] In Figure 5AIn the case where compression can achieve a 2:1 compression ratio, the first block A-D is compressed into a first compressed block segment including logical blocks 0 and 1. Logical blocks 0 and 1 are stored in the medium and recorded as media LBA 0 and media LBA 1. When the second block E-H is compressed into a second compressed block segment, since the compression can achieve a 4:3 compression ratio, the resulting media LBA are media LBA 2, media LBA 3, and media LBA 4. However, due to the maximum achievable compression ratio of 4:1, from the perspective of the host, the next available position in the LBA space is host LBA 8, because the host believes that the first grain segment utilizes LBA0-7 (i.e., 2 media LBAs multiplied by perfect compression of 4 equals 8 host LBAs). The second block utilizes host LBAs 8 to LBA 19 in the host view of the LBA space, because the host believes that the second grain segment utilizes 12 LBAs (i.e., 3 media LBAs multiplied by perfect compression of 4 equals 12 host LBAs). Similarly, when the third block I-L is compressed into a third compressed block segment including a single media LBA 5 due to a perfect compression ratio of 4:1, host LBAs 20-23 are reported to the host, as used by the third block I-L, because the host believes that the third grain segment utilizes 4 LBAs (i.e., 1 media LBA multiplied by perfect compression of 4 equals 4 host LBAs), even though the data stored in the medium is recorded with a single media LBA. When the block is not compressed, such as the fourth block M-P, the number of media LBAs utilized matches the number of host LBAs utilized. By utilizing a linear logical block address range, the storage device can report a capacity to the device that is the compression ratio multiplied by the actual capacity of the storage device. For example, if the maximum compression ratio is approximately 4:1 and the actual capacity of the storage device is approximately 128 GB, the reported capacity can be approximately 512 GB, or 4 times the actual capacity.
[0065] When a read request including the host LBA to be read is received, the controller utilizes the host LBA to read and decompress the relevant LBA. For example, if the host LBA is 22, the drive reads and decompresses LBA 5 in the media LBA. LBA5 is found by dividing the host LBA by the maximum compression ratio, where the result is rounded down. The relevant block associated with host LBA 22 is then read and sent to the host.
[0066] Figure 5B shows a non-linear host logical block address range according to another embodiment. The block sequence in the host includes a first block having logical blocks A-D, a second block having logical blocks E-H, a third block having logical blocks I-L, and a fourth block having logical blocks M-P. The host attaches 16 blocks to a partition, such as the first partition among the plurality of partitions. When a compression engine (such as Figure 1When the compression engine 120 of the controller 108 receives a logical block, the compression engine compresses the data relative to a maximum compression ratio (such as approximately 4:1). After compressing the plurality of chunked logical blocks into an integer number of grains, the compressed data is written to the first partition. As described herein, the host LBA refers to the logical block address used by the host to communicate with the drive, and the media LBA refers to the data location where the ZNS append command places data within the NVM. The host LBA and the media LBA may have a relationship such as host LBA = (media LBA * constant) + offset of the block within the compressed block (e.g., number of grains relative to the start of the grain segment).
[0067] Unlike Figure 5A the linear logical block address range of Figure 5B the host logical block address range of the capacity is equal to the capacity of the drive. Additionally, instead of a linear host logical block address range, Figure 5B the host logical block address range of
[0068] is stepped. For example, when NLB is equal to 4, each row of each step includes 4 host LBAs. Similarly, when NLB is equal to 8, each row of each step includes 8 host LBAs.
[0069] Figure 6 Illustrates appending a header to the media LBA according to one embodiment. Figure 6 Aspects of Figures 5A to 5B may be similar to Figure 6 the embodiments described in Figure 1The controller 108) attaches a header to the media LBA after the block sequence in the host has been appended. The header includes information such as the starting logical block of each compressed chunk in the media LBA. For example, the first chunk A-D is compressed into two grains 0 and 1, the second chunk E-H is compressed into three grains 2-4, the third chunk I-L is compressed into one grain 5, and the fourth chunk is not compressed. The header includes pointers to media LBA 0, media LBA 2, media LBA 5, and media LBA 6. Media LBA 0 corresponds to the first block A, media LBA 2 corresponds to the fifth block E, media LBA 5 corresponds to the ninth block I, and media LBA 6 corresponds to the thirteenth block M.
[0070] Figure 7 Illustrates a specific implementation of host-managed compression using the ZNS protocol according to one embodiment. A host (such as Figure 1 the host device 104) appends one or more data blocks to one or more partitions of a storage device (such as an SSD). When a controller (such as Figure 1 the controller 108) receives the one or more blocks, a compression engine (such as Figure 1 the compression engine 120) compresses the data from a plurality of chunks including a first number of logical blocks or grains into a second number of logical blocks or grains. After compression, the controller returns the write pointer returned by the ZNS append command. The write pointer corresponds to the position of the LBA as seen by the host. For example, the write pointer (wrptr) 8 may be host LBA 8. However, the corresponding media LBA may be media LBA2. The host can use the write pointer to construct an index block, where the index block includes an offset value representing the write pointer, the size of the data, and a key corresponding to the data. The host's index block is appended as an index to the relevant partition of the flash media (e.g., Figure 1 the NVM 110), where the index can be appended to the last logical block of the compressed data structure (e.g., media LBA 9).
[0071] Figure 8 Illustrates a method 800 for writing data to a location in a non-volatile memory according to one embodiment. At block 802, a controller (such as Figure 1 the controller 108) of a data storage device 106 (such as Figure 1 the data storage device) receives one or more commands from a host (such as Figure 1 the host 104) to write data to a first partition among a plurality of partitions. At block 804, a compression engine (such as Figure 1The compression engine 120) uses the maximum compression ratio to compress data associated with a write command from a first chunk including a first quantity of logical blocks or grains to a first compressed chunk including a second quantity of logical blocks of multiple grains. The first quantity of logical blocks or grains may be equal to or greater than the second quantity of logical blocks or grains.
[0072] In addition, the compression engine may use a maximum compression ratio, such as a 4:1 ratio. The compression ratio may determine the maximum possible change from the first quantity of logical blocks to the second quantity of logical blocks. For example, when the compression ratio is 4:1, then 4 logical blocks may be compressed into 1 logical block, 2 logical blocks, 3 logical blocks, or not compressed, where 1 logical block indicates that 4 logical blocks have been fully compressed relative to the maximum compression ratio. Similarly, when the compression ratio is 4:1 and 8 logical blocks are compressed, the minimum quantity of the possible second logical blocks is 2 logical blocks.
[0073] At block 806, the compressed data is written to the first partition. In one embodiment, a header may be written before the compressed data. The header may include a pointer to the grain corresponding to the start of each compressed chunk. Each grain written to the first partition corresponds to a media LBA, where the media LBA represents the position of the grain in the media. At block 808, information about the compressed data (such as the position of each grain) is reported to the host. Since the host operates using a ZNS append protocol such as Figures 2A to 2B the ZNS append commands described in, the host confirms the position of the compressed data as the host LBA. In one embodiment, the host LBA range for each chunk is greater than the media LBA range of the compressed data. For example, host LBA 22 may correspond to media LBA 10. In one embodiment, the host LBA range may be a non-linear host logical block storage space, as Figure 5B described. In another embodiment, the host LBA range may be a linear host logical block storage space, as Figure 5A described.
[0074] Figure 9 FIG. 900 shows a method for reading data from a location in a non-volatile memory according to one embodiment. At block 902, a controller (such as Figure 1 controller 108 of) receives from a host (such as Figure 1 host 104 of) a request for data stored in the NVM of the storage device (such as Figure 1A read command for the compressed data in the NVM 110 of the storage device 106. At block 904, the controller determines the location of the compressed data associated with the read command. The read command may include a host LBA of the data to be read, such as host LBA 22. The controller may utilize the host LBA and the compression ratio of the compression engine to determine the media LBA to be read. For example, host LBA 22 may correspond to a set of grains including media LBA 10 to media LBA 13. Additionally, the controller may utilize the header attached to the compressed data to determine the starting grain of each compressed block.
[0075] At block 906, the controller reads the compressed data associated with the read command. Since the data is compressed into an integer number of grains, the data associated with the read command may be placed in separate adjacent grains. For example, the data associated with host LBA 22 may be in media LBA 11 and media LBA 12. At block 908, the controller determines whether the compressed data needs to be decompressed. Since the compression engine may not compress data blocks, the resulting grains are the same as the logical blocks or grains of the blocks. However, if decompression of the compressed data is required at block 908, the compression engine may decompress the data at block 910. At block 912, the decompressed data associated with the read command is delivered to the host.
[0076] By utilizing the ZNS protocol when compressing and programming data, the storage device can have a reduced storage requirement for metadata, a higher effective throughput to and from the storage medium (such as NVM), a lower power requirement to access the storage medium, and increased storage medium durability.
[0077] In one embodiment, a data storage device includes: non-volatile storage cells, wherein the capacity of the non-volatile storage cells is divided into multiple partitions; and a controller coupled to the non-volatile storage cells. The controller includes a compression engine. The controller is configured to receive, from a host device, one or more commands for writing data to a first partition of the multiple partitions, wherein each command includes one or more data blocks, compress one or more of the one or more data blocks into compressed data using the compression engine, wherein the one or more blocks are compressed into one or more grains, and write the compressed data to a first location in the first partition.
[0078] The controller is further configured to report a first location to the host device, where reporting to the host device includes providing the host device with a host delivery logical block address (LBA) range for each compressed data chunk that is greater than the actual LBA range of the compressed data. The controller is further configured to receive an index from the host device after reporting to the host device. The logical block address range is a non-linear logical block storage space. The controller is also configured to append a header to the compressed data. The header includes metadata indicating the location of the one or more chunks. The compression engine is capable of compressing data at a compression ratio, where the compression ratio determines the maximum change from a first quantity of logical blocks to a second quantity of logical blocks when compressing the data.
[0079] In another embodiment, a data storage device includes: non-volatile storage units, where the capacity of the non-volatile storage units is divided into a plurality of partitions; and a controller coupled to the non-volatile storage units. The controller includes a compression engine. The controller is configured to receive from the host device one or more commands to write data to a first partition among the plurality of partitions, receive data associated with the one or more commands from the host device, group the received data into chunks, compress the data associated with the one or more commands from the chunks to an integral number of grains using the compression engine at a compression ratio, write the compressed data associated with the one or more commands to a first location in the first partition, record the first location, where the first location includes a media logical block address (LBA) and a host LBA, and report the host LBA to the host device.
[0080] The controller is further configured to receive a read command for the compressed data stored in the first partition, determine a first location of the compressed data associated with the read command, read the data associated with the read command, and deliver the data to the host device. The read command includes a host LBA. The determination of the first location converts the host LBA to a media LBA using the compression ratio. The media LBA includes a header. The header stores the first location of each compressed chunk. The controller is further configured to determine whether the compressed data will need to be decompressed, and decompress the data determined to need decompression.
[0081] In another embodiment, a data storage device includes: non-volatile storage units, wherein the capacity of the non-volatile storage units is divided into a plurality of partitions. The data storage device further includes: means for compressing data received from a host device, wherein the means for compressing data is coupled to the non-volatile storage units; means for writing the compressed data to a logical block address (LBA) range in at least one of the plurality of partitions, wherein the means for writing the compressed data is coupled to the non-volatile storage units; and means for reporting a host LBA range to the host device, wherein the host LBA range is different from the LBA range to which the compressed data is written, and wherein the means for reporting is coupled to the non-volatile storage units.
[0082] The data storage device further includes means for receiving an index from the host device and writing the index to the non-volatile storage units. The index includes the location and size of the compressed data stored in the non-volatile storage device. The data storage device further includes means for reporting the capacity of the one or more partitions as a value greater than the capacity. The data storage device further includes means for decompressing data, wherein the means for decompressing data is coupled to the non-volatile storage units.
[0083] While the foregoing is directed to embodiments of the present disclosure, other and additional embodiments of the present disclosure may be envisioned without departing from the basic scope thereof, and the scope of the present disclosure is determined by the appended claims.
Claims
1. A data storage device, comprising: non-volatile storage units, wherein the capacity of the non-volatile storage units is divided into a plurality of partitions; and a controller coupled to the non-volatile storage units, the controller including a compression engine, wherein the controller is configured to: receive from a host device one or more commands for writing data to a first partition among the plurality of partitions, wherein each command includes one or more data chunks; compress one or more of the one or more data chunks into compressed data by using the compression engine, wherein the one or more chunks are compressed into one or more grains; write the compressed data to a first location in the first partition; and report the first location to the host device, wherein reporting to the host device includes providing the host device with a host logical block address range, i.e., a host LBA range, of each compressed data chunk, which is larger than the actual LBA range of the compressed data.
2. The data storage device according to claim 1, wherein the host LBA range is a non-linear logical block storage space.
3. The data storage device according to claim 1, wherein the controller is further configured to append a header to the compressed data.
4. The data storage device according to claim 3, wherein the header includes metadata indicating the positions of the one or more chunks.
5. The data storage device according to claim 1, wherein the compression engine is capable of compressing data at a compression ratio, wherein the compression ratio determines the maximum change from a first number of logical blocks to a second number of logical blocks when compressing the data.
6. A data storage device, comprising: non-volatile storage units, wherein the capacity of the non-volatile storage units is divided into a plurality of partitions; and a controller coupled to the non-volatile storage units, the controller including a compression engine, wherein the controller is configured to: receive from a host device one or more commands for writing data to a first partition among the plurality of partitions, wherein each command includes one or more data chunks; compress one or more of the one or more data chunks into compressed data by using the compression engine, wherein the one or more chunks are compressed into one or more grains; write the compressed data to a first location in the first partition; report the first location to the host device; and receive an index from the host device after reporting to the host device.
7. The data storage device according to claim 6, wherein the controller is further configured to append a header to the compressed data.
8. The data storage device according to claim 7, wherein the header includes metadata indicating the positions of the one or more chunks.
9. The data storage device according to claim 6, wherein the compression engine is capable of compressing data at a compression ratio, wherein the compression ratio determines the maximum change from a first number of logical blocks to a second number of logical blocks when compressing the data.
10. A data storage device, comprising: A non-volatile storage unit, wherein the capacity of the non-volatile storage unit is divided into a plurality of partitions; and A controller, the controller being coupled to the non-volatile storage unit, the controller including a compression engine, wherein the controller is configured to: Receive from a host device one or more commands for writing data to a first partition among a plurality of partitions; Receive data associated with the one or more commands from the host device; Group the received data into chunks; Use the compression engine having a compression ratio to compress the data associated with the one or more commands from chunks to an integer number of grains; Write the compressed data associated with one or more commands to a first location in the first partition; Record the first location, wherein the first location includes a media logical block address, i.e., media LBA and host LBA; and Report the host LBA to the host device, wherein reporting to the host device includes providing the host device with a host LBA range for each compressed data chunk, which is larger than the actual LBA range of the compressed data.
11. The data storage device according to claim 10, wherein the controller is further configured to: Receive a read command for the compressed data stored in the first partition; Determine the first location of the compressed data associated with the read command; Read the data associated with the read command; and Deliver the data to the host device.
12. The data storage device according to claim 11, wherein the read command includes the host LBA.
13. The data storage device according to claim 11, wherein determining the first location uses the compression ratio to convert the host LBA to the media LBA.
14. The data storage device according to claim 13, wherein the media LBA includes a header.
15. The data storage device according to claim 14, wherein the header stores the first location of each compressed data chunk.
16. The data storage device according to claim 10, wherein the controller is further configured to: Determine whether the compressed data will need to be decompressed; and Decompress the data determined to need decompression.
17. A data storage device, comprising: A non-volatile storage unit, wherein the capacity of the non-volatile storage unit is divided into a plurality of partitions; Means for compressing data received from a host device, wherein the means for compressing data is coupled to the non-volatile storage unit; Means for writing the compressed data to a logical block address range, i.e., LBA range, in at least one of the plurality of partitions, wherein the means for writing the compressed data is coupled to the non-volatile storage unit; and Means for reporting a host LBA range to the host device, wherein the host LBA range is different from the LBA range where the compressed data is written, wherein the means for reporting is coupled to the non-volatile storage unit; and Apparatus for receiving an index from the host device and writing the index to the non-volatile storage unit.
18. The data storage device according to claim 17, wherein the index includes the location and size of the compressed data stored in the non-volatile storage unit.
19. The data storage device according to claim 17, further comprising means for reporting the capacity of the one or more partitions as a value greater than the capacity.
20. The data storage device according to claim 17, further comprising means for decompressing data, wherein the means for decompressing data is coupled to the non-volatile storage unit.
Citation Information
Patent Citations
Conversion layer partitioned between host and controller
KR1020150020136A