Dynamic Write Cache Management in Mixed Workload

A dynamic write cache size in data storage devices adapts to varying workloads, optimizing performance and reducing power consumption by adjusting cache size based on read-write ratios, addressing inefficiencies in fixed cache systems.

US20260377322A1Pending Publication Date: 2026-11-26SANDISK TECHNOLOGIES LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/215002
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Fixed write cache sizes in data storage devices lead to inefficient usage, increased search time, and higher power consumption due to varying workloads, particularly in mixed read-write scenarios, as they lack adaptability and result in suboptimal performance and complexity.

Method used

Implementing a dynamic write cache size that adjusts based on the current workload, using a smaller cache for heavy read situations and a larger cache for heavy write situations to optimize performance and reduce power usage.

Benefits of technology

The dynamic write cache size improves performance by reducing search time and power consumption, enhances write quality of service, and mitigates bottlenecks associated with fixed cache sizes, while maintaining efficient resource allocation and responsiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260377322A1-D00000_ABST
    Figure US20260377322A1-D00000_ABST
Patent Text Reader

Abstract

Using a write cache involves searching an overlap table followed by fetching the data from the write cache, but not all workloads are identical. Some workloads are more read intensive while other workloads are more write intensive, and a fixed write cache size means inefficient write cache usage. The search can take time, decrease performance, and increase power usage. However, by using a dynamic write cache size, power usage can be decreased and performance can be increased by decreasing the search time. The write cache size changes based upon the data storage device workload. For heavy read situations, a smaller write cache is used, but for heavy write situations, a larger write cache is used. In so doing, write cache usage is improved.
Need to check novelty before this filing date? Find Prior Art

Description

BACKGROUND OF THE DISCLOSUREField of the Disclosure

[0001] Embodiments of the present disclosure generally relate to improving write cache usage.Description of the Related Art

[0002] Data storage devices or solid state devices (SSDs) are used to store data for a host device. The host device will often send new data to the controller of the data storage device to be written to a memory device of the data storage device. The host device will also send read commands to the controller to instruct the controller to read data from the memory device and provide the data back to the host device.

[0003] In order to accelerate the execution of write commands and achieve better performance and better management of the memory device (e.g., NAND), a write cache is used. The data storage device does not operate by receiving one command from the host device and then immediately writing the data to the memory device. Instead, the data storage device will accumulate some write data in a write cache. The write cache could be a type of random access memory (RAM) such as static RAM (SRAM) or dynamic RAM (DRAM), but typically not NAND. The data storage device will accumulate the data and only after exceeding a threshold, will write the data to the memory device (e.g., NAND). Using a write cache is used to improve the performance because it is not efficient to write small chunks to the memory device (e.g., NAND). Therefore it is much better for performance to write chunks of data together.

[0004] When writing chunks of data, the data storage device needs to be careful because before writing the data to the memory device (e.g., NAND), the data storage device sends a completion to the host device and, from the host device point of view, the data was already written to the memory device (e.g., NAND). The write to the memory device (e.g., NAND) will occur eventually, but if the host device sends a read command to the same logical block address (LBA), the data storage device needs to determine if the data is stored in the write cache. If the data is in the write cache, then in order to provide the host device will the correct data and have coherency, the data will be read from the write cache and not the memory device (e.g., NAND) even though the host device believes the data is in the memory device (e.g., NAND).

[0005] In order to know the data is in the write cache, the data storage device maintains an overlap table implemented in the host interface module (HIM). The overlap table contains marks for LBAs that are stored in the write cache and not in the memory device (e.g., NAND). Whenever receiving any read commands, the data storage device will need to scan the write cache in order to make sure that the data is not in the write cache. If the data is in the write cache, then the data storage device cannot read the data from the memory device (e.g., NAND), which is the typical read command flow, but will need to read the data from the write cache.

[0006] Efficient usage of the write cache is challenging. Therefore, there is a need in the art for improving write cache usage.SUMMARY OF THE DISCLOSURE

[0007] Using a write cache involves searching an overlap table followed by fetching the data from the write cache, but not all workloads are identical. Some workloads are more read intensive while other workloads are more write intensive, and a fixed write cache size means inefficient write cache usage. The search can take time, decrease performance, and increase power usage. However, by using a dynamic write cache size, power usage can be decreased and performance can be increased by decreasing the search time. The write cache size changes based upon the data storage device workload. For heavy read situations, a smaller write cache is used, but for heavy write situations, a larger write cache is used. In so doing, write cache usage is improved.

