US-12619547-B2 - SSD device accelerated by dynamic capacity cache
Abstract
This application relates to the field of SSD and discloses an SSD device accelerated by dynamic capacity cache. The device includes: a memory comprising multiple storage subspaces; a buffer comprising multiple cache subspaces, each corresponding one-to-one with the storage subspaces; a cache executor configured to allocate a corresponding cache unit for a storage unit based on a necessary capacity, a read peak capacity, and a write peak capacity of the cache subspace corresponding to the storage subspace to which the storage unit belongs when reading out or writing into the storage unit, and send allocation information of the cache unit to a cache allocator; and the cache allocator configured to set a total capacity of the corresponding cache subspace for at least one storage subspace based on an external cache configuration request, as well as initial values of the necessary capacity, the read peak capacity, and the write peak capacity, and adjust the necessary capacity, the read peak capacity, and the write peak capacity of the cache subspace based on the total capacity of the cache subspace and the allocation information provided by the cache executor. This application configures and changes the cache subspace without resetting the device.
Inventors
- Song Du
Assignees
- INNOGRIT TECHNOLOGIES CO., LTD.
Dates
- Publication Date
- 20260505
- Application Date
- 20231211
- Priority Date
- 20221216
Claims (12)
- 1 . An SSD device accelerated by dynamic capacity cache, comprising: a memory comprising multiple storage subspaces; a cache comprising multiple cache subspaces, each corresponding one-to-one with the storage subspaces; and wherein the SSD device is configured to: allocate at least one corresponding cache unit for a storage unit based on a necessary capacity, a read peak capacity, and a write peak capacity of a corresponding one of the cache subspaces corresponding to the storage subspace to which the storage unit belongs when reading out or writing into the storage unit; set a total capacity of the corresponding one of the cache subspaces for at least one storage subspace based on an external cache configuration request, initial values of the necessary capacity, the read peak capacity, and the write peak capacity; and adjust the necessary capacity, the read peak capacity, and the write peak capacity of the cache subspace based on the total capacity of the at least one cache subspace and allocation information of the at least one cache unit.
- 2 . The SSD device accelerated by dynamic capacity cache of claim 1 , further comprising a metadata memory which stores: structured metadata for the storage subspaces used to record metadata of each storage subspace, wherein the metadata of each storage subspace comprises an index of storage unit within each storage subspace; structured metadata for the cache subspaces used to record metadata of each cache subspace, wherein the metadata of each cache subspace comprises requirement metadata, execution metadata, and structured data for search cost; structured metadata for the storage units used to record metadata of each storage unit, wherein the metadata of each storage unit comprises an index of the cache unit(s) corresponding to the storage unit and an index of the storage subspace to which the storage unit belongs; and structured metadata for the cache units used to record metadata of each cache unit, wherein the metadata of each cache unit comprises an index of the storage unit corresponding to the cache unit, an index of the cache subspace to which the cache unit belongs, and structured data for cache states.
- 3 . The SSD device accelerated by dynamic capacity cache of claim 2 , wherein the SSD device is further configured to: read the metadata of all cache subspaces from the structured metadata for the cache subspaces, and calculate the total capacity of the cache subspace based on a configuration request of cache capacity of the cache subspace corresponding to the storage subspace; based on the configuration request of a cache adjustment policy option of the cache subspace, allocate the necessary capacity, the read peak capacity, and the write peak capacity from the total capacity of the cache subspace, and determine a search range and a cache execution policy option; and record the configuration request of the cache capacity, the configuration request of the cache adjustment policy option, the total capacity, the necessary capacity, the read peak capacity, the write peak capacity, the search range, and the cache execution policy option of the cache subspace into the requirement metadata of the cache subspace.
- 4 . The SSD device accelerated by dynamic capacity cache of claim 2 , wherein the SSD device is further configured to: suspend operations of all storage units of the storage subspace and all cache units in the cache subspace corresponding to the storage subspace; configure a corresponding cache subspace for the storage subspace and adjust the requirement metadata of the corresponding cache subspace; restore operations involving the storage subspace and corresponding cache subspace within a selected adjustment time, based on the adjusted requirement metadata and the execution metadata of the corresponding cache subspace; after the selected adjustment time is reached, adjust the requirement metadata of other cache subspaces based on the configuration request of the cache adjustment policy option; and restore operations of all storage units of the storage subspace and all cache units in the cache subspace corresponding to the storage subspace.
- 5 . The SSD device accelerated by dynamic capacity cache of claim 2 , wherein the SSD device is further configured to: read the metadata of the storage unit, if there is a corresponding cache unit, then select the cache unit and update the structured data for cache states of the cache unit, and update the execution metadata and the structured data for search cost of the cache subspace to which the cache unit belongs; if no corresponding cache unit exists, read the requirement metadata and the execution metadata of the cache subspace to which the cache unit belongs, and calculate the search range, a search order, and a search end condition; in the structured metadata for the cache units, within the search range, calculate search cost function for each candidate cache unit according to the search order and record them into the structured data for search cost of the cache subspace to which the cache unit belongs before reaching the search end condition; select the cache unit with the minimum search cost function, and update the metadata of the storage unit, the metadata of the original storage unit corresponding to the cache unit, and the metadata of the cache unit; and use the structured data for search cost of the cache subspace, to which the cache unit belongs, to set a total capacity of the corresponding one of the cache subspaces for at least one storage subspace.
- 6 . The SSD device accelerated by dynamic capacity cache of claim 2 , wherein the SSD device is further configured to: read the requirement metadata and the execution metadata of the cache subspace to which the cache unit belongs, and calculate the search range, a search order, and a search end condition; in the structured metadata for the cache units, within the search range, calculate search cost function for each candidate cache unit according to the search order and record them into the structured data for search cost of the cache subspace to which the cache unit belongs before reaching the search end condition; select the cache unit with the minimum search cost function, and update the metadata of original storage unit corresponding to the cache unit, and the metadata of the cache unit; and use the structured data for search cost of the cache subspace, to which the cache unit belongs, to set a total capacity of the corresponding one of the cache subspaces for at least one storage subspace.
- 7 . The SSD device accelerated by dynamic capacity cache of claim 2 , further comprising: a cache configuration interface configured to receive the external cache configuration request comprising a cache capacity and a cache adjustment policy option; an external read/write interface configured to respond to external read/write requests, read out all or part of the content of the corresponding storage unit, or write all or part of the content received by the external read/write interface into the corresponding storage unit; and an internal read/write interface configured to implement read and write between the cache units and the storage units.
- 8 . The SSD device accelerated by dynamic capacity cache of claim 7 , wherein the SSD device is further configured to: search for and select a cache unit for the specified storage unit in an external read request; if the structured data for cache states of the cache unit indicates inconsistency between its content and that of the storage unit, then hand over the cache unit to the internal read/write interface, sequentially read out the content of the storage unit and write it into the cache unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; and deliver specified part or all of the content in the external read request to the external read/write interface.
- 9 . The SSD device accelerated by dynamic capacity cache of claim 7 , wherein the SSD device is further configured to: search for and select a cache unit for the specified storage unit in an external write request; if the external write request writes only part of the storage unit, then based on the structured data for cache states of the cache unit, determine whether or not to hand over the cache unit to the internal read/write interface, sequentially read out the content of the storage unit and write it into the cache unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; obtain some part of new content of the storage unit from the internal read/write interface, write it into the cache unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; and deliver specified part or all of the content in the external write request to the external read/write interface.
- 10 . The SSD device accelerated by dynamic capacity cache of claim 7 , wherein the SSD device is further configured to: traverse the structured metadata for the storage units, and search for a storage unit, wherein search criteria comprises: the storage unit does not have a corresponding cache unit; for each found storage unit, based on the requirement metadata and the execution metadata of corresponding cache subspace of the storage unit, and based on the cache execution policy option of the cache subspace, determine to search for and select a cache unit for the storage unit; and hand over the cache unit to the internal read/write interface, sequentially read out the content of the storage unit and write it into the cache unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs.
- 11 . The SSD device accelerated by dynamic capacity cache of claim 7 , wherein the SSD device is further configured to: traverse the structured metadata for the cache units, search for a cache unit, wherein search criteria comprises: the content of the cache unit is inconsistent with the content of its corresponding storage unit; and for each found cache unit, based on the requirement metadata and the execution metadata of the cache subspace to which the cache unit belongs, and based on the cache execution policy option of the cache subspace, determine to search and execute a) or b) for the storage unit, wherein: a) hand over the first cache unit to the internal read/write interface, sequentially write it into the storage unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; and after the internal read/write interface completes the writing, update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; b) search for and select a second cache unit for the cache unit; write the content of the cache unit into the second cache unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; hand over the second cache unit to the internal read/write interface, sequentially write it into the storage unit, and update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs; and after the storage read/write interface completes the writing, update the structured data for cache states of the cache unit and the execution metadata of the cache subspace to which it belongs.
- 12 . The SSD device accelerated by dynamic capacity cache of claim 7 , wherein the SSD device is further configured to: traverse the structured metadata for the cache units, search for a cache unit, wherein search criteria comprises: the location of the cache unit in the structured metadata for the cache units does not meet the requirement of the search range in the requirement metadata of the cache subspace; for each found cache unit, based on the requirement metadata and the execution metadata of the cache subspace to which the cache unit belongs, and based on the cache execution policy option of the cache subspace, determine to search for and select a second cache unit for the storage unit; write the content of the cache unit into the second cache unit, and update the structured data for cache states of the cache unit and the second cache unit and the execution metadata of the cache subspaces to which they belong; and update the metadata of the storage unit corresponding to the cache unit.
Description
CROSS-REFERENCE TO PRIOR APPLICATION This application claims priority to Chinese Application number CN202211627624.7 which is filed on Dec. 16, 2022, the contents of which are incorporated herein by reference. TECHNICAL FIELD This application relates to the technology field of SSD, particularly to an SSD device accelerated by dynamic capacity cache. BACKGROUND Storage device (or SSD) divides all storage units into several storage subspaces according to external requests. Existing storage device provides high-speed read and write caching for the storage subspaces within the device. In order to accelerate the read and write bandwidth of the content in the storage unit and reduce the read and write latency, the storage device configures a certain number of in-device cache units for a certain number of storage units. The number of storage units belonging to the storage subspace and the corresponding number of cache units are fixed or unconfigurable at runtime. Unless the device is reset (without the need for resetting the device), the number of corresponding cache units cannot be changed in response to the external request which can improve the average cache hit rate for the storage subspace. Due to the limitation, a device that can dynamically allocate storage subspace capacity based on the external request at runtime cannot simultaneously provide an optional average cache hit rate for the storage subspace. On this basis, existing operating systems use system memory to provide high-speed read and write caching for the storage subspace outside of the device. When the operating system is running, the correspondence between the cache units and all accessed storage units within the device can be adjusted. Compared to inside device cache adjustment, this method consumes additional computing and memory resources outside the device, and cannot configure different numbers of cache units for different storage subspaces according to the external requests without resetting the system. This section aims to provide background or context for the implementation of the application stated in the claims. The description here should not be considered prior art merely because it is included in this section. SUMMARY OF THE INVENTION An object of this application is to provide an SSD device accelerated by dynamic capacity cache, which can configure and change the number of cache units to which the cache subspace belongs without resetting the device. The application discloses an SSD device accelerated by dynamic capacity cache, comprising: a memory comprising multiple storage subspaces;a cache comprising multiple cache subspaces, each corresponding one-to-one with the storage subspaces;a cache executor, configured to allocate corresponding cache unit(s) for a storage unit based on a necessary capacity, a read peak capacity, and a write peak capacity of the cache subspace corresponding to the storage subspace to which the storage unit belongs when reading out or writing into the storage unit, and send allocation information of the cache unit(s) to a cache allocator; andthe cache allocator, configured to set a total capacity of the corresponding cache subspace for at least one storage subspace based on an external cache configuration request, as well as initial values of the necessary capacity, the read peak capacity, and the write peak capacity, and adjust the necessary capacity, the read peak capacity, and the write peak capacity of the cache subspace based on the total capacity of the cache subspace and the allocation information provided by the cache executor. In one embodiment, further comprises a metadata memory which stores: structured metadata for the storage subspaces used to record metadata of each storage subspace, wherein the metadata of each storage subspace comprises an index of storage unit within each storage subspace;structured metadata for the cache subspaces used to record metadata of each cache subspace, wherein the metadata of each cache subspace comprises requirement metadata, execution metadata, and structured data for search cost;structured metadata for the storage units used to record metadata of each storage unit, wherein the metadata of each storage unit comprises an index of the cache unit(s) corresponding to the storage unit and an index of the storage subspace to which the storage unit belongs; andstructured metadata for the cache units used to record metadata of each cache unit, wherein the metadata of each cache unit comprises an index of the storage unit corresponding to the cache unit, an index of the cache subspace to which the cache unit belongs, and structured data for cache states. In one embodiment, the cache allocator is further configured to: read the metadata of all cache subspaces from the structured metadata for the cache subspaces, and calculate the total capacity of the cache subspace based on a configuration request of cache capacity of the cache subspace corresponding to the storage subs