Storage resource processing method and DPU
Through the storage resource processing method performed in hardware such as DPU, the collaborative work of on-chip cache and DDR is used to solve the problem of unreliable storage resource allocation, timely and reliable storage resource allocation is achieved, and the performance and application scope of the hardware are improved.
Patent Information
- Application Number
- CN202311629298.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-11-30
AI Technical Summary
In hardware such as DPU, it is impossible to guarantee that there are idle storage resources in real time when the storage resources are requested, resulting in the inability to provide storage resources to the requesting party in time, which leads to poor reliability and flexibility in storage resource allocation.
Through the storage resource processing method executed in the hardware, the storage resource type corresponding to the current resource allocation request is obtained, and whether the on-chip cache unit contains the target storage resource. If the on-chip cache unit does not contain the target storage resources, it is determined whether the read and write status of DDR is readable. If it is readable, the target storage resources are obtained from the DDR and allocated to the requesting end, and the read and write status of DDR is updated.
It realizes timely resource allocation when hardware storage resources are requested, improves the reliability and scalability of storage resource allocation, improves the application scope and processing performance of hardware, and ensures high performance and completeness within hardware such as DPU.
Smart Images

Figure CN117608846B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a storage resource processing method and a DPU. Background Art
[0002] With the rapid development of science and technology, the speed at which data is generated often exceeds the processing capacity of existing conventional equipment. For data-centric data centers, the performance of the CPU is limited in the face of the growth rate of data. The emergence of DPU can offload the operations of the infrastructure from the CPU to the data processor DPU (Data Processing Unit), realizing the combination of software definition and hardware acceleration in security, communication, storage and virtualization, freeing up CPU resources to better support application needs.
[0003] Currently, when storage resources in hardware such as DPU are requested, there is no guarantee that there are idle storage resources in real time, which will result in the inability to provide storage resources to the requester in a timely manner, which in turn leads to low reliability and poor flexibility in the allocation of storage resources in hardware such as DPU, and cannot meet the processing efficiency requirements of storage resources. Summary of the invention
[0004] In view of this, embodiments of the present application provide a storage resource processing method and a DPU to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present application provides a storage resource processing method, which is executed in hardware. The storage resource processing method includes:
[0006] Obtaining a storage resource type corresponding to a current resource allocation request, and querying whether a preset local on-chip cache unit corresponding to the storage resource type currently contains a target storage resource corresponding to the resource allocation request;
[0007] If the on-chip cache unit does not include the target storage resource, it is determined whether the current read / write state of the external DDR is in a resource readable state. If so, the target storage resource is obtained from the DDR to allocate the target storage resource to the request end of the resource allocation request, and the read / write state of the DDR is updated.
[0008] In some embodiments of the present application, the step of obtaining the storage resource type corresponding to the current resource allocation request and querying whether the preset local on-chip cache unit corresponding to the storage resource type currently contains the target storage resource corresponding to the resource allocation request includes:
[0009] Get the storage resource type corresponding to the current resource allocation request;
[0010] If the storage resource type is a storage page resource, querying whether a storage page index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request;
[0011] If the storage resource type is a linked list resource, it is queried whether a linked list index cache preset in a local on-chip cache unit contains the target storage resource corresponding to the resource allocation request.
[0012] In some embodiments of the present application, the storage page index cache includes: distributing the storage page index cache and reclaiming the storage page index cache;
[0013] Correspondingly, if the storage resource type is a storage page resource, querying whether a storage page index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request includes:
[0014] If the storage resource type is a storage page resource, then determine whether the number of storage page index addresses currently stored in the distribution storage page index cache is less than a first threshold based on the distribution page index counter corresponding to the distribution storage page index cache. If so, query whether the recovered storage page index cache contains the target storage page resource corresponding to the resource allocation request.
[0015] In some embodiments of the present application, the linked list index cache includes: distributing the linked list index cache and recycling the linked list index cache;
[0016] Correspondingly, if the storage resource type is a linked list resource, querying whether a linked list index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request includes:
[0017] If the storage resource type is a linked list resource, then determine whether the number of linked list index addresses currently stored in the distribution linked list index cache is less than a second threshold based on the distribution linked list index counter corresponding to the distribution linked list index cache. If so, query whether the recovery linked list index cache contains the target linked list resource corresponding to the resource allocation request.
[0018] In some embodiments of the present application, if the on-chip cache unit does not include the target storage resource, determining whether the current read / write state of the external DDR is in a resource readable state, and if so, obtaining the target storage resource from the DDR to allocate the target storage resource to the requesting end of the resource allocation request, and updating the read / write state of the DDR, includes:
[0019] If the recovered storage page index cache does not contain the target storage page resource, it is determined whether the read pointer corresponding to the current storage page index address in the external DDR is smaller than the write pointer corresponding to the storage page index address. If so, the target storage page index address is obtained from the DDR to allocate the target storage page index address to the request end of the resource allocation request, and the read pointer corresponding to the storage page index address in the DDR is updated.
[0020] In some embodiments of the present application, if the on-chip cache unit does not include the target storage resource, determining whether the current read / write state of the external DDR is in a resource readable state, and if so, obtaining the target storage resource from the DDR to allocate the target storage resource to the requesting end of the resource allocation request, and updating the read / write state of the DDR, includes:
[0021] If the target linked list resource is not included in the recycled linked list index cache, it is determined whether the read pointer corresponding to the current linked list index address in the external DDR is smaller than the write pointer corresponding to the linked list index address. If so, the target linked list index address is obtained from the DDR to allocate the target linked list index address to the request end of the resource allocation request, and the read pointer corresponding to the linked list index address in the DDR is updated.
[0022] In some embodiments of the present application, it also includes:
[0023] If it is determined that the number of storage page index addresses currently stored in the distribution storage page index cache is equal to or greater than the first threshold, the target storage page index address is read from the distribution storage page index cache to allocate the target storage page index address to the request end of the resource allocation request;
[0024] If it is determined that the recovered storage page index cache contains the target storage page resource corresponding to the resource allocation request, the target storage page index address is read from the recovered storage page index cache to allocate the target storage page index address to the request end of the resource allocation request.
[0025] In some embodiments of the present application, it also includes:
[0026] If it is determined that the number of linked list index addresses currently stored in the distribution linked list index cache is equal to or greater than the first threshold, the target linked list index address is read from the distribution linked list index cache to allocate the target linked list index address to the request end of the resource allocation request;
[0027] If it is determined that the recycling linked list index cache contains the target linked list resource corresponding to the resource allocation request, the target linked list index address is read from the recycling linked list index cache to allocate the target linked list index address to the request end of the resource allocation request.
[0028] In some embodiments of the present application, it also includes:
[0029] If the resource identifier to be deleted is obtained, the storage resource to be recycled in the identifier linked list corresponding to the resource identifier is extracted;
[0030] If the type of the storage resource to be reclaimed is a storage page index address, determine whether the number of free storage bits in the reclaimed storage page index cache is less than a third threshold value; if so, store the storage page index address to be reclaimed in the DDR, and update the write pointer corresponding to the storage page index address in the DDR; if not, store the storage page index address to be reclaimed in the reclaimed storage page index cache;
[0031] If the type of the storage resource to be reclaimed is a linked list index address, determine whether the number of free storage bits in the recovered linked list index cache is less than a fourth threshold value. If so, store the linked list index address to be reclaimed in the DDR and update the write pointer corresponding to the linked list index address in the DDR; if not, store the linked list index address to be reclaimed in the recovered linked list index cache.
[0032] Another aspect of the present application provides a storage resource processing device, including:
[0033] The on-chip cache processing module is used to obtain the storage resource type corresponding to the current resource allocation request, and query whether the preset local on-chip cache unit corresponding to the storage resource type currently contains the target storage resource corresponding to the resource allocation request;
[0034] The DDR processing module is used to determine whether the current read / write state of the external DDR is in a resource readable state if the target storage resource is not included in the on-chip cache unit; if so, obtain the target storage resource from the DDR to allocate the target storage resource to the request end of the resource allocation request, and update the read / write state of the DDR.
[0035] A third aspect of the present application also provides a DPU, provided with a storage resource processing device;
[0036] The storage resource processing device is used to execute the storage resource processing method.
[0037] The storage resource processing method provided in the present application is executed in hardware. By obtaining the storage resource type corresponding to the current resource allocation request, it is queried whether the target storage resource corresponding to the resource allocation request is currently included in the preset local on-chip cache unit corresponding to the storage resource type; if the target storage resource is not included in the on-chip cache unit, it is determined whether the current read-write state of the external DDR is in a resource-readable state. If so, the target storage resource is obtained from the DDR to allocate the target storage resource to the requesting end of the resource allocation request, and the read-write state of the DDR is updated. This can provide the storage resource to the requesting party in a timely manner when the hardware storage resource is requested, effectively improve the reliability and scalability of hardware-based storage resource allocation, and effectively improve the processing efficiency of hardware-based storage resources, and can improve the application scope and processing performance of the hardware, thereby ensuring the high performance and completeness of the hardware such as DPU.
[0038] Additional advantages, purposes, and features of the present application will be partially described in the following description, and will become partially apparent to those skilled in the art after studying the following, or may be learned from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings.
[0039] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present application are not limited to the above specific description, and the above and other purposes that can be achieved by the present application will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but are only for the purpose of illustrating the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present application. In the drawings:
[0041] Figure 1 This is a schematic diagram of a first flow chart of a storage resource processing method in an embodiment of the present application.
[0042] Figure 2 This is a second flow chart of a storage resource processing method in an embodiment of the present application.
[0043] Figure 3 This is a third flow chart of a storage resource processing method in an embodiment of the present application.
[0044] Figure 4This is a fourth flow chart of a storage resource processing method in an embodiment of the present application.
[0045] Figure 5 A logical schematic diagram for executing storage resources in an application example of the present application.
[0046] Figure 6 It is a flowchart of a storage resource allocation method in an application example of the present application.
[0047] Figure 7 This is a fifth flow chart of the storage resource processing method in one embodiment of the present application.
[0048] Figure 8 It is a flowchart of a storage resource recovery method in an application example of the present application.
[0049] Fig. 9 It is a structural diagram of a storage resource processing device in one embodiment of the present application.
[0050] Fig.10 Schematic diagram of the structure of the DPU in one embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the implementation modes and the accompanying drawings. Here, the illustrative implementation modes and descriptions of the present application are used to explain the present application, but are not intended to limit the present application.
[0052] It should also be noted here that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the scheme according to the present application are shown in the accompanying drawings, while other details that are not very relevant to the present application are omitted.
[0053] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0054] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection with an intermediate.
[0055] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0056] In order to solve the problem that when storage resources in hardware such as DPU are requested, there is no guarantee that there are idle storage resources in real time, which leads to the inability to provide storage resources to the requester in time, etc., the embodiments of the present application respectively provide a storage resource processing method, a storage resource processing device and DPU for executing the storage resource processing method, which can provide storage resources to the requester in time, and can effectively improve the reliability and scalability of hardware-based storage resource allocation.
[0057] The details are described in detail through the following examples.
[0058] Based on this, the embodiment of the present application provides a storage resource processing method that can be implemented by a storage resource processing device in hardware, see Figure 1 , the storage resource processing method specifically includes the following contents:
[0059] Step 100: Obtain the storage resource type corresponding to the current resource allocation request, and query whether the preset local on-chip cache unit corresponding to the storage resource type currently contains the target storage resource corresponding to the resource allocation request.
[0060] In step 100, after receiving a resource allocation request, the storage resource processing device will first extract the storage resource type indicated in the resource allocation request. The storage resource type can be set to multiple according to actual application requirements. In one or more embodiments of the present application, the storage resource type can at least include a storage page and a linked list.
[0061] In one or more embodiments of the present application, a local on-chip cache unit is provided in hardware such as a DPU as one of the storage resource providing units. In order to meet the timeliness requirements of storage resource allocation, the embodiment of the present application also designs a memory DDR (double data rate synchronous dynamic random access memory) external to the hardware such as a DPU as a second storage resource providing unit, as described in step 200 below.
[0062] Step 200: If the on-chip cache unit does not include the target storage resource, determine whether the current read / write state of the external DDR is in a resource readable state. If so, obtain the target storage resource from the DDR to allocate the target storage resource to the request end of the resource allocation request, and update the read / write state of the DDR.
[0063] In one or more embodiments of the present application, the target storage resource refers to an index address used to satisfy the resource allocation request. If the storage resource type is a storage page, the target storage resource refers to a target storage page resource, specifically including a storage page index address; if the storage resource type is a linked list, the target storage resource refers to a target linked list resource, specifically including a linked list index address.
[0064] In one or more embodiments of the present application, the storage page index address may be written as page, and the linked list index address may be written as line.
[0065] From the above description, it can be seen that the storage resource processing method provided in the embodiment of the present application can provide storage resources to the requesting party in a timely manner when hardware storage resources are requested, can effectively improve the reliability and scalability of hardware-based storage resource allocation, and can effectively improve the processing efficiency of hardware-based storage resources, can improve the application scope and processing performance of the hardware, and thus can ensure the high performance and completeness of hardware such as DPU.
[0066] In order to further improve the reliability and scalability of hardware-based storage resource allocation, in a storage resource processing method provided in an embodiment of the present application, see Figure 2 , step 100 in the storage resource processing method specifically includes the following contents:
[0067] Step 110: Obtain the storage resource type corresponding to the current resource allocation request;
[0068] In step 120 , if the storage resource type is a storage page resource, it is queried whether the storage page index cache preset in the local on-chip cache unit contains the target storage resource corresponding to the resource allocation request; if not, step 200 is executed.
[0069] Step 130: If the storage resource type is a linked list resource, query whether the linked list index cache preset in the local on-chip cache unit contains the target storage resource corresponding to the resource allocation request; if not, execute step 200.
[0070] In order to further improve the application reliability and effectiveness of the storage page index cache, in a storage resource processing method provided in an embodiment of the present application, the storage page index cache includes: a distribution storage page index cache and a recycling storage page index cache; wherein the distribution storage page index cache can be written as dispatch_page_FiFo, and the recycling storage page index cache can be written as recycle_page_FiFo.
[0071] See also Figure 3 , step 120 in the storage resource processing method specifically includes the following contents:
[0072] Step 121: if the storage resource type is a storage page resource, determine whether the number of storage page index addresses currently stored in the distribution storage page index cache is less than a first threshold value according to the distribution page index counter corresponding to the distribution storage page index cache, if so, execute step 122, if not, execute step 123;
[0073] In step 121 , the first threshold may be a positive integer close to 0.
[0074] It can be understood that the dispatch page index counter can be written as dispatch_page_count. Before step 100, the dispatch page index counter dispatch_page_count can be pre-initialized to pre-allocate the storage page index address Page; the subsequent counter will be accumulated until all storage resources are allocated, and the counter will remain inactive.
[0075] Step 122: Query whether the recovered storage page index cache contains the target storage page resource corresponding to the resource allocation request, if so, execute step 124, if not, execute step 200.
[0076] Step 123: If it is determined that the number of storage page index addresses currently stored in the distribution storage page index cache is equal to or greater than the first threshold, the target storage page index address is read from the distribution storage page index cache to allocate the target storage page index address to the request end of the resource allocation request.
[0077] Step 124: If it is determined that the recovered storage page index cache contains the target storage page resource corresponding to the resource allocation request, the target storage page index address is read from the recovered storage page index cache to allocate the target storage page index address to the request end of the resource allocation request.
[0078] In order to further improve the application reliability and effectiveness of the linked list index cache, in a storage resource processing method provided in an embodiment of the present application, the linked list index cache includes: a distribution linked list index cache and a recycling linked list index cache; wherein the distribution linked list index cache can be written as dispatch_line_FiFo, and the recycling linked list index cache can be written as recycle_line_FiFo.
[0079] See also Figure 3 , step 130 in the storage resource processing method specifically includes the following contents:
[0080] Step 131: If the storage resource type is a linked list resource, determine whether the number of linked list index addresses currently stored in the distribution linked list index cache is less than a second threshold based on the distribution linked list index counter corresponding to the distribution linked list index cache. If so, execute step 132; if not, execute step 133.
[0081] In step 131, the second threshold value may be a positive integer close to 0, and the second threshold value may be the same as or different from the value of the first threshold value, and may be specifically set according to actual application requirements.
[0082] It can be understood that the dispatch list index counter can be written as dispatch_line_count, and the dispatch list index counter dispatch_line_count can be pre-initialized before step 100 to pre-allocate the list index address line; the subsequent counter will be accumulated until all storage resources are allocated, and the counter will remain and no longer work.
[0083] Step 132: Query whether the recycling linked list index cache contains the target linked list resource corresponding to the resource allocation request. If so, execute step 134; if not, execute step 200.
[0084] Step 133: If it is determined that the number of linked list index addresses currently stored in the distribution linked list index cache is equal to or greater than the first threshold, the target linked list index address is read from the distribution linked list index cache to allocate the target linked list index address to the request end of the resource allocation request.
[0085] Step 134: If it is determined that the recycling linked list index cache contains the target linked list resource corresponding to the resource allocation request, the target linked list index address is read from the recycling linked list index cache to allocate the target linked list index address to the request end of the resource allocation request.
[0086] In order to further improve the timeliness, reliability and scalability of storage page index address allocation, in a storage resource processing method provided in an embodiment of the present application, see Figure 4 If it is learned through the query in step 122 that the recovered storage page index cache does not contain the target storage page resource corresponding to the resource allocation request, then executing step 200 specifically includes the following contents:
[0087] Step 210: If the recovered storage page index cache does not contain the target storage page resource, determine whether the read pointer corresponding to the current storage page index address in the external DDR is smaller than the write pointer corresponding to the storage page index address; if so, obtain the target storage page index address from the DDR to assign the target storage page index address to the request end of the resource allocation request, and update the read pointer corresponding to the storage page index address in the DDR.
[0088] It can be understood that if it is determined that the read pointer corresponding to the current storage page index address in the DDR is equal to or greater than the write pointer corresponding to the storage page index address, it means that there is no allocatable storage page resource in the current DDR, so a corresponding notification message can be sent to the requesting end.
[0089] In order to further improve the timeliness, reliability and scalability of the linked list index address allocation, in a storage resource processing method provided in an embodiment of the present application, see Figure 4 If it is learned through the query of step 132 that the recycled linked list index cache does not contain the target linked list resource corresponding to the resource allocation request, then executing step 200 specifically includes the following contents:
[0090] Step 220: If the recovered linked list index cache does not contain the target linked list resource, determine whether the read pointer corresponding to the current linked list index address in the external DDR is smaller than the write pointer corresponding to the linked list index address. If so, obtain the target linked list index address from the DDR to assign the target linked list index address to the request end of the resource allocation request, and update the read pointer corresponding to the linked list index address in the DDR.
[0091] It can be understood that if it is determined that the read pointer corresponding to the current linked list index address in the DDR is equal to or greater than the write pointer corresponding to the linked list index address, it means that there is no allocatable linked list resource in the current DDR, so a corresponding notification message can be sent to the requesting end.
[0092] In order to further illustrate the execution process of the above storage resource allocation, the present application also provides a specific application example of the storage resource allocation method, see Figure 5 and Figure 6 , the storage resource allocation method specifically includes the following contents:
[0093] Resource allocation: send the storage page index address Page, and send the linked list index address Line.
[0094] 1. Initialize the dispatch page index counter dispatch_page_count and the dispatch page list index counter dispatch_line_count to pre-allocate Page and Line; subsequent counters will accumulate until all storage resources are allocated, and the counters will remain and no longer work.
[0095] 2. When the dispatch storage page index cache dispatch_page_FiFo is almost empty, the hardware will actively read the storage page index address page from the recycling storage page index cache recycle_page_FiFo. If the recycling storage page index cache recycle_page_FiFo is empty and the DDR read pointer is less than the write pointer, the storage page index address page is read from the DDR and the storage page index address page read pointer is updated.
[0096] 3. When the dispatch page list index cache dispatch_line_FiFo is almost empty, the hardware will actively read the list index address line from the recycling list index cache recycle_line_FiFo. If the recycling list index cache recycle_line_FiFo is empty and the DDR read pointer is less than the write pointer, the line is read from the DDR and the line read pointer is updated.
[0097] In the above application example, the explanation of each parameter is shown in Table 1.
[0098] Table 1
[0099]
[0100]
[0101] In order to further improve the effectiveness and reliability of storage resource allocation, the embodiment of the present application also improves the utilization rate of storage resources and the reliability of allocation by timely recycling storage resources. In a storage resource processing method provided in the embodiment of the present application, see Figure 7 The storage resource processing method further specifically includes the following contents:
[0102] Step 300: If the resource identifier to be deleted is obtained, the storage resource to be reclaimed in the identifier linked list corresponding to the resource identifier is extracted.
[0103] Step 410: If the type of the storage resource to be reclaimed is a storage page index address, determine whether the number of free storage bits in the recovered storage page index cache is less than a third threshold value; if so, execute step 420: store the storage page index address to be reclaimed in the DDR, and update the write pointer corresponding to the storage page index address in the DDR; if not, execute step 430: store the storage page index address to be reclaimed in the recovered storage page index cache.
[0104] Step 510: If the type of the storage resource to be reclaimed is a linked list index address, determine whether the number of free storage bits in the recovered linked list index cache is less than a fourth threshold value; if so, execute step 520: store the linked list index address to be reclaimed in the DDR, and update the write pointer corresponding to the linked list index address in the DDR; if not, execute step 530: store the linked list index address to be reclaimed in the recovered linked list index cache.
[0105] Specifically, the third threshold and the fourth threshold can be selected as positive integers close to 0, and the values of the first threshold to the fourth threshold can be the same or different, and can be specifically set according to actual application requirements.
[0106] In order to further illustrate the execution process of the above storage resource recovery, the present application also provides a specific application example of the storage resource recovery method, see Figure 8 The storage resource recovery method specifically includes the following contents:
[0107] Resource recycling: Recycle Page, recycle Line.
[0108] 1. When the hardware deletes the ID, the line and page in the ID list are written into the cache;
[0109] 2. When recycle_page_FiFo or recycle_line_FiFo is almost full, the page or line is actively stored in DDR and the write pointer of the page or line is updated.
[0110] That is to say, by distributing and recycling pages and lines in the hardware internal design of the DPU, it is possible to provide storage resources to the requesting party in a timely manner when the hardware storage resources are requested, which can effectively improve the reliability and scalability of hardware-based storage resource allocation, and can effectively improve the processing efficiency of hardware-based storage resources, and can improve the application scope and processing performance of the hardware, thereby ensuring the high performance and completeness of the hardware such as the DPU.
[0111] The present application also provides a storage resource processing device for executing all or part of the storage resource processing method. Fig. 9 , the storage resource processing device specifically includes the following contents:
[0112] The on-chip cache processing module 10 is used to obtain the storage resource type corresponding to the current resource allocation request, and query whether the preset local on-chip cache unit corresponding to the storage resource type currently contains the target storage resource corresponding to the resource allocation request.
[0113] The DDR processing module 20 is used to determine whether the current read / write state of the external DDR is in a resource readable state if the on-chip cache unit does not contain the target storage resource. If so, the target storage resource is obtained from the DDR to allocate the target storage resource to the request end of the resource allocation request, and the read / write state of the DDR is updated.
[0114] The embodiment of the storage resource processing device provided in the present application can be specifically used to execute the processing flow of the embodiment of the storage resource processing method in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the above-mentioned storage resource processing method embodiment.
[0115] From the above description, it can be seen that the storage resource processing device provided in the embodiment of the present application can provide storage resources to the requesting party in a timely manner when hardware storage resources are requested, can effectively improve the reliability and scalability of hardware-based storage resource allocation, and can effectively improve the processing efficiency of hardware-based storage resources, can improve the application scope and processing performance of the hardware, and thus can ensure the high performance and completeness of hardware such as DPU.
[0116] The present application also provides a DPU, see Fig.10 The DPU is provided with a storage resource processing device, and the storage resource processing device is used to execute all or part of the content of the storage resource processing method.
[0117] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0118] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0119] In the present application, features described and / or illustrated for one embodiment may be used in the same manner or in a similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0120] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A storage resource processing method, characterized in that: Executed in hardware, the storage resource processing method includes: Obtaining a storage resource type corresponding to a current resource allocation request, and querying whether a preset local on-chip cache unit corresponding to the storage resource type currently contains a target storage resource corresponding to the resource allocation request; If the on-chip cache unit does not include the target storage resource, determine whether the current read / write state of the external DDR is in a resource readable state, and if so, obtain the target storage resource from the DDR to allocate the target storage resource to the request end of the resource allocation request, and update the read / write state of the DDR; The obtaining of the storage resource type corresponding to the current resource allocation request and querying whether the preset local on-chip cache unit corresponding to the storage resource type currently contains the target storage resource corresponding to the resource allocation request includes: Get the storage resource type corresponding to the current resource allocation request; If the storage resource type is a storage page resource, querying whether a storage page index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request; If the storage resource type is a linked list resource, query whether a linked list index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request; The storage page index cache includes: distributing the storage page index cache and recycling the storage page index cache; Correspondingly, if the storage resource type is a storage page resource, querying whether a storage page index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request includes: If the storage resource type is a storage page resource, then determine whether the number of storage page index addresses currently stored in the distribution storage page index cache is less than a first threshold based on the distribution page index counter corresponding to the distribution storage page index cache. If so, query whether the recovered storage page index cache contains the target storage page resource corresponding to the resource allocation request.
2. The storage resource processing method according to claim 1, characterized in that: The linked list index cache includes: a distribution linked list index cache and a recycling linked list index cache; Correspondingly, if the storage resource type is a linked list resource, querying whether a linked list index cache preset in a local on-chip cache unit contains a target storage resource corresponding to the resource allocation request includes: If the storage resource type is a linked list resource, then determine whether the number of linked list index addresses currently stored in the distribution linked list index cache is less than a second threshold based on the distribution linked list index counter corresponding to the distribution linked list index cache. If so, query whether the recovery linked list index cache contains the target linked list resource corresponding to the resource allocation request.
3. The storage resource processing method according to claim 1, characterized in that: If the on-chip cache unit does not include the target storage resource, determining whether the current read / write state of the external DDR is in a resource readable state, and if so, obtaining the target storage resource from the DDR to allocate the target storage resource to the requesting end of the resource allocation request, and updating the read / write state of the DDR, including: If the recovered storage page index cache does not contain the target storage page resource, it is determined whether the read pointer corresponding to the current storage page index address in the external DDR is smaller than the write pointer corresponding to the storage page index address. If so, the target storage page index address is obtained from the DDR to allocate the target storage page index address to the request end of the resource allocation request, and the read pointer corresponding to the storage page index address in the DDR is updated.
4. The storage resource processing method according to claim 2, characterized in that: If the on-chip cache unit does not include the target storage resource, determining whether the current read / write state of the external DDR is in a resource readable state, and if so, obtaining the target storage resource from the DDR to allocate the target storage resource to the requesting end of the resource allocation request, and updating the read / write state of the DDR, including: If the target linked list resource is not included in the recycled linked list index cache, it is determined whether the read pointer corresponding to the current linked list index address in the external DDR is smaller than the write pointer corresponding to the linked list index address. If so, the target linked list index address is obtained from the DDR to allocate the target linked list index address to the request end of the resource allocation request, and the read pointer corresponding to the linked list index address in the DDR is updated.
5. The storage resource processing method according to claim 1, characterized in that: Also includes: If it is determined that the number of storage page index addresses currently stored in the distribution storage page index cache is equal to or greater than the first threshold, the target storage page index address is read from the distribution storage page index cache to allocate the target storage page index address to the request end of the resource allocation request; If it is determined that the recovered storage page index cache contains the target storage page resource corresponding to the resource allocation request, the target storage page index address is read from the recovered storage page index cache to allocate the target storage page index address to the request end of the resource allocation request.
6. The storage resource processing method according to claim 2, characterized in that: Also includes: If it is determined that the number of linked list index addresses currently stored in the distribution linked list index cache is equal to or greater than the first threshold, the target linked list index address is read from the distribution linked list index cache to allocate the target linked list index address to the request end of the resource allocation request; If it is determined that the recycling linked list index cache contains the target linked list resource corresponding to the resource allocation request, the target linked list index address is read from the recycling linked list index cache to allocate the target linked list index address to the request end of the resource allocation request.
7. The storage resource processing method according to claim 2, characterized in that: Also includes: If the resource identifier to be deleted is obtained, the storage resource to be recycled in the identifier linked list corresponding to the resource identifier is extracted; If the type of the storage resource to be reclaimed is a storage page index address, determine whether the number of free storage bits in the reclaimed storage page index cache is less than a third threshold value; if so, store the storage page index address to be reclaimed in the DDR, and update the write pointer corresponding to the storage page index address in the DDR; if not, store the storage page index address to be reclaimed in the reclaimed storage page index cache; If the type of the storage resource to be reclaimed is a linked list index address, determine whether the number of free storage bits in the recovered linked list index cache is less than a fourth threshold value. If so, store the linked list index address to be reclaimed in the DDR and update the write pointer corresponding to the linked list index address in the DDR; if not, store the linked list index address to be reclaimed in the recovered linked list index cache.
8. A DPU, characterized in that: A storage resource processing device is provided; The storage resource processing device is used to execute the storage resource processing method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Cache and method
CN109074313A