[0008] In one embodiment, a data storage device comprises: a memory device; and a controller coupled to the memory device, wherein the controller is configured to: measure a current read and write workload; determine whether a change in the read and write workload has occurred; and change a write cache size based upon determining that the change in the read and write workload has occurred.

[0009] In another embodiment, a data storage device comprises: a memory device; and a controller coupled to the memory device, wherein the controller is configured to: determine that a read: write ratio has changed from a first ratio to a second ratio different from the first ratio, wherein the controller maintains a write cache having a first write cache size; select a second write cache size for the second ratio; and change the first write cache size to the second write cache size, wherein the second write cache size is different from the first write cache size.

[0010] In another embodiment, a data storage device comprises: means to store data; and a controller coupled to the means to store data, wherein the controller is configured to: dynamically adjust a write cache size of a write cache in response to detecting a change in a read: write ratio, wherein the controller comprises a write cache size logic module and a mixed workload detector module.BRIEF DESCRIPTION OF THE DRAWINGS

[0011] So that the manner in which the above recited features of the present disclosure can be understood in detail, a more particular description of the disclosure, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical embodiments of this disclosure and are therefore not to be considered limiting of its scope, for the disclosure may admit to other equally effective embodiments.

[0012] FIG. 1 is a schematic block diagram illustrating a storage system in which a data storage device may function as a storage device for a host device, according to certain embodiments.

[0013] FIG. 2 is a graph illustrating the search performance versus cache size in a fixed cache size scenario according to one embodiment.

[0014] FIG. 3 is a graph illustrating the search performance versus cache size in a dynamic size scenario according to one embodiment.

[0015] FIG. 4 is a flowchart illustrating utilizing a dynamic write cache size according to one embodiment.

[0016] FIG. 5 is a schematic illustration of a system for dynamic write cache size usage according to one embodiment.

[0017] FIG. 6 is a flowchart illustrating dynamic write cache size management according to one embodiment.

[0018] 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

[0019] In the following, reference is made to embodiments of the disclosure. However, it should be understood that the disclosure is not limited to specifically described embodiments. Instead, any combination of the following features and elements, whether related to different embodiments or not, is contemplated to implement and practice the disclosure. Furthermore, although embodiments of the disclosure may achieve advantages over other possible solutions and / or over the prior art, whether or not a particular advantage is achieved by a given embodiment is not limiting of the disclosure. Thus, the following aspects, features, embodiments, and advantages are merely illustrative and are not considered elements or limitations of the appended claims except where explicitly recited in a claim(s). Likewise, reference to “the disclosure” shall not be construed as a generalization of any inventive subject matter disclosed herein and shall not be considered to be an element or limitation of the appended claims except where explicitly recited in a claim(s).

[0020] Using a write cache involves searching an overlap table followed by fetching the data from the write cache, but not all workloads are identical. Some workloads are more read intensive while other workloads are more write intensive, and a fixed write cache size means inefficient write cache usage. The search can take time, decrease performance, and increase power usage. However, by using a dynamic write cache size, power usage can be decreased and performance can be increased by decreasing the search time. The write cache size changes based upon the data storage device workload. For heavy read situations, a smaller write cache is used, but for heavy write situations, a larger write cache is used. In so doing, write cache usage is improved.

[0021] FIG. 1 is a schematic block diagram illustrating a storage system 100 having a data storage device 106 that may function as a storage device for a host device 104, according to certain embodiments. For instance, the host device 104 may utilize a non-volatile memory (NVM) 110 included in data storage device 106 to store and retrieve data. The host device 104 comprises a host dynamic random access memory (DRAM) 138. In some examples, the storage system 100 may include a plurality of storage devices, such as the data storage device 106, which may operate as a storage array. For instance, the storage system 100 may include a plurality of data storage devices 106 configured as a redundant array of inexpensive / independent disks (RAID) that collectively function as a mass storage device for the host device 104.

[0022] The host device 104 may store and / or retrieve data to and / or from one or more storage devices, such as the data storage device 106. As illustrated in FIG. 1, the host device 104 may communicate with the data storage device 106 via an interface 114. The host device 104 may comprise any of a wide range of devices, including computer servers, network-attached storage (NAS) units, desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called “smart” phones, so-called “smart” pads, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming device, or other devices capable of sending or receiving data from a data storage device.

[0023] The host DRAM 138 may optionally include a host memory buffer (HMB) 150. The HMB 150 is a portion of the host DRAM 138 that is allocated to the data storage device 106 for exclusive use by a controller 108 of the data storage device 106. For example, the controller 108 may store mapping data, buffered commands, logical to physical (L2P) tables, metadata, and the like in the HMB 150. In other words, the HMB 150 may be used by the controller 108 to store data that would normally be stored in a volatile memory 112, a buffer 116, an internal memory of the controller 108, such as static random access memory (SRAM), and the like. In examples where the data storage device 106 does not include a DRAM (i.e., optional DRAM 118), the controller 108 may utilize the HMB 150 as the DRAM of the data storage device 106.

