Non-sequential partition namespace
By using non-sequential writing and tracking table update methods in storage devices, the performance and durability problems in the processing of continuous logical block addresses in the existing technology are solved, and more efficient data writing and lower overhead are achieved.
Patent Information
- Application Number
- CN202080006553.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-12-04
- Filing Date
- 2020-03-17
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-03-17
AI Technical Summary
When existing storage devices process consecutive logical block addresses, they need to read, modify, and rewrite data, resulting in reduced performance, reduced durability, and increased host overhead.
The controller of the storage device is configured to write data between non-sequential logical block addresses, read and write data through direct memory access (DMA), and use tracking table updates to ensure non-sequential writing of data within the partition. , to avoid dependence on sequential writing pointers.
It improves the performance of storage devices and hosts, reduces the overhead of storage devices, and improves the durability of storage devices. It reduces the load on partitions through non-sequential writes and avoids performance degradation caused by sequential writes.
Smart Images

Figure CN113179658B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to U.S. Application No. 16 / 703,643, filed on December 4, 2019, which claims priority to and the benefit of U.S. Provisional Patent Application Serial No. 62 / 899,717, filed on September 12, 2019, both of which are incorporated herein by reference in their entirety. Background Art Technical Field
[0003] Embodiments of the present disclosure relate generally to storage devices, such as solid-state drives (SSDs).
[0004] Description of Related Art
[0005] Storage devices such as SSDs can be used in computers in applications that require relatively low latency and high capacity storage. For example, an SSD can exhibit lower latency than a hard disk drive (HDD), especially for random reads and writes. Typically, a controller of an SSD receives a command to read or write data from a host device to a memory device. The number of memory devices is called a namespace, and the controller is configured to read data from or write data to one or more namespaces of a memory device. Each namespace consists of a plurality of logical block addresses (LBAs) or sectors. The controller can access any LBA within any namespace at any time.
[0006] However, when a segment of consecutive LBAs (e.g., LBAs 1-8) within a namespace is already storing data and a post-write is received to selected data at an LBA (e.g., LBA 4) within the segment, the controller must read out all data within the segment, modify the selected data, and rewrite the data associated with each LBA of the segment to a new location. Such a read-modify-write process can degrade the performance of both the storage device and the host, as well as reduce the endurance of the storage device and increase host overhead.
[0007] Therefore, a new method of operating a storage device is needed. Summary of the invention
[0008] The present disclosure as a whole relates to a method of operating a storage device. A controller of the storage device is configured to retrieve a first command to write data to one or more first logical blocks of a first partition, and directly memory access (DMA) read and write data associated with the first command to the first logical block. The first logical block is between a partition start point of the first partition and a partition capacity of the first partition. The controller is configured to retrieve a second command to write data to one or more second logical blocks of the first partition, and DMA read and write data associated with the second command to the second logical block. The second logical block is between the partition start point and the partition capacity of the first partition, and the first logical block and the second logical block are non-sequential.
[0009] In one embodiment, a storage device includes: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition including a plurality of logical blocks; and a controller coupled to the media unit. The controller is configured to retrieve a first command to write data to a first partition and to directly memory access (DMA) read data associated with the first command, identify one or more first logical blocks of the first partition to write the data associated with the first command, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, retrieve a second command to write data to the first partition and to DMA read the data associated with the second command, and identify one or more second logical blocks of the first partition to write the data associated with the second command, wherein the one or more second logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, and wherein the one or more second logical blocks are separated from the one or more first logical blocks by one or more empty logical blocks.
[0010] In another embodiment, a storage device includes: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition including a plurality of logical blocks; and a controller coupled to the media unit. The controller is configured to retrieve a first command to write data to one or more first logical blocks in a first partition, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, write the data associated with the first command to the one or more first logical blocks of the first partition and to a first location in the media unit, retrieve a second command to write data to one or more second logical blocks in the first partition, wherein the one or more second logical blocks are between a partition start logical block address of the first partition and the partition capacity of the first partition, and wherein the one or more second logical blocks are non-sequential with the first one or more logical blocks, and write the data associated with the second command to the one or more second logical blocks of the first partition and to a second location in the media unit, the second location being located in a sequential position of the first location.
[0011] In yet another embodiment, a storage system includes: a host device including a first tracking table; and a storage system. The storage system includes: a media unit, wherein a capacity of the media unit is divided into a plurality of partitions, each partition including a plurality of logical blocks, and wherein the media unit stores a second tracking table; and a controller coupled to the media unit. The controller is configured to retrieve a first command to write data to one or more first logical blocks in a first partition and DMA read the data associated with the first command, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, write the data associated with the first command to the one or more first logical blocks of the first partition, update the first tracking table and the second tracking table to indicate that the one or more first logical blocks are not available for writing data associated with a subsequent command, retrieve a second command to write data to one or more second logical blocks in the first partition and DMA read the data associated with the second command, wherein the one or more second logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein at least one of the one or more second logical blocks is non-sequential with the one or more first logical blocks, write the data associated with the second command to the one or more second logical blocks of the first partition; and update the first tracking table and the second tracking table to indicate that the one or more second logical blocks are not available for writing data associated with a subsequent command. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Thus, a detailed understanding of the manner in which the above-described features of the present disclosure are understood, a more particular description of the present disclosure, the above brief overview, may be obtained by reference to the embodiments, some of which are illustrated in the accompanying drawings. It should be noted, however, that the drawings illustrate only typical embodiments of the present disclosure and are therefore not to be considered limiting of its scope, as the present disclosure may admit to other equally effective embodiments.
[0013] Figure 1 is a schematic block diagram illustrating a storage system according to one embodiment.
[0014] Figure 2 A storage system including a storage device coupled to a host device according to another embodiment is shown.
[0015] Figure 3 is a block diagram illustrating a method of operating a memory device to execute a read or write command according to one embodiment.
[0016] Figure 4A A partition namespace for use in a storage device is shown according to one embodiment.
[0017] Figure 4B According to one embodiment, Figure 4AA state diagram of the partition namespace of a storage device.
[0018] Figure 5A Shown is a sequential check of closed partition namespaces according to one embodiment.
[0019] Figure 5B According to one embodiment, Figure 5A A corresponding table of write commands received by the partition namespace.
[0020] Fig. 6A An example of sequentially checking open partition namespaces according to another embodiment is shown.
[0021] Figure 6B According to one embodiment, Fig. 6A A corresponding table of write commands received by the partition namespace.
[0022] 7A to 7F Non-sequential writes to partitions of a ZNS are shown and partition attach commands are not received, according to one embodiment.
[0023] Figure 8 shows the trace Figure 7A-7F A corresponding table of write commands retrieved from a partition.
[0024] To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It is contemplated that elements disclosed in one embodiment may be beneficially utilized on other embodiments without specific recitation. DETAILED DESCRIPTION
[0025] Hereinafter, reference is made to the embodiments of the present disclosure. However, it should be understood that the present disclosure is not limited to the embodiments specifically described. On the contrary, any combination of the following features and elements (whether or not related to different embodiments) is considered to realize and practice the present disclosure. In addition, although the embodiments of the present disclosure can achieve advantages that are superior to other possible solutions and / or superior to the prior art, whether a specific advantage is achieved by a given embodiment is not a limitation to the present disclosure. Therefore, the following aspects, features, embodiments and advantages are merely illustrative, and are not considered to be elements or limitations of the appended claims, unless explicitly stated in the claims. Similarly, reference to "the present disclosure" should not be interpreted as a summary of any inventive subject matter disclosed herein, and should not be considered to be elements or limitations of the appended claims, unless explicitly stated in the claims.
[0026] The present disclosure as a whole relates to a method of operating a storage device. A controller of the storage device is configured to retrieve a first command to write data to one or more first logical blocks of a first partition, and directly memory access (DMA) read and write data associated with the first command to the first logical block. The first logical block is between a partition start point of the first partition and a partition capacity of the first partition. The controller is configured to retrieve a second command to write data to one or more second logical blocks of the first partition, and DMA read and write data associated with the second command to the second logical block. The second logical block is between the partition start point and the partition capacity of the first partition, and the first logical block and the second logical block are non-sequential.
[0027] Figure 1 1 is a schematic block diagram illustrating a storage system 100 in accordance with one or more techniques of this disclosure, in which a 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 device 110 included in the 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 storage devices, such as the storage device 106, that can operate as a storage array. For example, the storage system 100 can include multiple storage devices 106 that are configured as a redundant array of inexpensive / independent disks (RAID) that are collectively used as a mass storage device for the host device 104.
[0028] 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 storage device 106. Figure 1 As shown, host device 104 can communicate with storage device 106 via interface 114. Host device 104 can include any of a variety of devices, including a computer server, a network attached storage (NAS) unit, a desktop computer, a notebook (i.e., laptop) computer, a tablet computer, a set-top box, a telephone handset such as a so-called "smart" phone, a so-called "smart" tablet computer, a television, a camera, a display device, a digital media player, a video game console, a video streaming device, etc.
[0029] The storage device 106 includes a controller 108, a non-volatile memory 110 (NVM 110), a power supply 111, a volatile memory 112, and an interface 114. The controller 108 includes a partition manager 120. In some examples, for clarity, the storage device 106 may include Figure 1106. For example, storage device 106 may include a printed circuit board (PCB) to which components of storage device 106 are mechanically attached, and the printed circuit board includes conductive traces that electrically interconnect components of storage device 106, etc. In some examples, the physical size and connector configuration of storage device 106 may 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., HDDs or SSDs), 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, storage device 106 may be directly coupled (e.g., directly soldered) to a motherboard of host device 104.
[0030] The interface 114 of the 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), Non-Volatile Memory Express (NVMe), OpenCAPI, GenZ, Cache Coherent Interface Accelerator (CCIX), Open Channel SSD (OCSSD), Coherent Accelerator (CXL), etc. The electrical connection (e.g., data bus, control bus, or both) of the interface 114 is electrically connected to the controller 108, thereby providing an electrical connection between the host device 104 and the controller 108, allowing data to be exchanged between the host device 104 and the controller 108. In some examples, the electrical connection of the interface 114 may also allow the storage device 106 to receive power from the host device 104. For example, Figure 1 As shown, power supply 111 may receive power from host device 104 via interface 114 .
[0031] The storage device 106 includes an NVM 110, which may include multiple memory devices. The NVM 110 may be configured to store and / or retrieve data. For example, the memory device of the NVM 110 may receive data and a message indicating that the memory device stores data from the controller 108. Similarly, the memory device of the NVM 110 may receive a message indicating that the memory device retrieves data from the controller 108. In some examples, each memory device in the memory device may be referred to as a die. In some examples, a single physical chip may include multiple dies (i.e., multiple memory devices). In some examples, each memory device in the memory device may be configured to store a relatively large amount of data (e.g., 128MB, 256MB, 512MB, 1GB, 2GB, 4GB, 8GB, 16GB, 32GB, 64GB, 128GB, 256GB, 512GB, 1TB, etc.).
[0032] In some examples, each memory device of 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, a hard disk drive (HDD), and any other type of non-volatile memory device.
[0033] NVM 110 may include multiple flash memory devices. Flash memory devices may include NAND or NOR-based flash memory devices, and data may be stored based on the charge contained in the floating gate of the transistor for each flash memory cell. In NAND flash memory devices, the flash memory devices may be divided into multiple blocks, which may be divided into multiple pages. Each block in a plurality of 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 pages in a plurality of pages. The corresponding cells in each of the plurality of pages may be electrically connected to the corresponding bit lines. In addition, the NAND flash memory device may be a 2D or 3D device, and may be a single-level cell (SLC), a multi-level cell (MLC), a three-level cell (TLC), or a four-level cell (QLC). The controller 108 may write data to the NAND flash memory device at a page level and read data from the NAND flash memory device, and erase data from the NAND flash memory device at a block level.
[0034] The storage device 106 includes a power supply 111 that can provide power to one or more components of the storage device 106. When operating in standard mode, the power supply 111 can use power provided by an external device such as a host device 104 to power one or more components. For example, the power supply 111 can use power received from the host device 104 via the interface 114 to power one or more components. In some examples, the power supply 111 may include one or more power storage components that are configured to supply power to one or more components when operating in a shutdown mode, such as when power is stopped from being received from an external device. In this way, the power supply 111 can be used as an onboard backup power supply. Some examples of one or more power storage components include, but are not limited to, capacitors, supercapacitors, batteries, and the like. In some examples, the amount of power that can be stored by one or more power storage components can 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 power stored by the one or more power storage components increases, the cost and / or size of the one or more power storage components also increases.
[0035] Storage device 106 also includes volatile memory 112, which can be used by controller 108 to store information. Volatile memory 112 can include one or more volatile memory devices. In some examples, controller 108 can use volatile memory 112 as a cache. For example, controller 108 can store cached information in volatile memory 112 until the cached information is written to NVM 110. Figure 1 As 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.)).
[0036] The storage device 106 includes a controller 108 that can manage one or more operations of the storage device 106. For example, the controller 108 can manage reading data from the NVM 110 and / or writing data to the NVM 110. The controller 108 may include a partition management 120 to manage reading and writing to partitions, as well as the relocation of valid data to and from partitions for garbage collection purposes. In some embodiments, when the storage device 106 receives a write command from the host device 104, the controller 108 can initiate a data storage command to store data to the NVM 110 and monitor the progress of the data storage command. The controller 108 can determine at least one operating characteristic of the storage system 100 and store the at least one operating characteristic to the NVM 110.
[0037] Figure 2 2 shows a storage system 200 including a storage device 206 coupled to a host device 204 according to another embodiment. The storage system 200 may be Figure 1 A storage system 100, a host device 104 and a storage device 106.
[0038] Storage device 206 can send and receive commands and data from host device 204 and includes command processor 220. Command processor 220 may be Figure 1 The controller 108 in FIG. 10 is a schematic diagram of a controller 108 in FIG. 10. The command processor 220 can schedule memory device accesses (such as NAND accesses) and can perform reads of memory devices before a previously received command requires a write to the same memory device. The command processor 220 is coupled to one or more memory devices 228 and command fetch 222. The one or more memory devices 228 can be NAND non-volatile memory devices. The command fetch 222 is coupled to a submission queue arbitration 224. The submission queue arbitration 224 is coupled to one or more submission queue head and tail pointers 226.
[0039] The host device 204 includes one or more host software applications 232 coupled to one or more processing units or CPU applications 234. In one embodiment, the software application 232 has a limited solid-state drive queue depth to derive a latency QoS for each user of the system 200. The host device 204 also includes an operating system (OS) or software application 240 that has no associated QoS. The CPU 234 is coupled to an interconnect 236 and a host DRAM 238. The host DRAM 238 can store submission queue data. The interconnect 236 is coupled to the storage device 206. The interconnect 236 can communicate with both the submission queue head and tail pointers 226 and the command fetch 222.
[0040] The CPU 234 generates one or more commands 216 to send to the storage device 206, and can send and receive commands from the storage device 206 via a command get signal 244. The CPU 234 can also send an interrupt or doorbell 218 to the storage device 206 to notify the storage device 206 of the one or more commands 216. The CPU 234 can limit the depth of the data queue submitted to the storage device 206. The queue depth (QD) is the maximum number of commands queued to the storage device 206, and the data-QD is the amount of data associated with the commands queued with the QD. In one embodiment, the data-QD 242 of the storage device 206 is equal to the bandwidth of the storage device 206. The data-QD 242 is limited to the highest level at which the storage device 206 can still maintain the desired latency QoS. The command processor 220 then processes the command received from the host device 204.
[0041] Figure 3 is a block diagram illustrating a method 300 of operating a storage device to execute a read or write command according to one embodiment. The method 300 may be used with a storage system 100 having a host device 104 and a storage device 106 including a controller 108. The method 300 may be used with a storage system 200 having a host device 204 and a storage device 206 including a command processor 220.
[0042] Method 300 begins at operation 350, where the host device writes a command as an entry into a submission queue. At operation 350, the host device may write one or more commands into the submission queue. The command may be a read command or a write command. The host device may include one or more submission queues. The host device may write one or more commands into the submission queue in any order (i.e., submission order), regardless of the sequential write order (i.e., sequential processing order) of the one or more commands.
[0043] In operation 352, the host device writes one or more updated submission queue tail pointers and rings a doorbell or sends an interrupt signal to notify or signal the storage device that a new command is ready for execution. The doorbell signal may be Figure 2 The host may write an updated submission queue tail pointer and send a doorbell or interrupt signal for each submission queue in the submission queue. In operation 354, in response to receiving the doorbell or interrupt signal, the controller of the storage device obtains the command from one or more submission queues, and the controller receives or DMA reads the command.
[0044] In operation 356, the controller processes the command and writes or transfers data associated with the command to the host device memory. The controller may process more than one command at a time. The controller may process one or more commands in a submission order or in sequence. Processing a write command may include identifying a partition to write data associated with the command, writing the data to one or more LBAs of the partition, and advancing a write pointer of the partition to identify the next available LBA within the partition.
[0045] In operation 358, once the command has been fully processed, the controller writes a completion entry corresponding to the executed command to the completion queue of the host device and moves or updates the CQ head pointer to point to the newly written completion entry.
[0046] In operation 360, the controller generates an interrupt signal or doorbell and sends it to the host device. The interrupt signal indicates that the command has been executed and the data associated with the command is available in the memory device. The interrupt signal further notifies the host device that the completion queue is ready to be read or processed.
[0047] In operation 362, the host device processes the completion entry. In operation 364, the host device writes the updated CQ head pointer to the storage device and rings a doorbell or sends an interrupt signal to the storage device to release the completion entry.
[0048] Figure 4A A zoned name space (ZNS) 402 view is shown for use in a storage device 400, according to one embodiment. The storage device 400 can present the ZNS 402 view to a host device. Figure 4B A state diagram 450 of a ZNS 402 for a storage device 400 is shown according to one embodiment. The storage device 400 may be Figure 1 The storage device 106 of the storage system 100 or Figure 2 The storage device 400 may include one or more ZNS 402, and each ZNS 402 may have a different size. In addition to the one or more partition namespaces 402, the storage device 400 may also include one or more regular namespaces. In addition, the ZNS 402 may be a zone block command (ZBC) for SAS and / or a zone device ATA command set (ZAC) for SATA.
[0049] In storage device 400, ZNS 402 is a quantity of NVM that can be formatted into logical blocks such that the capacity is divided into multiple partitions 406a-406n (collectively referred to as partitions 406). Each of partitions 406 includes multiple physical blocks or erase blocks (now shown) of media units or NVM 404, and each of the erase blocks is associated with multiple logical blocks (not shown). When controller 408 receives commands from, such as from a host device (not shown) or a submission queue of the host device, controller 408 can read data from and write data to the multiple logical blocks associated with the multiple erase blocks of ZNS 402. Each of the logical blocks is associated with a unique LBA or sector.
[0050] In one embodiment, NVM 404 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 erase blocks. Each erase block in the one or more erase blocks includes one or more word lines (e.g., 256 word lines). Each word line in 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 reach two bits in each cell of the entire word line (e.g., 16kB per page). In addition, each page can be accessed with a granularity equal to or less than a full page. The controller can frequently access a NAND with a user data granularity LBA size of 512 bytes. Therefore, as mentioned in the following description, a NAND position equals a granularity of 512 bytes. Therefore, the LBA size of two pages of an MCL NAND is 512 bytes and the page size is 16kB, which will result in approximately 16 NAND positions per word line. However, the NAND position size is not intended to be restrictive and is used only as an example.
[0051] When data is written to an erase block, one or more logical blocks are correspondingly updated within the partition 406 to track the location of the data within the NVM 404. Data may be written one partition 406 at a time until the partition 406 is full, or written to multiple partitions 406 so that multiple partitions 406 may be partially full. Similarly, when data is written to a particular partition 406, the data may be written to multiple erase blocks one block at a time in the order of NAND positions or word-line by word-line until moving to an adjacent block (i.e., writing to the first erase block until the first erase block is full before moving to the second erase block), or may be written to multiple erase blocks multiple blocks at a time in the order of NAND positions or word-line by word-line to partially fill each block in a more parallel manner (i.e., writing to the first NAND position of each erase block before writing to the second NAND position of each erase block).
[0052] When controller 408 selects to store the erase block of the data of each sub-region, controller 408 will be able to select erase block at the sub-region opening time, or controller 408 can be reached and select erase block along with the demand of the first NAND position or word line that fills this specific erase block.When utilizing the above-mentioned method of filling an erase block fully before starting next erase block, this may be more different.Controller 408 can use this time difference to select more optimized erase block on an immediate basis.Which erase block is allocated and assigned to the decision of each sub-region and continuous LBA thereof can occur in controller 408 for zero or more parallel sub-regions always.
[0053] Each partition in partitions 406 is associated with a partition starting logical block address (ZSLBA) or a partition starting sector. The ZSLBA is the first available LBA in partitions 406. For example, the first partition 406a is associated with ZSLBA. a SLBA is associated with the second partition 406b and Z b SLBA is associated with the third partition 406c and Z c SLBA is associated with the fourth partition 406d and Z d SLBA is associated, and the nth partition 406n (ie, the last partition) is associated with Z n Each partition 406 is identified by its ZSLBA and is configured to receive sequential writes (ie, write data to NVM 110 in the order in which the write commands are received).
[0054] When data is written to a partition 406, a write pointer 410 is advanced or updated to point to or indicate the next available block in the partition 406 to which the data is written, so as to track the next write start point (i.e., the completion point of the previous write is equal to the start point of the subsequent write). Thus, the write pointer 410 indicates where the subsequent write to the partition 406 will begin. Subsequent write commands are "partition append" commands, in which the data associated with the subsequent write command is appended to the partition 406 at the location indicated by the write pointer 410 as the next start point. An ordered list of LBAs within the partition 406 may be stored for write ordering. Each partition 406 may have its own write pointer 410. Thus, when a write command is received, the partition 406 is identified by its ZSLBA, and the write pointer 410 determines the location at which the writing of the data begins within the identified partition 406.
[0055] Figure 4B Shown for Figure 4A402. In state diagram 450, each partition may be in a different state, such as empty, active, full, or offline. When a partition is empty, the partition contains no data (i.e., no erase blocks in the partition currently store data), and the write pointer is located at ZSLBA (i.e., WP=0). 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 partitions between 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 by the ZM or controller 408. The controller may include the ZM.
[0056] The term "write" includes programming user data on 0 or more NAND locations in an erase block and / or partially filled NAND locations in an erase block when the user data does not fill all available NAND locations. The term "write" may also include moving a partition to full due to internal drive processing needs (open block data retention issues because bit errors accumulate faster on open erase blocks), the storage device 400 closing or filling a partition due to resource limitations (like too many open partitions to track or defective conditions discovered, etc.), or the host device closing a partition due to issues such as no more data to send to the drive, computer shutdown, error handling on the host, limited host resources for tracking, etc.
[0057] Active partitions can be open or closed. An open partition is an empty partition or partially filled partition that is ready for writing and has currently allocated resources. Data received from a host device using a write command or a partition append command can be programmed into an open erase block that is not currently filled with previous data. A closed partition is an empty partition or partially filled partition that is not currently receiving writes from the host continuously. The partition moving from the open state to the closed state allows the controller 408 to reallocate resources to other tasks. These tasks may include, but are not limited to, other open partitions, other conventional non-partitioned areas, or other controller needs.
[0058] In both open and closed partitions, the write pointer points to a location in the partition between the ZSLBA and the end of the last LBA of the partition (i.e., WP>0). An active partition can switch between open and closed states as specified by the ZM, or when a write is scheduled to the partition. In addition, the ZM can reset the active partition to clear or erase the data stored in the partition, causing the partition to switch back to an empty partition. Once the 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 blocks for writing data (i.e., WP=partition capacity (ZCAP)). Read commands for data stored in a full partition can still be executed.
[0059] The ZM can reset a full partition, thereby scheduling the erasure of the data stored in the partition so that the partition switches back to an empty partition. If a full partition is reset, the data of the partition may not be immediately cleared, although the partition may be marked as an empty partition available for writing. However, the reset partition must be erased before switching to an open and active partition. The partition can be erased at any time between the ZM reset and the ZM open. 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 in a partially full state without being active.
[0060] Since resetting a partition can clear all data stored in a partition or schedule the erasure of all data stored in a partition, the need for garbage collection of each erase block is eliminated, thereby improving the overall garbage collection process of storage device 400. Storage device 400 can mark one or more erase blocks for erasure. When a new partition is to be formed and storage device 400 estimates that ZM is open, then one or more erase blocks marked for erasure can be erased. Storage device 400 can also determine and create the physical support of the partition when erasing the erase block. Therefore, once a new partition is opened and an erase block is selected to form a partition, the erase block will be erased. In addition, each time a partition is reset, the LBA of partition 406 and the new order of write pointer 410 can be selected, so that partition 406 can tolerate receiving commands in a sequential manner. Optionally, write pointer 410 can be closed so that a command can be written as any starting LBA indicated by a command.
[0061] See again Figure 4A , when the controller 408 receives a write command or direct memory access (DMA) read write data from the host 204, the controller 408 may select an empty erase block to write the data associated with the command, and the empty partition 406 is switched to the active and open partition 406. The write command may be a command to write new data, or a command to move valid data to another partition for garbage collection purposes. The controller 408 is configured to DMA read or pull in new commands from a submission queue populated by the host device.
[0062] In the empty partition 406 that has just been switched to the active partition 406, data is assigned to the partition 406 and the sequential LBAs of the associated group of the partition 406 starting at the ZSLBA because the write pointer 410 indicates the logical block associated with the ZSLBA as the first available logical block. The data can be written to one or more erase blocks or NAND locations that have been allocated for the physical location of the partition 406. After the data associated with the write command is written to the partition 406, the write pointer 410 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 such a host write command is sequentially programmed into the next available NAND location in the erase block that is selected for the physical support of the partition.
[0063] In some embodiments, a NAND location may be equal to a word line. In such embodiments, if a write command is smaller than a word line, the controller may optionally aggregate several write commands in another memory location such as a DRAM or SRAM before programming an entire word line consisting of multiple write commands. A write command longer than a word line will be able to program a complete word line and fill the complete word line with some data, and the excess data beyond the word line will be used to fill the next word line. For the purposes of this specification, the write data size is equal to a 512-byte NAND location; however, the size of the NAND location is not intended to be limiting.
[0064] For example, the controller 408 may receive a first write command to the third partition 406c, or receive a first partition append command. The host sequentially identifies which logical block of the partition 406 is used to write the data associated with the first command. The data associated with the first command is then written to the first or next one or more available LBAs in the third partition 406c as indicated by the write pointer 410, and the write pointer 410 is advanced or updated to point to the next available LBA (i.e., WP>0) available for host writing. If the controller 408 receives a second write command to the third partition 406c, or receives a second partition append command, the data associated with the second write command is written to the next available LBA identified by the write pointer 410 in the third partition 406c. Once the data associated with the second command is written to the third partition 406c, the write pointer 410 is advanced or updated again to point to the next available LBA available for host writing. Resetting the partition 406c moves the write pointer 410 back to Z c SLBA (ie, WP=0), and partition 406c switches to an empty partition.
[0065] However, strict write ordering may cause host writes to each partition 406 to degenerate into a single write I / O, which limits host performance and increases host overhead. Therefore, the storage device 400 is configured to receive a manufacturer or vendor specific command to turn off order checking.
[0066] Figure 5A The ZNS 500 is shown with sequential checks turned off upon receiving a partition attach command according to one embodiment. Figure 5B A corresponding table 550 is shown for the write commands retrieved by the ZNS 500. The table 550 may be stored in a controller or in a memory device of a storage device. The ZNS 500 may be the ZNS 402 of FIG. 4. Although Figure 5A The ZNS 500 is shown as including one partition 506, but the ZNS 500 may include multiple partitions 506. In addition, each of the multiple partitions 506 of the ZNS 500 may have its own separate table 550, or one table 550 may track all write commands retrieved by each of the multiple partitions 506. Fig. 6A A ZNS 600 is shown sequentially checking open upon receiving a partition attach command according to another embodiment. Figure 6B A corresponding table 650 is shown for a write command retrieved by the ZNS 600. The ZNS 600 may be the ZNS 402 of FIG.
[0067] exist Figure 5A In the example, a first write command (write 0) 520, a second write command 522 (write 1), and a third write command 524 (write 2) are received or DMA read, and a partition 506 is identified by its ZSLBA to store data associated with each of the first write command 520, the second write command 522, and the third write command 524. The write commands 520, 522, 524 may each be a command for writing new data, or a command for moving valid data from one partition to another for garbage collection purposes. A controller (such as Figure 4A Controller 408) is configured to retrieve new commands from the host device and DMA read data associated with the new commands. Sequentially, the first write command 520 is intended to be written first, the second write command 522 is intended to be written second, and the third write command 524 is intended to be written third. Partition 506 includes a plurality of logical blocks 5120-5127 (collectively referred to as logical blocks 512). Each of the logical blocks corresponds to an LBA, which is shown in table 550. Although eight logical blocks 512 are shown, partition 506 may include any number of logical blocks 512.
[0068] Figure 5BA corresponding table 550 is shown that tracks write commands retrieved by the partition 506. The table 550 includes a first column 552 that identifies the write ID of the command (i.e., the order of the command), a second column 554 that identifies the starting LBA, a third column 556 that identifies the number of logical blocks required to write the data associated with the command and the expected starting LBA, a fourth column 558 that identifies the number of logical blocks that the write pointer 510 has advanced after the write has been recorded in the completion queue, a fifth column 560 that identifies the LBA offset of the partition from the ZSLBA, and a sixth column 562 that identifies the physical location of the NAND address associated with the LBA used to store the data. Although three write pointers 5100, 5101, 5102 are shown, the partition 506 includes only one write pointer 510, and the three write pointers 5100, 5101, 5102 indicate the location of the single write pointer 510 when data is written to the partition 506 at different times, as described below.
[0069] Each write command 520, 522, 524 is displayed in table 550 in the order in which it is submitted, rather than in sequence. In table 550, the second write command 522, identified by write ID 1, is received before the first write command 520, identified by write ID 0. The second column 554 identifies the starting LBA of the second write command 522 as ZSLBA, and requires two logical blocks (2LBA) to store the data, as identified in the third column 556. Since the first write command 520 should be the first sequential write to the partition 506 and only requires one logical block (1LBA), the third column 556 further identifies the expected starting LBA of the second command 522 as the second logical block 512i of the partition 506.
[0070] However, since the second command 522 is submitted before the first command 520, the second command 522 starts at the first available logical block 5120 of the partition 506 indicated by the write pointer 5100. Since the table 550 indicates the starting LBA only as the ZSLBA, the data associated with the second command 522 is written to the first available logical block 5120 indicated by the write pointer 5100. When the data associated with the second command 522 is written to the first logical block 5120 and the second logical block 512i of the partition 506, the write pointer 510 is advanced by two logical blocks, and the fourth column 558 is updated accordingly. As shown in the sixth column 562 of the table 550, the data associated with the second command 522 is stored in the first NAND position NL0 and the second NAND position NL1, because the first logical block 5120 and the second logical block 512i correspond to the first NAND position NL0 and the second NAND position NL1, respectively.
[0071] The controller of the storage device then determines the LBA offset from the ZSLBA, and the completion entry is returned to the completion queue as the last LBA written to the partition 506. The advancement of the write pointer 510, the determination of the offset, and the return of the completion entry to the completion queue may occur simultaneously or in any order. The fifth column 560 is then updated to identify that the LBA is offset from the ZSLBA by two (ZSLBA+2) after the data associated with the second command 522 is written to the partition 506. The completion entry is returned to the completion queue and the fifth column 560 is updated to inform the host device where the data associated with the second command is stored.
[0072] The first write command 520 is submitted after the second write command 522. Therefore, the second column 554 for the first command (write ID 0) identifies the starting LBA of the first write command 520 as ZSLBA and requires one logical block (1 LBA), as identified in the third column 556. Although the data associated with the first write command 520 should be written to the first logical block 5120, as identified in the third column 556, the data associated with the second write command 522 has already been written to the first logical block 5120, as identified in the fifth column 560 for the second command (write ID 1).
[0073] Since the controller tracks the LBA offset in the fifth column 560 and advances the write pointer 510 accordingly, the controller confirms that the first logical block 5120 is used and writes the data associated with the first command 520 to the next available logical block 5122, as indicated by the write pointer 510i. When writing the data associated with the first command 520 to the third logical block 5122 of the partition 506, the write pointer 510 advances one logical block and correspondingly updates the fourth column 558. As shown in the sixth column 562 of the table 550, the data associated with the first command 520 is stored in the third NAND location NL2 because the third logical block 5122 corresponds to the third NAND location NL2.
[0074] The controller of the storage device then determines the LBA offset from the ZSLBA, and the completion entry is returned to the completion queue as the last LBA written to the partition 506. The advancement of the write pointer 510, the determination of the offset, and the return of the completion entry to the completion queue may occur simultaneously or in any order. The fifth column 560 is then updated to identify that after the data associated with the first command 520 and the second command 522 are written to the partition 506, the LBA is now offset by three (ZSLBA+3) from the ZSLBA. The completion entry is returned to the completion queue and the fifth column 560 is updated to inform the host device where the data associated with the first command is stored.
[0075] The third command 524 is submitted third. For the third command 524 (write ID 2), the table 550 identifies the starting LBA as ZSLBA in the second column 554 and identifies that four logical blocks (4LBA) are required in the third column 556. The controller writes the data associated with the third command 524 to the next available logical block 5123, as indicated by the write pointer 5101. When writing the data associated with the third command 524 to the fourth logical block 5123 to the seventh logical block 5126, the write pointer 5102 is advanced by four logical blocks and the fourth column 558 is updated accordingly. As shown in the sixth column 562 of the table 550, the data associated with the third command 524 is stored in the fourth to seventh NAND locations NL3-NL6 because the fourth to seventh logical blocks 5123-5126 correspond to the fourth to seventh NAND locations NL3-NL6, respectively.
[0076] The controller of the storage device then determines the LBA offset from the ZSLBA, and the completion entry is returned to the completion queue as the last LBA written to the partition 506. The advancement of the write pointer 510, the determination of the offset, and the return of the completion entry to the completion queue may occur simultaneously or in any order. The fifth column 560 is then updated to identify that after the data associated with the first command 520, the second command 522, and the third command 524 are written to the partition 506, the LBA is now offset seven (ZSLBA+7) from the ZSLBA. The completion entry is returned to the completion queue and the fifth column 560 is updated to inform the host device where the data associated with the third command is stored.
[0077] Alternatively, Figure 6A-6B The sequential check of the opened ZNS 600 and the corresponding table 650 for the write commands retrieved by the ZNS 600 are shown. Fig. 6A The ZNS 600 is shown as including one partition 606, but the ZNS 600 may include multiple partitions 606. Additionally, each of the multiple partitions 606 of the ZNS 600 may have its own separate table 650, or one table 650 may track all write commands retrieved by each of the multiple partitions 606.
[0078] exist Fig. 6A , a first write command (write 0) 620, a second write command 622 (write 1), and a third write command 624 (write 2) are retrieved or DMA read, and a partition 606 is identified by its ZSLBA to store data associated with each of the first write command 620, the second write command 622, and the third write command 624. A controller (such as Figure 4AController 408) is configured to read new commands from the host device DMA. Sequentially, the first write command 620 is intended to be written first, the second write command 622 is intended to be written second, and the third write command 624 is intended to be written third. Partition 606 includes a plurality of logical blocks 6120-6127 (collectively referred to as logical blocks 612). Each of the logical blocks corresponds to an LBA, which is shown in table 650. Although eight logical blocks 612 are shown, partition 606 may include any number of logical blocks 612.
[0079] Figure 6B A corresponding table 650 is shown that tracks write commands received to partition 606. Table 650 includes a first column 652 identifying the write ID of the command, a second column 654 identifying the starting LBA, a third column 656 identifying the number of logical blocks required to write the data associated with the command and the starting LBA, a fourth column 658 identifying the number of logical blocks that the write pointer 610 has advanced after the write has been recorded in the completion queue, and a fifth column 662 identifying the physical location of the NAND address associated with the LBA used to store the data.
[0080] Each write command 620, 622, 624 is displayed in table 650 in the order of submission rather than in sequence. In table 650, the second write command 622 identified by write ID 1 is received before the first write command 620 identified by write ID 0. The second column 654 identifies the starting LBA of the second write command 622 as the second logical block after ZSLBA (ZSLBA+1) (i.e., the second LBA 6121), and requires two logical blocks (2LBA) to store the data, as identified in the third column 656. Since the first write command 620 should be the first sequential write to the partition 606 and only requires one logical block (1LBA) to store the data, the third column 656 further identifies the starting LBA of the second command 622 as the second LBA 6121 of the partition 606.
[0081] Because the second command 622 is submitted before the first command 620, the controller attempts to write the data associated with the second command 622 before the data associated with the first command 620. However, the write pointer 610 indicates the first logical block 612i associated with the first logical block address as the first available logical block, but the table 650 conflictingly indicates the second logical block 612i as the starting logical block for the second command 622. Because the write pointer 610 and the table 650 indicate different starting LBAs for the second command 622, the data associated with the second command 622 cannot be written to the partition 606.
[0082] 7A to 7FA non-sequential write to a partition 706 of a ZNS 700 is shown according to one embodiment and no partition attach command is received. The ZNS 700 may be used with the storage device 400 and the NVM 404 of FIG. 4 . The ZNS 700 may be the ZNS 402 of FIG. 4 . Although only one partition 706 is shown in the ZNS 700, the ZNS 700 may include multiple partitions, and similar out-of-order write activities described below may occur in one or more of the multiple partitions. Figure 8 An exemplary correspondence table 800 is shown that tracks write commands retrieved by a partition 706. Each of the multiple partitions 706 of the ZNS 700 may have its own separate table 800, or one table 800 may track all write commands retrieved by each of the multiple partitions 706. The table 800 may be stored in a controller, in a memory device of a storage device, and / or in a host device. In one embodiment, both the storage device and the host device store the table 800 separately.
[0083] As described above, the exemplary NAND location is equal to a granularity of 512 bytes. Therefore, the LBA size of two pages of MCL NAND is 512 bytes and the page size is 16kB, which will result in approximately 16 NAND locations per word line. However, the NAND location size is not intended to be limiting and is used only as an example. In addition, while NAND is used as an example, other types of memory may be used and NAND is not intended to be limiting.
[0084] Fig. 7A Partition 706 is shown as empty and does not store data (i.e., a command has not been retrieved to write data to partition 706). Partition 706 can be in an empty state or an active state. Partition 706 includes a plurality of logical blocks 7120-7127 (collectively referred to as logical blocks 712). Each logical block in logical blocks 712 corresponds to a logical block in Figure 8 800. Although eight logical blocks 712 are shown, partition 706 may include any number of logical blocks 712. ZSLBA indicates the start or first LBA of partition 706, while ZSLBA+ZCAP indicates the end or full capacity of partition 706 (i.e., partition capacity).
[0085] Controllers (such as Figure 4A The controller 408 of the partition 706 is configured to retrieve a new command from the host device to the partition 706, and DMA reads the data associated with the new command. The controller can then write the data associated with the command to one or more logical blocks 712 of the partition 706. The partition 706 does not utilize a write pointer because the write pointer is used to identify the next sequentially available logical block 712. In addition, the order check is turned off, as shown above FIG. 5A to FIG. 5BHowever, the controller can still implement an optional safety feature to determine whether a particular LBA has been written during the current duration of the partition active state. If a particular LBA has been written during the current duration of the partition active state, the controller can optionally reject a second write to the LBA.
[0086] Figure 8 A corresponding table 800 is shown that tracks write commands received by partition 706. Table 800 may be stored in DRAM. Table 800 includes a first column 852 identifying the write ID of the command (i.e., the order of the command), a second column 854 identifying the starting LBA, a third column 856 identifying the number of logical blocks required to write the data associated with the command and the expected starting LBA, a fourth column 860 identifying the LBA used to store the data associated with the command as unavailable for writing (i.e., full), and a fifth column 862 identifying the physical location of the NAND address associated with the LBA used to store the data.
[0087] Figure 7B Partition 706 is shown after a first command 730 to partition 706 has been retrieved from the host device and data associated with the first command 730 has been written to the fourth logical block 7123 of partition 706. The host identifies which logical block 712 of partition 706 to use to write the data associated with the first command 730. The host device can select any available logical block 712 of partition 706 between ZSLBA and ZSLBA+ZCAP, and the selection need not be sequential. Since the host device specifically identifies one or more logical blocks 712 of partition 706 to store data, there is no need to use a write pointer.
[0088] The controller then retrieves the first command 730, the DMA reads the data associated with the first command 730, and writes the data to the selected logical block 712 (i.e., the fourth logical block 7123) identified by the host device. When the data associated with the first command 730 is programmed to the fourth logical block 7123, the NAND address associated with the fourth logical block 7123 may be the first available NAND location in the NAND or NVM of the storage device (i.e., the corresponding LBA pointer points to the first available NL in the NAND). For example, the NAND address of the data of the first command 730 may be the first NAND location NL0. Using a conventional partition append command, the fourth logical block 7123 corresponds to the fourth NL in the NAND (e.g., the fourth NAND location NL3). Therefore, even if the LBAs of partition 706 are not programmed sequentially, the NAND or NVM is programmed sequentially. Then update Figure 8800 of the table 800, and returns a completion entry to the completion queue of the host device to notify the host device that the data associated with the first command 730 has been stored in the selected logical block 7123 identified by the host device.
[0089] Both the host device and the storage device can separately track which logical blocks 712 of the partition 706 have been used to store data. Once the logical block 712 has been written, both the host device and the storage device track whether the written logical block 712 cannot or is not available to store more data until the partition 706 returns to an empty state again.
[0090] Figure 7C Partition 706 is shown after a second command 732 to partition 706 has been retrieved from the host device and the data associated with the second command 732 has been written to the seventh logical block 7126 of partition 706. The host again identifies which logical block 712 of partition 706 to use to write the data associated with the second command 732. The host device can select any available logical block 712 of partition 706 between ZSLBA and ZSLBA+ZCAP, except for the fourth logical block 7123 that has stored the state associated with the first command 730. The host device's selection of logical blocks 712 does not need to be sequential. For example, the data associated with the first command 730 is stored in the fourth logical block 7123, while the data associated with the second command 732 will be stored in the seventh logical block 7126.
[0091] The controller then retrieves the second command 732, the DMA reads the data associated with the second command 732, and writes the data to the selected logical block 712 (i.e., the seventh logical block 7126) identified by the host device. When the data associated with the second command 732 is programmed to the seventh logical block 7126, the NAND address associated with the seventh logical block 7126 may be the next available NL in the NAND or NVM of the storage device (i.e., the corresponding LBA pointer points to the next available NL in the NAND). For example, the NAND address of the data of the second command 732 may be the second NAND location NL1. Using a conventional partition append command, the seventh logical block 7126 corresponds to the seventh NL in the NAND (e.g., the seventh NL6). Therefore, even if the LBAs of the partition 706 are not programmed sequentially, the NAND or NVM is programmed sequentially. The update is then performed. Figure 8 800 of the table 800 and returns a completion entry to the completion queue of the host device to notify the host device that the data associated with the second command 732 has been stored in the selected logical block 7126 identified by the host device.
[0092] Fig.7DPartition 706 is shown after a third command 734 to partition 706 has been retrieved from the host device and data associated with the third command 734 has been written to the second logical block 7121, the third logical block 7122, and the eighth logical block 7127 of partition 706. The host again identifies which logical blocks 712 of partition 706 write the data associated with the third command 734, which requires more than one logical block 712. The host device can select any available logical block 712 of partition 706 between ZSLBA and ZSLBA+ZCAP, except for the fourth logical block 7123 and the seventh logical block 7126, which have stored states associated with the first command 730 and the second command 732, respectively. The host device's selection of logical blocks 712 need not be sequential. For example, data associated with the third command 734 will be stored in the second logical block 7121, the third logical block 7122, and the eighth logical block 7127.
[0093] Then, the controller retrieves the third command 734, DMA reads the data associated with the third command 734, and writes the data to the selected logical blocks 712 (i.e., the second logical block 7121, the third logical block 7122, and the eighth logical block 7127) identified by the host device. When the data associated with the third command 734 is programmed to the second logical block 7121, the third logical block 7122, and the eighth logical block 7127, the NAND addresses associated with the second logical block 7121, the third logical block 7122, and the eighth logical block 7127 may be the next available NL in the NAND or NVM of the storage device (i.e., the corresponding LBA pointer points to the next available NL in the NAND). For example, the NAND address of the data of the third command 734 may be the third NAND position NL2, the fourth NAND position NL3, and the fifth NAND position NL4. Using the conventional partition append command, the second logical block 7121, the third logical block 7122, and the eighth logical block 7127 correspond to the second NL, the third NL, and the eighth NL in the NAND, respectively (e.g., the second NAND position NL1, the third NAND position NL2, and the eighth NAND position NL7). Therefore, even if the LBAs of the partition 706 are not programmed sequentially, the NAND or NVM is programmed sequentially. Then update Figure 8 800 of the host device, and returns a completion entry to the completion queue of the host device to notify the host device that the data associated with the third command 734 has been stored in the selected logical blocks 7121, 7122, 7127 identified by the host device.
[0094] Fig. 7EPartition 706 is shown after a fourth command 736 for partition 706 has been retrieved from the host device and data associated with the fourth command 736 has been written to the fifth logical block 7124 and the sixth logical block 7125 of partition 706. The host again identifies which logical blocks 712 of partition 706 are to be written with data associated with the fourth command 736, which requires more than one logical block 712. In addition to the second logical block 7121 to the fourth logical block 7123, the seventh logical block 7126, and the eighth logical block 7127, which have stored states associated with the first command 730, the second command 732, and the third command 734, the host device can select any available logical block 712 of partition 706 between ZSLBA and ZSLBA+ZCAP. The host device's selection of logical blocks 712 need not be sequential; however, if so selected, the host device can select sequential logical blocks. For example, data associated with the fourth command 736 will be stored in the fourth logical block 7123 and the fifth logical block 7124.
[0095] The controller then retrieves the fourth command 736, the DMA reads the data associated with the fourth command 736, and writes the data to the selected logical block 712 (i.e., the fourth logical block 7123 and the fifth logical block 7124) identified by the host device. When the data associated with the fourth command 736 is programmed to the fourth logical block 7123 and the fifth logical block 7124, the NAND address associated with the fourth logical block 7123 and the fifth logical block 7124 may be the next available NL in the NAND or NVM of the storage device (i.e., the corresponding LBA pointer points to the next available NL in the NAND). For example, the NAND address of the data of the fourth command 736 may be the sixth NAND position NL5 and the seventh NAND position NL6. Using a conventional partition append command, the fourth logical block 7123 and the fifth logical block 7124 correspond to the fourth NL and the fifth NL in the NAND (e.g., the fourth NAND position NL3 and the fifth NAND position NL4), respectively. Therefore, even if the LBAs of the partition 706 are not programmed sequentially, the NAND or NVM is programmed sequentially. Then update Figure 8 800 of the table 800 and returns a completion entry to the completion queue of the host device to notify the host device that the data associated with the fourth command 736 has been stored in the selected logical blocks 7123, 7124 identified by the host device.
[0096] Figure 7FPartition 706 is shown after a fifth command 738 for partition 706 has been retrieved from the host device and data associated with the fifth command 738 has been written to the first logical block 712o of partition 706. The host again identifies which logical block 712 of partition 706 to use to write the data associated with the fifth command 738. The host device may select any available logical block 712 of partition 706 between ZSLBA and ZSLBA+ZCAP, except for the second through eighth logical blocks 7121-7127, which have stored states associated with the first through fourth commands 730-736.
[0097] The controller then retrieves the fifth command 738, the DMA reads the data associated with the fifth command 738, and writes the data to the selected logical block 712 (i.e., the first logical block 7120) identified by the host device. When the data associated with the fifth command 738 is programmed to the first logical block 712o, the NAND address associated with the first logical block 7120 may be the next available NL in the NAND or NVM of the storage device (i.e., the corresponding LBA pointer points to the next available NL in the NAND). For example, the NAND address of the data of the fifth command 738 may be the eighth NAND position NL7. With a conventional partition append command, the first logical block 7120 corresponds to the first NL in the NAND (e.g., the first NAND position NL0). Therefore, even if the LBAs of the partition 706 are not programmed sequentially, the NAND or NVM is programmed sequentially. The update is then performed. Figure 8 800 of the host device and returns a completion entry to the completion queue of the host device to notify the host device that the data associated with the fifth command 738 has been stored in the selected logical block 7120 identified by the host device.
[0098] When the data associated with the fifth command 738 is written to the first logical block 7120, the partition 706 is in a full state, and the capacity of the partition 706 is fully utilized. A full partition is a partition that is completely filled with data, and there are no longer available blocks for writing data. Read commands for data stored in a full partition can still be executed. The ZM can reset a full partition, thereby scheduling the erasure of the data stored in the partition so that the partition switches back to an empty partition. Once the partition 706 erases the data, switches to the erase state, and then switches to the active state, the host device can select the logical block 712 of the partition 706 according to the above method to write data in any order. The host device is not limited to writing data to the partition 706 in the same sequence as described above, but can select any available logical block 712 in any order.
[0099] When erasing partition 706, the LBA pointers all point to default values, which means no physical location, such as NULL, 0x0000, 0xFFFF, etc. As the controller receives each write, the data is written to the next NAND location while checking the existing LBA value to ensure that it points to NULL. If the LBA value does not point to NULL in the tracking table 800, the controller determines that this is not the first time the LBA has been written to by the partition activity state during this duration. The write can optionally be rejected because the host does not comply with the new rule of writing each LBA only once. The reject write and security features enable the storage device to maintain sequential write traffic and ensure that the background garbage collection feature can continue to be turned off.
[0100] In contrast, in conventional methods, once a partition is erased, all LBAs point to a marker value, such as NULL, 0x0000, 0xFFFF, etc. As writes fill the partition sequentially, each LBA is written pointing to the next NAND location where data is placed. At the same time, the currently written LBA is checked to determine only if it is sequential with the last written LBA.
[0101] Using non-sequential writing to the partition, as shown in Figures 7 to Figure 8 As described above, rather than utilizing a partition attach command, the storage device is able to cut off the amount of work performed because the storage device tracks writes but does not have to track and update write pointers. In addition, unlike a partition attach command, the host device determines the LBA for storing data. Therefore, both storage device performance and host performance are improved, and storage device overhead is reduced.
[0102] A host device that wants to decide the LBA for storing data may be able to use this advantage to avoid race conditions. This allows some existing structures in host-side applications to continue without modification. For example, some host-side applications have one entity that knows all available storage LBAs, and this entity will manage write locations to other host applications. Using non-sequential writes to this partition, as shown in Figures 7 to 8, Figure 8 As described above, other applications in the host are allowed to keep their designated LBAs and consume their designated LBAs at a later time. Therefore, there is no danger of non-sequential writes to the partition. Since the storage device can turn off sequential write checking, the durability of the storage device is improved. The durability of the storage device is maintained because the incoming data can still be placed on the next available NAND location.
[0103] In one embodiment, a storage device includes: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition including a plurality of logical blocks; and a controller coupled to the media unit. The controller is configured to retrieve a first command to write data to a first partition and to directly memory access (DMA) read data associated with the first command, identify one or more first logical blocks of the first partition to write the data associated with the first command, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, retrieve a second command to write data to the first partition and to DMA read the data associated with the second command, and identify one or more second logical blocks of the first partition to write the data associated with the second command, wherein the one or more second logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, and wherein the one or more second logical blocks are separated from the one or more first logical blocks by one or more empty logical blocks.
[0104] The controller is further configured to write data associated with the first command before retrieving a second command for writing the data, and to write data associated with the second command after identifying one or more second logical blocks of the first partition. The controller is further configured to return a first completion entry to a completion queue of the host device after writing the data associated with the first command, and to return a second completion entry to a completion queue of the host device after writing the data associated with the second command. The controller is further configured to update one or more tracking tables after writing the data associated with the first command to indicate that the one or more first logical blocks are unavailable for writing data associated with a subsequent command after returning the first completion entry, and to update one or more tracking tables after writing the data associated with the second command to indicate that the one or more second logical blocks are unavailable for writing data associated with a subsequent command after returning the second completion entry.
[0105] The one or more tracking tables include a first tracking table stored in the storage device and a second tracking table stored in the host device. The host device uses the second tracking table to select one or more second blocks for storing data associated with the second command. The host device selects one or more first blocks for storing data associated with the first command.
[0106] In another embodiment, a storage device includes: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition including a plurality of logical blocks; and a controller coupled to the media unit. The controller is configured to retrieve a first command to write data to one or more first logical blocks in a first partition, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, write the data associated with the first command to the one or more first logical blocks of the first partition and to a first location in the media unit, retrieve a second command to write data to one or more second logical blocks in the first partition, wherein the one or more second logical blocks are between a partition start logical block address of the first partition and the partition capacity of the first partition, and wherein the one or more second logical blocks are non-sequential with the first one or more logical blocks, and write the data associated with the second command to the one or more second logical blocks of the first partition and to a second location in the media unit, the second location being located in a sequential position of the first location.
[0107] The controller is further configured to retrieve a third command to write data to one or more third logical blocks in the first partition, wherein the one or more third logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, and wherein the one or more third logical blocks are non-sequential with respect to the one or more second logical blocks, and write the data associated with the third command to the one or more third logical blocks of the first partition and to a third location in the media unit, the third location being located in a sequential position with respect to the second location. Write the data associated with the second command to two or more second logical blocks, and the two or more second logical blocks are non-sequential with respect to each other. The host device selects the one or more first blocks for storing the data associated with the first command and the one or more second logical blocks for storing the data associated with the second command.
[0108] The controller is further configured to return a first completion entry to a completion queue of the host device after writing data associated with the first command, and to update one or more tracking tables after writing data associated with the first command to indicate that the one or more first logical blocks are unavailable for writing data associated with a subsequent command. At least one of the one or more tracking tables is stored in a media unit of the storage device.
[0109] In yet another embodiment, a storage system includes: a host device including a first tracking table; and a storage system. The storage system includes: a media unit, wherein a capacity of the media unit is divided into a plurality of partitions, each partition including a plurality of logical blocks, and wherein the media unit stores a second tracking table; and a controller coupled to the media unit. The controller is configured to retrieve a first command to write data to one or more first logical blocks in a first partition and DMA read the data associated with the first command, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, write the data associated with the first command to the one or more first logical blocks of the first partition, update the first tracking table and the second tracking table to indicate that the one or more first logical blocks are not available for writing data associated with a subsequent command, retrieve a second command to write data to one or more second logical blocks in the first partition and DMA read the data associated with the second command, wherein the one or more second logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein at least one of the one or more second logical blocks is non-sequential with the one or more first logical blocks, write the data associated with the second command to the one or more second logical blocks of the first partition; and update the first tracking table and the second tracking table to indicate that the one or more second logical blocks are not available for writing data associated with a subsequent command.
[0110] The controller is further configured to retrieve a third command to write data to one or more third logical blocks in the first partition and DMA read data associated with the third command, wherein the one or more third logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, and wherein the one or more third logical blocks are non-sequential with at least one or more second logical blocks, write data associated with the third command to the one or more third logical blocks of the first partition, and update the first tracking table and the second tracking table to indicate that the one or more third logical blocks are not available for writing data associated with subsequent commands. The controller is further configured to retrieve a third command to write data to two or more third logical blocks in the first partition and DMA read data associated with the third command, wherein the two or more third logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, and wherein at least one of the two or more third logical blocks is disposed between the first one or more logical blocks and the one or more second logical blocks, write data associated with the third command to the two or more third logical blocks of the first partition, and update the first tracking table and the second tracking table to indicate that the two or more third logical blocks are not available for writing data associated with subsequent commands.
[0111] The controller is further configured to retrieve a third command to write data to two or more third logical blocks in the first partition and DMA read data associated with the third command, wherein the two or more third logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition, and wherein at least one of the two or more third logical blocks is sequentially located before the one or more first logical blocks or the one or more second logical blocks, write the data associated with the third command to the two or more third logical blocks of the first partition, and update the first tracking table and the second tracking table to indicate that the two or more third logical blocks are not available for writing data associated with a subsequent command. The host device selects the one or more first blocks for storing the data associated with the first command and the one or more second logical blocks for storing the data associated with the second command based on the first tracking table.
[0112] The controller is further configured to return a first completion entry to a completion queue of the host device after writing the data associated with the first command, and wherein the host device updates the first tracking table after receiving the first completion entry. The data associated with the second command is written to the two or more second logic blocks, and wherein the two or more second logic blocks are separated from each other by one or more empty logic blocks or more first logic blocks.
[0113] While the foregoing is directed to embodiments of the present disclosure, other and further embodiments of the present disclosure may be envisaged without departing from the basic scope of the present disclosure, and the scope of the present disclosure is determined by the appended claims.
Claims
1. A storage device, comprising: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition comprising a plurality of logical blocks; and A controller is coupled to the media unit, the controller being configured to: Retrieving a first command to write data to a first partition and directly memory accessing (DMA) reading the data associated with the first command; identifying one or more first logical blocks of the first partition to write the data associated with the first command, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition; writing the data associated with the first command to one or more first logical blocks of the first partition; retrieving a second command to write data to the first partition and DMA reading data associated with the second command; identifying one or more second logical blocks of the first partition to write the data associated with the second command, wherein the one or more second logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein the one or more second logical blocks are separated from the one or more first logical blocks by one or more empty logical blocks; writing the data associated with the second command to the one or more second logical blocks of the first partition while the one or more empty logical blocks remain empty after DMA reading the data associated with the second command; as well as Retrieving one or more additional commands to write data to the first partition and sequentially or non-sequentially writing the data associated with the one or more additional commands to one or more available logical blocks within the first partition until the first partition reaches the partition capacity, wherein once the first partition reaches the partition capacity, scheduling erasure of all data stored within the first partition.
2. The storage device according to claim 1, wherein the controller is further configured to: The data associated with the first command is written prior to retrieving the second command to write the data.
3. The storage device according to claim 2, wherein the controller is further configured to: returning a first completion entry to a completion queue of a host device after writing the data associated with the first command; and After writing the data associated with the second command, returning a second completion entry to the completion queue of the host device.
4. The storage device according to claim 3, wherein the controller is further configured to: updating one or more tracking tables after writing the data associated with the first command to indicate that the one or more first logic blocks are unavailable for writing data associated with a subsequent command after returning the first completion entry; and The one or more tracking tables are updated after writing the data associated with the second command to indicate that the one or more second logic blocks are unavailable for writing data associated with a subsequent command after returning the second completion entry. 5 . The storage device of claim 4 , wherein the one or more tracking tables include a first tracking table stored in the storage device and a second tracking table stored in the host device. 6 . The storage device of claim 5 , wherein the host device uses the second tracking table to select the one or more second logical blocks for storing the data associated with the second command.
7. The storage device of claim 1, wherein a host device selects the one or more first logical blocks for storing the data associated with the first command.
8. A storage device, comprising: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition comprising a plurality of logical blocks; and A controller is coupled to the media unit, the controller being configured to: retrieving and reading a first command to write data to one or more first logical blocks in a first partition, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition; Immediately after reading the first command, writing the data associated with the first command to the one or more first logical blocks of the first partition and to a first location in the media unit; retrieving and reading a second command to write data to one or more second logical blocks in the first partition, wherein the one or more second logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein the one or more second logical blocks are non-sequential with the one or more first logical blocks; writing the data associated with the second command to the one or more second logical blocks of the first partition and to a second location in the media unit, the second location being located in a sequential position of the first location, when one or more empty logical blocks remain empty between the one or more first logical blocks and the one or more second logical blocks after reading the second command; as well as Retrieving one or more additional commands to write data to the first partition and sequentially or non-sequentially writing the data associated with the one or more additional commands to one or more available logical blocks within the first partition until the first partition reaches the partition capacity, wherein once the first partition reaches the partition capacity, scheduling erasure of all data stored within the first partition.
9. The storage device of claim 8, wherein before retrieving one or more additional commands, the controller is further configured to: retrieving a third command to write data to one or more third logical blocks in the first partition, wherein the one or more third logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein the one or more third logical blocks are non-sequential with the one or more second logical blocks; and The data associated with the third command is written to the one or more third logical blocks of the first partition and to a third location in the media unit, the third location being located sequentially from the second location.
10. The storage device of claim 8, wherein the data associated with the second command is written to two or more second logical blocks, and wherein the two or more second logical blocks are non-sequential with respect to each other.
11. The storage device of claim 8, wherein a host device selects the one or more first logical blocks for storing the data associated with the first command and the one or more second logical blocks for storing the data associated with the second command.
12. The storage device of claim 8, wherein before retrieving one or more additional commands, the controller is further configured to: returning a first completion entry to a completion queue of a host device after writing the data associated with the first command; and One or more tracking tables are updated after writing the data associated with the first command to indicate that the one or more first logical blocks are unavailable for writing data associated with a subsequent command.
13. The storage device of claim 12, wherein at least one of the one or more tracking tables is stored in the media unit of the storage device.
14. A storage system comprising: a host device, the host device comprising a first tracking table; and A storage system, wherein the storage system comprises: a media unit, wherein the capacity of the media unit is divided into a plurality of partitions, each partition comprising a plurality of logical blocks, and wherein the media unit stores a second tracking table; and A controller is coupled to the media unit, the controller being configured to: retrieving a first command to write data to one or more first logical blocks in a first partition and DMA reading data associated with the first command, wherein the one or more first logical blocks are between a partition start logical block address of the first partition and a partition capacity of the first partition; writing the data associated with the first command to the one or more first logical blocks of the first partition immediately after retrieving the first command and DMA reading the data associated with the first command; updating the first tracking table and the second tracking table to indicate that the one or more first logical blocks are unavailable for writing data associated with a subsequent command; retrieving a second command to write data to one or more second logical blocks in the first partition and DMA reading data associated with the second command, wherein the one or more second logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein at least one of the one or more second logical blocks is non-sequential with the one or more first logical blocks; writing the data associated with the second command to the one or more second logical blocks of the first partition when one or more empty logical blocks remain empty between the one or more first logical blocks and the one or more second logical blocks after retrieving the second command and DMA reading the data associated with the second command; updating the first tracking table and the second tracking table to indicate that the one or more second logical blocks are unavailable for writing data associated with a subsequent command; and Retrieving one or more additional commands to write data to the first partition and sequentially or non-sequentially writing the data associated with the one or more additional commands to one or more available logical blocks within the first partition until the first partition reaches the partition capacity, wherein once the first partition reaches the partition capacity, scheduling erasure of all data stored within the first partition.
15. The storage system of claim 14, wherein before retrieving one or more additional commands, the controller is further configured to: retrieving a third command to write data to one or more third logical blocks in the first partition and DMA reading data associated with the third command, wherein the one or more third logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein the one or more third logical blocks are non-sequential with at least the one or more second logical blocks; writing the data associated with the third command to the one or more third logical blocks of the first partition; and The first tracking table and the second tracking table are updated to indicate that the one or more third logical blocks are unavailable for writing data associated with a subsequent command.
16. The storage system of claim 14, wherein before retrieving one or more additional commands, the controller is further configured to: retrieving a third command to write data to two or more third logical blocks in the first partition and DMA reading data associated with the third command, wherein the two or more third logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein at least one of the two or more third logical blocks is disposed between the one or more first logical blocks and the one or more second logical blocks; writing the data associated with the third command to the two or more third logical blocks of the first partition; as well as The first tracking table and the second tracking table are updated to indicate that the two or more third logical blocks are unavailable for writing data associated with a subsequent command.
17. The storage system of claim 14, wherein before retrieving one or more additional commands, the controller is further configured to: retrieving a third command to write data to two or more third logical blocks in the first partition and DMA reading data associated with the third command, wherein the two or more third logical blocks are between the partition start logical block address of the first partition and the partition capacity of the first partition, and wherein at least one of the two or more third logical blocks is sequentially located before the one or more first logical blocks or the one or more second logical blocks; writing the data associated with the third command to the two or more third logical blocks of the first partition; and The first tracking table and the second tracking table are updated to indicate that the two or more third logical blocks are unavailable for writing data associated with a subsequent command.
18. The storage system of claim 14, wherein the host device selects the one or more first logical blocks for storing the data associated with the first command and the one or more second logical blocks for storing the data associated with the second command based on the first tracking table.
19. The storage system of claim 18, wherein the controller is further configured to return a first completion entry to a completion queue of the host device after writing the data associated with the first command, and wherein the host device updates the first tracking table after receiving the first completion entry.
20. The storage system of claim 14, wherein the data associated with the second command is written to two or more second logical blocks, and wherein the two or more second logical blocks are separated from each other by one or more empty logical blocks or at least one of the one or more first logical blocks.