[0024] The data storage device 106 includes the controller 108, NVM 110, a power supply 111, volatile memory 112, the interface 114, a write buffer 116, and an optional DRAM 118. In some examples, the data storage device 106 may include additional components not shown in FIG. 1 for the sake of clarity. For example, the data storage device 106 may include a printed circuit board (PCB) to which components of the data storage device 106 are mechanically attached and which includes electrically conductive traces that electrically interconnect components of the data storage device 106 or the like. In some examples, the physical dimensions and connector configurations of the data storage device 106 may conform to one or more standard form factors. Some example standard form factors include, but are not limited to, 3.5″ data storage device (e.g., an HDD or SSD), 2.5″ data storage device, 1.8″ data storage device, peripheral component interconnect (PCI), PCI-extended (PCI-X), PCI Express (PCIe) (e.g., PCIe x1, x4, x8, x16, PCIe Mini Card, MiniPCI, etc.). In some examples, the data storage device 106 may be directly coupled (e.g., directly soldered or plugged into a connector) to a motherboard of the host device 104.

[0025] Interface 114 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. Interface 114 may operate in accordance with any suitable protocol. For example, the interface 114 may operate in accordance with 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), serially attached SCSI (SAS), PCI, and PCIe, non-volatile memory express (NVMe), OpenCAPI, GenZ, Cache Coherent Interface Accelerator (CCIX), Open Channel SSD (OCSSD), or the like. Interface 114 (e.g., the data bus, the control bus, or both) is electrically connected to the controller 108, 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 interface 114 may also permit the data storage device 106 to receive power from the host device 104. For example, as illustrated in FIG. 1, the power supply 111 may receive power from the host device 104 via interface 114.

[0026] The NVM 110 may include a plurality of memory devices or memory units. NVM 110 may be configured to store and / or retrieve data. For instance, a memory unit of NVM 110 may receive data and a message from controller 108 that instructs the memory unit to store the data. Similarly, the memory unit may receive a message from controller 108 that instructs the memory unit to retrieve data. In some examples, each of the memory units may be referred to as a die. In some examples, the NVM 110 may include a plurality of dies (i.e., a plurality of memory units). In some examples, each memory unit may be configured to store relatively large amounts of data (e.g., 128 MB, 256 MB, 512 MB, 1 GB, 2 GB, 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB, 256 GB, 512 GB, 1 TB, etc.).

[0027] In some examples, each memory unit may include any type of non-volatile memory devices, such as flash memory devices, phase-change memory (PCM) devices, resistive random-access memory (ReRAM) devices, magneto-resistive random-access memory (MRAM) devices, ferroelectric random-access memory (F-RAM), holographic memory devices, and any other type of non-volatile memory devices.

[0028] The NVM 110 may comprise a plurality of flash memory devices or memory units. NVM Flash memory devices may include NAND or NOR-based flash memory devices and may store data based on a charge contained in a floating gate of a transistor for each flash memory cell. In NVM flash memory devices, the flash memory device may be divided into a plurality of dies, where each die of the plurality of dies includes a plurality of physical or logical blocks, which may be further divided into a plurality of pages. Each block of the plurality of blocks within a particular memory device may include a plurality of NVM cells. Rows of NVM cells may be electrically connected using a word line to define a page of a plurality of pages. Respective cells in each of the plurality of pages may be electrically connected to respective bit lines. Furthermore, NVM flash memory devices may be 2D or 3D devices and may be single level cell (SLC), multi-level cell (MLC), triple level cell (TLC), or quad level cell (QLC). The controller 108 may write data to and read data from NVM flash memory devices at the page level and erase data from NVM flash memory devices at the block level.

[0029] The power supply 111 may provide power to one or more components of the data storage device 106. When operating in a standard mode, the power supply 111 may provide power to one or more components using power provided by an external device, such as the host device 104. For instance, the power supply 111 may provide power to the one or more components using power received from the host device 104 via interface 114. In some examples, the power supply 111 may include one or more power storage components configured to provide power to the one or more components when operating in a shutdown mode, such as where power ceases to be received from the external device. In this way, the power supply 111 may function as an onboard backup power source. Some examples of the one or more power storage components include, but are not limited to, capacitors, super-capacitors, batteries, and the like. In some examples, the amount of power that may be stored by the one or more power storage components may be a function of the cost and / or the 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 the size of the one or more power storage components also increases.

[0030] The volatile memory 112 may be used by controller 108 to store information. Volatile memory 112 may include one or more volatile memory devices. In some examples, controller 108 may use volatile memory 112 as a cache. For instance, controller 108 may store cached information in volatile memory 112 until the cached information is written to the NVM 110. As illustrated in FIG. 1, volatile memory 112 may consume power received from the power supply 111. Examples of 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, and the like)). Likewise, the optional DRAM 118 may be utilized to store mapping data, buffered commands, logical to physical (L2P) tables, metadata, cached data, and the like in the optional DRAM 118. In some examples, the data storage device 106 does not include the optional DRAM 118, such that the data storage device 106 is DRAM-less. In other examples, the data storage device 106 includes the optional DRAM 118.

[0031] Controller 108 may manage one or more operations of the data storage device 106. For instance, controller 108 may manage the reading of data from and / or the writing of data to the NVM 110. In some embodiments, when the data storage device 106 receives a write command from the host device 104, the controller 108 may initiate a data storage command to store data to the NVM 110 and monitor the progress of the data storage command. Controller 108 may determine at least one operational characteristic of the storage system 100 and store at least one operational characteristic in the NVM 110. In some embodiments, when the data storage device 106 receives a write command from the host device 104, the controller 108 temporarily stores the data associated with the write command in the internal memory or write buffer 116 before sending the data to the NVM 110. Controller 108 may include circuitry or processors configured to execute programs for operating the data storage device 106.

[0032] The controller 108 may include an optional second volatile memory 120. The optional second volatile memory 120 may be similar to the volatile memory 112. For example, the optional second volatile memory 120 may be SRAM. The controller 108 may allocate a portion of the optional second volatile memory to the host device 104 as controller memory buffer (CMB) 122. The CMB 122 may be accessed directly by the host device 104. For example, rather than maintaining one or more submission queues in the host device 104, the host device 104 may utilize the CMB 122 to store the one or more submission queues normally maintained in the host device 104. In other words, the host device 104 may generate commands and store the generated commands, with or without the associated data, in the CMB 122, where the controller 108 accesses the CMB 122 in order to retrieve the stored generated commands and / or associated data.

[0033] A data storage device's workload refers to the pattern and characteristics of data access operations, encompassing both reads and writes. The way data is accessed plays a role in determining the data storage device's responsiveness and overall efficiency. In scenarios characterized by random data access, read or write requests are dispersed across the storage medium with no order which presents a unique challenge, as the data storage device controller must swiftly locate and retrieve scattered data blocks. Random reads and writes are common in applications where data access is non-sequential, such as database queries, virtual memory operations, or certain file system activities.

[0034] Contrastingly, sequential data access involves reading or writing data in contiguous blocks or in a specific order. Sequential scenarios are prevalent in tasks such as streaming media playback, large file transfers, or data backups. The predictability of access patterns in sequential scenarios allows for optimized data retrieval, minimizing the mechanical movements within the storage device and potentially enhancing overall throughput.

[0035] In mixed scenarios, the workload encompasses a blend of both random and sequential read / write operations. This dynamic environment poses unique challenges as the data storage device must efficiently handle the varying demands of non-sequential and sequential data access. Mixed workloads are common in multifaceted applications where diverse data access patterns coexist, requiring adaptive strategies to balance responsiveness and throughput across the spectrum of read and write scenarios. Several benchmarks are defined with mixed workloads (e.g. 50:50, 70:30 & 90:10 read: write ratio).

[0036] The write cache in a data storage device functions as a temporary buffer for incoming write commands. When the host device issues a write command, the data storage device fetches the required data and temporarily stores the command in the write cache. Instead of immediately programming the data into the main storage medium (e.g., memory device or NAND), the data storage device strategically accumulates multiple write commands in the write cache. This delay optimizes the time-intensive programming stage, mitigating backpressure towards the host device.

[0037] Accumulating writes in the write cache enhances write quality of service (QOS), as multiple writes are efficiently programmed together. Completed write commands are marked as such towards the host device, allowing the data storage device to continue servicing new commands without waiting for write completions. Overlapping read commands are carefully managed to ensure the overlapping read commands don't coincide with cached writes, preventing discrepancies in data provided to the host device. In summary, the write cache optimizes write programming, improves write QoS, and efficiently manages overlapping read commands, contributing to the overall efficiency of the data storage device.

[0038] The data device controller maintains an overlap table containing logical block addresses (LBAs) that are currently held internally in the write cache and not yet located in the storage media (e.g., memory device or NAND). When a read command is received, the controller scans the overlap table to identify a potential match. If a match is found, the device controller refrains from accessing the media (e.g., memory device or NAND) to retrieve the data, as the data is already stored in the write cache. On receiving a write command, the overlap table is scanned to find a possible match. If no match is found, the relevant LBAs are added to the overlap table as the write command begins the execution phase.

[0039] The consideration of write cache size in a data storage device involves various tradeoffs, and finding the right balance impacts performance. On one hand, a larger write cache size generally improves performance and reduces latency by accommodating more write commands and optimizing the timing of programming to the media (e.g., memory device or NAND). Additionally, a larger write cache can enhance write QoS as multiple writes are efficiently programmed together. On the other hand, opting for a larger write cache size comes with tradeoffs. Larger write caches increase the physical area and cost of the device controller, introducing additional latency for reads and potential performance impacts. Furthermore, a larger write cache introduces complexity in cache management algorithms and mechanisms.

[0040] The embodiments discussed herein tackle the challenge of write cache management in a data storage device without causing negative impacts on system performance, QoS, and complexity. The embodiments herein introduce the concept of a dynamic write cache size based on the current mixed workload and the required performance.

[0041] Previously, the device controller employed a fixed-size write cache optimized for the worst-case scenario of a sequential write workload. Unfortunately, the fixed write cache size lacks adaptability, remaining constant irrespective of the current workload, be it pure random / sequential reads or a mixed workload, even when such a size is unnecessary. Such an unyielding approach introduces extra complexity, particularly in supporting the performance of the overlap table. For instance, maintaining a fixed write cache size poses challenges, especially in achieving the search operation performance during a mixed workload. The static write cache size leads to a persistent full cache condition, significantly impacting the device controller's performance and power consumption.

[0042] In a pure random read situation, the write cache is empty because there are no writes and therefore very high performance in the overlap table is not necessary. For a mixed workload, for example 95% read commands and only 5% write commands, the performance requirement is decreased, but eventually after some time, the write cache will fill, even though most of the commands are read commands because it is very easy to fill the write cache and later on, program the data. Write performance is much lower compared to read performance because of the program time. The data storage device usually saturates the host interface for read performance, but not for write performance. The write command bottleneck could be in the memory device (e.g., NAND) or in the processors in the device controller, but not in the host interface.

[0043] Taking the worst case scenario of the performance and applying the worst case scenario to all scenarios is not efficient. The worst case performance requirement is a pure read scenario with no writes, but such is not realistic because a random read workload is not 100% random.

[0044] The embodiments herein focus on dynamic write cache management in a data storage device, addressing challenges associated with fixed-size write caches. In the traditional approach, a data storage device typically employs a fixed-size write cache optimized for the worst-case scenario of a sequential write workload. However, the fixed size lacks adaptability, leading to suboptimal performance and increased complexity in the device controller.

[0045] The proposed dynamic write cache management introduces flexibility by adjusting the write cache size based on the current mixed workload and required performance. Unlike the static approach, the dynamic concept optimizes resource utilization by allocating cache space proportional to the specific demands of varying workloads, whether they involve random or sequential reads, writes, or a mixed combination. By doing so, the dynamic write cache management enhances overall system responsiveness, improves write QoS, and mitigates potential bottlenecks associated with fixed cache sizes. The embodiments discussed herein aim to strike a balance between efficient resource allocation and responsiveness, offering a more adaptive and efficient solution for data storage systems under diverse operational conditions.

[0046] FIG. 2 is a graph 200 illustrating the search performance versus cache size in a fixed cache size scenario according to one embodiment. FIG. 3 is a graph 300 illustrating the search performance versus cache size in a dynamic size scenario according to one embodiment. FIGS. 2 and 3 show the search engine performance and write cache size as a function of the mixed workload for a fixed write cache size (FIG. 2) and a dynamic write cache size (FIG. 3). Search performance assumes that the overlap table is full. If the overlap table is not full, more searches could be completed at the same time. For instance, when the overlap table is full, one implementation can complete 2M (i.e., 2 million) searches per second, which is equivalent to 4M searches when the overlap table is in utilization of 50%.

[0047] A random read search performance have an expectation of almost 7M input / output operations per second (IOPS), but for a random write search performance, the expectation is closer to 2M IOPS. The random read performance is much higher than the random write performance and the mixed workload has a performance therebetween. FIG. 2 shows that when there is a fixed cache size, the search performance drops with more and more random writes.

[0048] FIG. 2 shows a mixed workload with the percentages of read commands decreasing from left to right and the percentage of write commands increasing from left to right. The pure read workload (i.e., 100% read and 0% write) and pure write workload (0% read and 100% write) are identified by 100% and 0% respectively. The numbers show the performance for the pure write scenario is 2M IOPS as the required performance. There is no read workload so support for 6.8M IOPS (pure read workload scenario) is not needed. The data storage device needs to support the 2M IOPS and therefore the 2M IOPS is the performance required for the search engine. For a pure read workload or an almost pure read workload, the write cache is empty (or almost close to empty) and a very high search performance is not needed.

[0049] Stated another way, in FIG. 2, the cache size is fixed to 8K entries. In a pure random write workload (0%), the required performance of the overlap table is 2M searches per second which is equal to the write performance while assuming the write cache is full. In a pure random read scenario, the required performance of the overlap table is 6.8M searches per second which is equal to the read performance. The assumption is that the write cache could be full due to previous write commands. The performance in the different workloads is presented in Table I below. The bottom line is that in FIG. 2, the search engine supports 6.8M searches per second which is extremely high. The search engine requires the performance of 6.8M searches / sec in FIG. 2.TABLE IMixed Workload (%CacheSearch Performanceof read commands)size(Meg Searches / Sec)100% 81926.890%81925.880%81925.670%81925.460%81925.250%8192540%81924.830%81924.420%8192410%81923.6 0%81922

[0050] In FIG. 3, the write cache size is changed dynamically as a function of the current mixed workload. The more percentage of read commands, the lower write cache size. The performance of the search engine is calculated accordingly. In a pure random write workload (0%), the required performance of the overlap table is 2M searches per second which is equal to the write performance while assuming the write cache is full. In a pure random read scenario, the write cache size is 512 entries and the required performance of the overlap table is 6.8M searches per second but since the write cache size is much smaller, it is equivalent to 0.425M searches per second. The performance in the different workloads is presented in Table II. The bottom line is that in the FIG. 3 approach, the search engine supports 3.3M searches per second which is extremely high. This is one key advantage introduced by this concept. The search engine requires the performance of 3.3M searches / sec.TABLE IIMixed Workload (%CacheSearch Performanceof read commands)size(Meg Searches / Sec)100% 5120.42590%5120.362580%10240.770%20481.3560%30721.9550%40962.540%5120330%61443.320%71683.510%81923.6 0%81922

[0051] In a pure write workload, the data storage device needs the maximum size of the write cache, 8K in the examples shown in FIGS. 2 and 3. For the write cache size when there is a pure write workload or even an almost pure write workload, the write cache can be the maximum cache size, 8K for example. For other scenarios, such as when there are many or a pure read workload (i.e., 100%), then the data storage device can minimize the write cache size because the data storage device does not really need 8K entries for the write cache for the overlap table. The benefit would be because there are less entries in the overlap table, then there are less entries to scan for each and every read command. The overall performance required by the search engine would be much lower as shown by the numbers in Table II. The point is that the size of the write cache decreased and therefore there are less entries to scan. Additionally, most of the write cache would be would be empty in a 90% or 100% read workload.

[0052] So the trick is to have a dynamic cache write size based on the current workload in the system. If there is a heavy write workload, the write cache size would be in maximum, but if there is a heavy read workload, the write cache size would be minimal. In between the maximum and minimum would be a linear like approach as shown in FIG. 3, but the point is that instead of supporting in the search engine almost 7M IOPS for this specific engine, the write cache supports up to 3.6M IOPS as the maximum value. There is no impact on the host device because the host device will see the same performance. The benefit here is in power because the data storage device does not need to scan an entire, full size write cache while the write cache size is in maximum level for each and every command. Instead, the data storage device needs to scan the write cache sized appropriately for the workload. The search engine is much simpler for implementation because the search engine will not be stressed in order to achieve the performance requirement. It is to be noted that whenever the data storage device is not in a pure write workload, the normal write cache size (i.e., maximum write cache in pure write mode) is reallocated for some other use in order to increase the read performance.

[0053] FIG. 4 is a flowchart 400 illustrating utilizing a dynamic write cache size according to one embodiment that summarizes the concept of the dynamic write cache size. Once the initialization is done at block 402, and the device controller is in idle state, the controller assumes random read workload and therefore the overlap table size is set to the minimum value at block 404. The device controller continuously measures the current workload at block 406. If a change in workload has been detected at block 408, the write cache size is adapted accordingly at block 410, but if no change is detected, the process loops back to block 406.

[0054] Stated another way, the data storage device controller assumes at the beginning a pure read workload and then measures the current workload at the interface with the host device. The controller then decides whether to change the size of the write cache because of the workload. If no change, the controller will continue to keep track of the workload and measure the current workload periodically. If there is a change and the controller decides to adapt in order to have better performance, then the controller will adapt the write cache size accordingly. The controller will always continue to measure the current workload and from time to time will adapt the write cache size in order to maximize the performance.

[0055] FIG. 5 is a schematic illustration 500 of a system for dynamic write cache size usage according to one embodiment. The host interface module (HIM) includes a write cache dynamic size logic module and a mixed workload detector module. The mixed workload detector module detects the current mixed workload running in the data storage device and based on the detection, the write cache size is configured which allows the data storage device to have relaxation in the performance of the overlap search engine. As also shown in FIG. 5, the HIM comprises a PCIe PHY / MAC, and HIM accelerators. The controller includes a command scheduler coupled to a flash interface module (FIM) which is coupled to the memory device (e.g., NAND). The controller also includes a DDR controller which is coupled to volatile memory (e.g., DRAM). The DDR controller is coupled to the HIM via the NVMe module. The controller also includes an encryption / decryption module coupled to the HIM and a data path coupled to the FIM and encryption / decryption module. The data path includes a RAID and ECC.

[0056] FIG. 6 is a flowchart 600 illustrating dynamic write cache size management according to one embodiment. The process starts at block 602. The data storage device starts with the assumption of a pure random read scenario. A pure random read scenario means that the write cache will be in the smallest setting because in the pure random read scenario, no writes occur and no data will be placed in the write cache.

[0057] The data storage device starts to receive commands at block 604 followed by a determination at block 606 regarding whether any write commands have been received. If no write commands have been received, then there is no change to the write cache size at block 608 followed by proceeding to block 618.

[0058] If there have been write commands received, then a determination of the read: write ratio is made at block 610 and the write cache size that matches the determined ratio is selected at block 612. The controller then determines whether the write cache size needs adjusted at block 614. In one embodiment, the controller maintains a table of the ratio and corresponding write cache size entries that may be used in the determining. In one embodiment, the controller compares the current write cache size to the determined write cache size. If the determined matches the current, then there is no adjustment needed. If the current and determined do not match, then the write cache size adjustment is needed. If no adjustment is needed, then the process proceeds to block 618. If there is an adjustment needed, then the process proceeds to block 616 where the write cache size is adjusted followed by proceeding to block 618. At block 618, the data storage device operates with the current write cache size for a predetermined threshold, such as a period of time, followed by returning to block 610. Depending upon whether block 618 is approached from block 616 or blocks 608 and 614, the current write cache size may be a new write cache size (after the adjustment) or simply an unchanged write cache size. The predetermined period of time may be set by the user. In one embodiment, rather than a predetermined period of time, the data storage device may proceed based upon a predetermined number of commands received before proceeding to block 610. In yet another embodiment, the data storage device may proceed based upon the fullness of the write cache. In yet another embodiment, the data storage device may proceed based upon the frequency of writing the data from the write cache to the memory device (e.g., NAND).

[0059] By using dynamic write cache management in a mixed workload, several advantages are realized including optimized performance by adapting to varying workloads and efficiently allocating resources. The dynamic write cache management enhances write QoS, prevents underutilization or over allocation of cache resources, ensures responsive handling of bursty workloads, and reduces the complexity of the device controller. The data storage device's improved bandwidth management and adaptability to changing workload characteristics contribute to overall efficiency thus improving write cache usage.

[0060] In one embodiment, a data storage device comprises: a memory device; and a controller coupled to the memory device, wherein the controller is configured to: measure a current read and write workload; determine whether a change in the read and write workload has occurred; and change a write cache size based upon determining that the change in the read and write workload has occurred. The determining comprises comparing the current read and write workload to a previous read and write workload. The previous read and write workload corresponds to a predetermined minimum write cache size. The current workload corresponds to a predetermined maximum write cache size. The predetermined minimum write cache size and the predetermined maximum write cache size are different. The controller is configured to determine a read: write ratio. The controller comprises a host interface module, and wherein the host interface module comprises a write cache dynamic size logic module. The write cache dynamic size logic module comprises a write cache size logic module and a mixed workload detector module. The changing comprises increasing the write cache size. The changing results in write cache search performance changes.

[0061] In another embodiment, a data storage device comprises: a memory device; and a controller coupled to the memory device, wherein the controller is configured to: determine that a read: write ratio has changed from a first ratio to a second ratio different from the first ratio, wherein the controller maintains a write cache having a first write cache size; select a second write cache size for the second ratio; and change the first write cache size to the second write cache size, wherein the second write cache size is different from the first write cache size. The controller is maintain a table correlating write cache size to the read: write ratio. The first cache size is a minimum cache size, wherein the minimum cache size is a predetermined size, wherein the minimum cache size correlates to a read: write ratio of 100:0. The second cache size is a maximum cache size, wherein the maximum cache size is a predetermined size, wherein the maximum cache size correlates to a read: write ratio of 0:100. The first cache size correlates to a read: write ratio of between 100:0 and 1:1, and wherein the second cache size correlates to a read: write ratio of between 1:1 and 0:100. The controller comprises a mixed workload detector module that detects a current mixed workload running in the data storage device. Based on the detected mixed workload, the write cache size is configured which allows the data storage device to have relaxation in performance of an overlap table search engine.

[0062] In another embodiment, a data storage device comprises: means to store data; and a controller coupled to the means to store data, wherein the controller is configured to: dynamically adjust a write cache size of a write cache in response to detecting a change in a read: write ratio, wherein the controller comprises a write cache size logic module and a mixed workload detector module. The controller is configured to maintain a table comprising correlations between write cache size and read: write ratio. The controller is configured to search the table in response to the detecting.

[0063] While the foregoing is directed to embodiments of the present disclosure, other and further embodiments of the disclosure may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims

1. A data storage device, comprising:a memory device; anda controller coupled to the memory device, wherein the controller is configured to:measure a current read and write workload, wherein the measuring comprises calculating a read: write ratio;determine whether a change in the read and write workload has occurred, wherein the determining comprises determining whether the read: write ratio has changed; andchange a write cache size based upon determining that the change in the read and write workload has occurred, wherein the controller identifies, from a table including a plurality of read: write ratio entries and corresponding write cache size entries, the write cache size corresponding to the determined read: write ratio.

2. The data storage device of claim 1, wherein the determining comprises comparing the current read and write workload to a previous read and write workload.

3. The data storage device of claim 2, wherein the previous read and write workload corresponds to a predetermined minimum write cache size.

4. The data storage device of claim 3, wherein the current workload corresponds to a predetermined maximum write cache size.

5. The data storage device of claim 4, wherein the predetermined minimum write cache size and the predetermined maximum write cache size are different.

6. The data storage device of claim 1, wherein the controller is configured to determine a read: write ratio.

7. The data storage device of claim 1, wherein the controller comprises a host interface module, and wherein the host interface module comprises a write cache dynamic size logic module.

8. The data storage device of claim 7, wherein the write cache dynamic size logic module comprises a write cache size logic module and a mixed workload detector module.

9. The data storage device of claim 1, wherein the changing comprises increasing the write cache size.

10. The data storage device of claim 1, wherein the changing results in write cache search performance changes.

11. A data storage device, comprising:a memory device; anda controller coupled to the memory device, wherein the controller is configured to:determine that a read: write ratio has changed from a first ratio to a second ratio different from the first ratio, wherein the controller maintains a write cache having a first write cache size;select, from a table including a plurality of read: write ratio entries and corresponding write cache size entries, a second write cache size corresponding to the second ratio; andchange the first write cache size to the second write cache size, wherein the second write cache size is different from the first write cache size.

12. The data storage device of claim 11, wherein the controller is configured to maintain a table correlating write cache size to the read: write ratio.

13. The data storage device of claim 11, wherein the first cache size is a minimum cache size, wherein the minimum cache size is a predetermined size, wherein the minimum cache size correlates to a read: write ratio of 100:0.

14. The data storage device of claim 11, wherein the second cache size is a maximum cache size, wherein the maximum cache size is a predetermined size, wherein the maximum cache size correlates to a read: write ratio of 0:100.

15. The data storage device of claim 11, wherein the first cache size correlates to a read: write ratio of between 100:0 and 1:1, and wherein the second cache size correlates to a read: write ratio of between 1:1 and 0:100.

16. The data storage device of claim 11, wherein the controller comprises a mixed workload detector module that detects a current mixed workload running in the data storage device.

17. The data storage device of claim 16, wherein based on the detected mixed workload, the write cache size is configured which allows the data storage device to have relaxation in performance of an overlap table search engine.

18. A data storage device, comprising:means to store data; anda controller coupled to the means to store data, wherein the controller is configured to:dynamically adjust a write cache size of a write cache in response to detecting a change in a read: write ratio, wherein the controller maintains a table including a plurality of read: write ratio entries and corresponding write cache size entries and identifies the adjusted write cache size from the table based on the changed read: write ratio, wherein the controller comprises a write cache size logic module and a mixed workload detector module.

19. The data storage device of claim 18, wherein the controller is configured to maintain a table comprising correlations between write cache size and read: write ratio.

20. The data storage device of claim 19, wherein the controller is configured to search the table in response to the detecting.