Storage resource allocation method, electronic device, storage medium and program product
By introducing counters and impedance value tables into the on-chip system, delaying processing of storage resource requests and adopting preemption mode management, the performance and stability problems caused by uneven resource allocation are solved, and more efficient and balanced resource allocation is achieved, and system performance and stability are improved.
Patent Information
- Application Number
- CN202510726364.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-03
AI Technical Summary
In the system on chip, the resource allocation strategy of the central resource management module is in a full load state, causing some tasks to fail to obtain resources for a long time, reducing system performance and stability.
The counter and preset occupancy index values correspond to impedance values are introduced. By delaying processing of storage resource allocation requests and preemption mode management, we ensure that resource allocation is more balanced and avoid resource hunger.
Improve the performance and stability of the system, avoid performance bottlenecks caused by uneven resource allocation, and improve the throughput and flexibility of resource allocation of the business subsystem.
Smart Images

Figure CN120256134B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a storage resource allocation method, an electronic device, a storage medium, and a program product. Background Art
[0002] In a system-on-chip (SoC) with high performance requirements, multiple business subsystems need to execute concurrently to improve system efficiency, and on-chip storage is used to overcome storage performance bottlenecks. On-chip storage offers the advantages of high bandwidth and low latency, but its capacity is limited. Each business subsystem allocates and reclaims its own configured on-chip storage resources through its own dynamic storage management module. However, the on-chip storage resource configuration for each business subsystem is typically static and cannot adapt to changes in the business subsystem's pressure.
[0003] To improve adaptability to pressure fluctuations, a central resource management module was introduced to support resource sharing among multiple business subsystems and resource over-allocation across multiple business subsystems to improve subsystem throughput. However, this strategy can cause some tasks to be unable to obtain resources for extended periods of time when the system is fully loaded, reducing system performance and stability. Summary of the Invention
[0004] The present application provides a storage resource allocation method, electronic device, storage medium and program product to at least solve the problem in related technologies that strategies reduce system performance and stability.
[0005] This application provides a storage resource allocation method, including:
[0006] Receive a storage resource allocation request sent by any business subsystem and delay processing the storage resource allocation request;
[0007] Starting a counter corresponding to the storage resource allocation request;
[0008] Determine the target occupancy index value of the business subsystem based on the remaining allocated storage resources of the central resource management module and the remaining requested storage resources of the business subsystem;
[0009] Based on a preset correspondence table between occupancy index values and impedance values, a target impedance value corresponding to the target occupancy index value is determined, where the larger the occupancy index value, the smaller the impedance value;
[0010] If the target impedance value is not greater than the count value of the counter, the storage resource allocation request begins to be processed;
[0011] If the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module do not meet the storage resource allocation request, the central resource management module is updated to be in preemptive mode marked as the preemptive mode of the business subsystem identifier, and allocation rejection information is returned to the business subsystem.
[0012] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned storage resource allocation methods when executing the computer program.
[0013] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned storage resource allocation methods are implemented.
[0014] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above storage resource allocation methods when executed by a processor.
[0015] According to the present application, due to receiving a storage resource allocation request sent by any business subsystem, the storage resource allocation request is delayed in processing; a counter corresponding to the storage resource allocation request is started; a target occupancy index value of the business subsystem is determined based on the remaining allocated storage resources of the central resource management module and the remaining applied storage resources of the business subsystem; a target impedance value corresponding to the target occupancy index value is determined based on a preset correspondence table of occupancy index values and impedance values, wherein the larger the occupancy index value, the smaller the impedance value; if the target impedance value is not greater than the count value of the counter, the storage resource allocation request is started to be processed, that is, the larger the target occupancy index value, the shorter the waiting time for the storage resource allocation request; if the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module do not meet the storage resource allocation request, the central resource management module is updated to be in preemptive mode with a preemption mark identified by the business subsystem, and allocation rejection information is returned to the business subsystem to ensure that the central resource management module is exclusively occupied by the business subsystem before the storage resource allocation request is processed. Through the above content, the situation where certain tasks cannot obtain resources for a long time when the system is fully loaded is avoided. Therefore, the technical problem that the strategies in related technologies reduce system performance and stability can be solved, and the technical effect of improving system performance and stability is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0017] Figure 1 A schematic diagram of the architecture of a system on a chip in related technology;
[0018] Figure 2 A schematic diagram of the structure of a storage resource allocation system provided in an embodiment of the present application;
[0019] Figure 3 A flowchart of a storage resource allocation method provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of the principle of the impedance distribution mechanism provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of a process in which four business subsystems according to an embodiment of the present application concurrently send storage resource allocation requests to a central resource management module, and the central resource management module processes the requests;
[0022] Figure 6 A flowchart of another storage resource allocation method provided in an embodiment of the present application;
[0023] Figure 7 A schematic diagram showing the correspondence between different occupancy index values and different delay processing durations provided in an embodiment of the present application;
[0024] Figure 8 A schematic diagram of the interaction between the interface arbitration logic module and the core arbitration logic module corresponding to the business subsystem provided in an embodiment of the present application;
[0025] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0027] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0028] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0029] High-performance systems-on-chip (SoCs) often require multiple, relatively independent business subsystems to run in parallel to improve overall system performance. To address storage performance bottlenecks, these systems often use on-chip storage to provide storage services for data and control information. This on-chip storage can be static random-access memory (SRAM).
[0030] On-chip storage offers significant advantages over traditional off-chip double data rate (DDR) storage: access bandwidth is dozens of times higher, and read and write latency is only nanoseconds. In other words, on-chip storage offers the advantages of high bandwidth and low latency. However, due to cost constraints, its storage capacity is far lower than DDR.
[0031] Each business subsystem is typically equipped with an independent dynamic storage management module responsible for allocating and reclaiming on-chip storage resources for that business subsystem. However, the resource allocation of each business subsystem is often static and fixed, lacking the ability to flexibly adjust to changes in system pressure.
[0032] To improve the business subsystems' ability to adapt to changing pressures, related technologies have introduced a central resource management module, which supports resource sharing among multiple business subsystems. The central resource management module also sets a maximum resource quota for each business subsystem and supports resource over-allocation across multiple business subsystems. This means that the combined maximum resource quotas of all business subsystems can exceed the total on-chip storage resources actually managed by the central resource management module.
[0033] In this way, when some business subsystems are idle, other business subsystems that need more on-chip storage resources can dynamically obtain additional on-chip storage resources, thereby improving their own business processing capabilities and throughput.
[0034] Figure 1 FIG. 1 is a schematic diagram of the architecture of a system on a chip in the related art. Figure 1 As shown, the system-on-chip (SoC) includes multiple business subsystems, namely, business subsystem 1, business subsystem 2, ..., and business subsystem n, as well as a central resource management module and on-chip storage. Each business subsystem is responsible for performing specific business functions and is equipped with a dynamic storage management module to manage the on-chip storage resources associated with the corresponding business subsystem, such as allocating and reclaiming on-chip storage resources, to ensure that the storage needs of the business subsystem are met. The central resource management module monitors and manages the usage of on-chip storage resources across the entire SoC, allocating resources between each business subsystem and its dynamic storage management module to ensure efficient overall system operation. The on-chip storage is divided into multiple shards, such as shard 1, shard 2, ..., and shard m, which are used to store data, program code, and other information during system operation. As needed, a business subsystem accesses the corresponding shard of the on-chip storage via the system bus to read or write data.
[0035] It's understandable that on-chip storage resources exist in a sharded form. The service subsystem, central resource management module, and on-chip storage are connected via a system bus. The system bus is a channel for transmitting data, addresses, and control signals. The service subsystem can interact with the on-chip storage via the system bus, reading required data or writing processing results. Furthermore, the central resource management module monitors and controls resource usage by the service subsystem and on-chip storage via the system bus.
[0036] However, the central resource management module's management strategy for on-chip storage resources in related technologies can cause tasks to become stuck for extended periods of time when the system is fully loaded, unable to obtain the required on-chip storage resources. This can occur due to uneven resource allocation, the prolonged occupation of certain resources by other tasks, or an unfair resource scheduling algorithm. This prolonged period of resource starvation leads to increasing task processing delays and even the possibility of exception handling. While this doesn't cause system deadlock, it significantly restricts the overall performance of the system, causing unnecessary performance fluctuations and reducing system performance and stability.
[0037] In order to solve the above problems, an embodiment of the present application provides a storage resource allocation method, which includes: receiving a storage resource allocation request sent by any business subsystem, delaying the processing of the storage resource allocation request; starting a counter corresponding to the storage resource allocation request; determining the target occupancy index value of the business subsystem based on the remaining allocated storage resources of the central resource management module and the remaining applied storage resources of the business subsystem; determining the target impedance value corresponding to the target occupancy index value based on a preset correspondence table of occupancy index values and impedance values, the larger the occupancy index value, the smaller the impedance value; if the target impedance value is not greater than the count value of the counter, starting to process the storage resource allocation request; if the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module does not meet the storage resource allocation request, updating the central resource management module to be in preemptive mode with the preemption mark identified by the business subsystem, and returning a rejection allocation information to the business subsystem. The method provided by the above scheme sets the waiting time for storage resource allocation request of a business subsystem to be shorter when the target occupancy index value of the business subsystem is larger; when the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module do not meet the storage resource allocation request, the central resource management module is updated to be in preemptive mode with the preemptive mark of the business subsystem identifier, ensuring that the central resource management module is exclusively occupied by the business subsystem before the storage resource allocation request is processed, avoiding the situation where certain tasks cannot obtain resources for a long time when the system is fully loaded, achieving more efficient and balanced resource allocation among multiple business subsystems, avoiding performance bottlenecks caused by uneven resource allocation, and improving the overall performance and stability of the system.
[0038] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the storage resource allocation method depends, the specific application environment architecture or specific hardware architecture is described herein.
[0039] The storage resource allocation method, electronic device, storage medium and program product provided in the embodiments of the present application are suitable for allocating on-chip storage resources. Figure 2 As shown, it is a structural diagram of the storage resource allocation system based on the embodiment of the present application, which mainly includes a central resource management module and multiple business subsystems. Among them, for the scenario where multiple business subsystems share on-chip storage resources through the central resource management module, in order to realize resource allocation between business subsystems more efficiently and balancedly, the central resource management module includes a core arbitration logic module and multiple interface arbitration logic modules, and one interface arbitration logic module is used to connect with one business subsystem.
[0040] An exclusive resource preemption mechanism is introduced into the core arbitration logic module to avoid resource starvation, i.e., a task timeout occurs when a business subsystem repeatedly retries for a long time but fails to obtain resources. The exclusive preemption mechanism is that when a business subsystem requests a certain amount of storage resources from the core arbitration logic module, but the remaining storage resources of the core arbitration logic module cannot meet the request, the core arbitration logic module enters preemption mode. Until the business subsystem's request is met or the request times out, no other business subsystems can obtain any more storage resources. It can be understood that the initial storage resources in the core arbitration logic module are all the on-chip storage resources of the system-on-chip.
[0041] It's understandable that, when only the exclusive preemption mechanism is applied, a business subsystem with a larger average number of resource requests per session or a more intensive resource request will receive more storage resources. This is especially true when the High Water Mark (HWM) of each business subsystem's resource requests, or the maximum allowable resource limit, is over-allocated—that is, when the sum of the High Water Marks of each business subsystem's resource requests is greater than or equal to the total allocatable storage resources of the SoC.
[0042] To ensure more balanced resource allocation across business subsystems, an allocation impedance mechanism is introduced into the interface arbitration logic module. This balances resource allocation across multiple business subsystems by blocking allocation requests from business subsystems that already have a high resource footprint. The core idea behind this mechanism is to flexibly suppress new requests from business subsystems with high storage resource usage, allowing other business subsystems with relatively low storage resource usage to obtain resources with higher priority. Furthermore, when storage resources are nearing depletion, allocations are delayed to allow more time for storage resources to be recovered.
[0043] An embodiment of the present application provides a storage resource allocation method, which is applied to a central resource management module. The central resource management module is used to manage all on-chip storage resources of a system on chip, including allocating and reclaiming on-chip storage resources. Figure 3 A flowchart of a storage resource allocation method provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the process includes the following steps:
[0044] Step S301: receiving a storage resource allocation request sent by any business subsystem and delaying processing of the storage resource allocation request.
[0045] As previously mentioned, a business subsystem sends a storage resource allocation request to its corresponding interface arbitration logic module within the central resource management module. Upon receiving a storage resource allocation request from its corresponding business subsystem, any interface arbitration logic module first blocks the request from the core arbitration logic module, thereby delaying processing of the storage resource allocation request. It will be appreciated that the storage resources are on-chip storage resources.
[0046] Step S302: Start a counter corresponding to the storage resource allocation request.
[0047] While shielding the storage resource allocation request, a counter corresponding to the storage resource allocation request is immediately started, so that the counter corresponding to the storage resource allocation request starts counting from 0 and increases by 1. The counter is an impedance counter.
[0048] It is understood that the clock frequency of the counter determines how often the counter counts. For example, if the counter operates at a clock frequency of 500 MHz, the counter counts by 1 every 2 nanoseconds.
[0049] Step S303 : determining a target occupancy index value of the business subsystem based on the remaining allocated storage resources of the central resource management module and the remaining requested storage resources of the business subsystem.
[0050] The remaining allocated storage resources of the central resource management module refer to the remaining allocable storage resources of the central resource management module, and the remaining requested storage resources of the business subsystem refer to the remaining requestable storage resources of the business subsystem. The remaining requested storage resources of the business subsystem are determined by subtracting the occupied storage resources of the business subsystem from the storage resource watermark of the business subsystem, i.e., the highest resource request watermark.
[0051] Step S304: determining a target impedance value corresponding to the target occupancy index value based on a preset correspondence table between occupancy index values and impedance values. The larger the occupancy index value, the smaller the impedance value.
[0052] It should be noted that the preset correspondence table between occupancy index values and impedance values is configured when the system on chip is initialized.
[0053] Step S305: If the target impedance value is not greater than the count value of the counter, start processing the storage resource allocation request.
[0054] It can be understood that the larger the occupancy index value and the smaller the impedance value, the larger the target occupancy index value and the shorter the time required for the target impedance value to be no greater than the count value of the counter. In other words, the larger the target occupancy index value of the business subsystem, the shorter the delay in processing the storage resource allocation request of the business subsystem, so as to balance the resource allocation among the business subsystems.
[0055] Furthermore, since storage resources are dynamically allocated and recycled, the target occupancy index value of the business subsystem is constantly changing, and the corresponding target impedance value is also constantly changing. When the target impedance value is not greater than the count value of the counter, the interface arbitration logic module cancels the shielding of the current storage resource allocation request, allowing it to enter the core arbitration logic module for final resource allocation arbitration.
[0056] It can be seen from steps S301 to S305 that the present application implements the impedance distribution mechanism by simply adding an impedance counter and a preset correspondence table between occupancy index values and impedance values, which has low complexity. Figure 4 This is a schematic diagram of the principle of the impedance distribution mechanism provided in the embodiment of the present application. Figure 4 As shown, the interface arbitration logic module introduces an allocation impedance mechanism. Every time the interface arbitration logic module receives a storage resource allocation request sent by the corresponding business subsystem, the allocation impedance mechanism is triggered. The storage resource allocation request is first shielded from the core arbitration logic module, and the counter corresponding to the storage resource allocation request is immediately started, so that the counter starts counting from 0 and adds 1, that is, the count value ++. The occupancy index value of the business subsystem is periodically calculated, and then the corresponding impedance value is searched from the impedance value lookup table using the occupancy index value of the business subsystem obtained periodically as input, that is, the corresponding lookup table value is periodically updated, and the corresponding impedance value is searched from the impedance value lookup table based on the updated lookup table value. The impedance value lookup table is a correspondence table of preset occupancy index values and impedance values. If the impedance value found from the impedance value lookup table is less than or equal to the count value, the shielding of the storage resource allocation request is immediately released, so that it can enter the core arbitration logic module for final resource allocation arbitration.
[0057] It can be understood that all interface arbitration logic modules share the preset correspondence table between occupancy index values and impedance values.
[0058] Step S306: If the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module do not meet the storage resource allocation request, the central resource management module is updated to be in preemptive mode marked as the preemptive mode identified by the business subsystem, and allocation rejection information is returned to the business subsystem.
[0059] The central resource management module is in preemptive mode, marked with the business subsystem's identifier. This means that the central resource management module is exclusively used by the business subsystem and will not process storage resource allocation requests from other business subsystems until the resource allocation for the business subsystem's current storage resource allocation request is completed. Each business subsystem has a unique business subsystem identifier.
[0060] Step S306 is implemented by the core arbitration logic module. That is, the remaining allocated storage resources in the central resource management module are the remaining allocated storage resources in the core arbitration logic module. Updating the central resource management module to a preemptive mode with the preemption flag set to the business subsystem identifier is equivalent to updating the core arbitration logic module to a preemptive mode with the preemption flag set to the business subsystem identifier. It is understood that returning a refusal to allocate information to the business subsystem means refusing to allocate storage resources to the business subsystem.
[0061] It should be noted that there are three possible reasons why a storage resource allocation request from a business subsystem may be rejected:
[0062] 1. Reaching the resource application maximum watermark HWM preset by the business subsystem: The upper limit of the storage resources currently allowed to be obtained by each business subsystem preset by the on-chip system is called the resource application maximum watermark. If the sum of the storage resources currently allocated to the business subsystem, that is, the amount of storage resources occupied by the business subsystem and the amount of storage resources requested by the new storage resource allocation request of the business subsystem, is greater than the HWM, the interface arbitration logic module will directly reject the storage resource allocation request.
[0063] 2. Resource Run Out (RRO): When a business subsystem passes the interface arbitration logic module's determination of whether its HWM has been reached, i.e., if its HWM has not been reached, it will further request the corresponding storage resources from the central arbitration logic module. However, if the remaining storage resources in the core arbitration logic module cannot meet the request and the exclusive preemption flag is "empty" or "marked as occupied by the current business subsystem," the core arbitration logic module will directly reject the storage resource allocation request. If the exclusive preemption flag is "empty," the core arbitration logic module is in non-preemptive mode, while if the exclusive preemption flag is "marked as occupied by the current business subsystem," the core arbitration logic module is in preemptive mode, as marked by the business subsystem.
[0064] 3. Resource Pool Occupied (OCP): After a business subsystem's interface arbitration logic module determines whether its HWM is met, it will request the corresponding storage resources from the core arbitration logic module. However, if the exclusive preemption flag is "Occupied by another business subsystem," the core arbitration logic will directly reject the storage resource allocation request. The exclusive preemption flag of "Occupied by another business subsystem" indicates that the core arbitration logic module is in preemptive mode, with the preemption flag set to "Occupied by another business subsystem."
[0065] It can be understood that the allocation rejection information in the allocation rejection information returned to the business subsystem in step S306 is allocation rejection information of a resource pool exhaustion type.
[0066] Figure 5 The four business subsystems provided in the embodiment of the present application concurrently send storage resource allocation requests to the central resource management module, and the central resource management module processes the request. Figure 5As shown, the central resource management module manages on-chip storage resources through a table of pages to be allocated and a list of pointers. Business subsystem 1 sends request 1.1 to the central resource management module via the dynamic storage management module. The interface arbitration logic module determines that business subsystem 1 has reached the preset resource application high watermark and returns a request for allocation rejection of the HWM type, indicating that the preset resource application high watermark has been reached. After waiting for a preset time, business subsystem 1 initiates request 1.1 again. Business subsystem 1 has not reached the preset resource application high watermark, but the core arbitration logic module's exclusive preemption flag is now 2, indicating that the core arbitration logic module is in preemptive mode with the preemption flag set to business subsystem 2. A request for allocation rejection of the OCP type is returned to the business subsystem. After waiting for a preset time, business subsystem 1 initiates request 1.1 again. Business subsystem 1 has not reached the preset resource request high watermark, but the core arbitration logic module's exclusive preemption flag is 2 at this time, meaning the core arbitration logic module is currently in preemptive mode with the preemption flag set to business subsystem 2. A refusal of allocation information of the OCP type is returned to the business subsystem. After waiting for a preset time, business subsystem 1 initiates request 1.1 again. Business subsystem 1 has not reached the preset resource request high watermark, the core arbitration logic module is in non-preemptive mode, and the remaining allocated storage resources of the core arbitration logic module do not meet the requirements of request 1.1. The core arbitration logic module is then updated to preemptive mode with the preemption flag set to business subsystem 1, and a refusal of allocation information of the RRO type is returned to the business subsystem. After waiting for a preset time, business subsystem 1 initiates request 1.1 again. Business subsystem 1 has not reached the preset resource request high watermark. The core arbitration logic module is in preemptive mode with the preemption mark set to business subsystem 1. However, the remaining allocated storage resources of the core arbitration logic module do not satisfy request 1.1, and a rejection allocation message of RRO type is returned to the business subsystem. After waiting for a preset time, business subsystem 1 initiates request 1.1 again. Business subsystem 1 has not reached the preset resource request high watermark. The core arbitration logic module is in preemptive mode with the preemption mark set to business subsystem 1, and the remaining allocated storage resources of the core arbitration logic module satisfy request 1.1. The storage resources corresponding to request 1.1 are allocated to business subsystem 1, and processing of request 1.1 is completed.
[0067] It is understandable that the processing flow of request 1.2 of business subsystem 1, the processing flow of request 2.1 of business subsystem 2, the processing flow of request 2.2 of business subsystem 2, the processing flow of request 2.3 of business subsystem 2, the processing flow of request 3.1 of business subsystem 3, the processing flow of request 4.1 of business subsystem 4 and the processing flow of request 4.2 of business subsystem 4 are similar to the processing flow of request 1.1 of business subsystem 1 and are not described in detail here. Figure 5 As shown, all requests are storage resource allocation requests. If the request is rejected, the request is a dotted line, and the rejection reason is indicated below the request signal. If the request is allocated storage resources, the request information is a solid line.
[0068] The storage resource allocation method provided in the embodiment of the present application achieves more efficient and balanced resource allocation among multiple business subsystems by introducing an exclusive preemption mechanism and an allocation impedance mechanism, avoiding performance bottlenecks caused by uneven resource allocation, and avoiding the problem of task timeouts caused by a business subsystem being unable to obtain the required resources for a long time, thereby reducing the occurrence of task processing delays and exception throwing processing processes, increasing the stability of the system, reducing performance fluctuations caused by uneven resource allocation or tasks waiting for resources for a long time, and thus improving the overall performance of the system.
[0069] Moreover, the storage resource allocation method provided in the embodiment of the present application allows for dynamic adjustment of resource allocation when the pressure of the business subsystem changes, so that the resource configuration is no longer static and fixed, but can flexibly respond to changes in the pressure of the business subsystem. When other business subsystems are idle, a business subsystem can obtain more storage resources, thereby improving its business throughput.
[0070] The allocation impedance mechanism flexibly suppresses new requests from service subsystems with high resource usage, allowing service subsystems with low resource usage to obtain resources with higher priority, increasing resource allocation flexibility. When resources are nearing exhaustion, the allocation impedance mechanism can delay allocation, allowing more time for resource recovery and optimizing the resource recovery process.
[0071] The embodiment of the present application provides a storage resource allocation method, which is applied to a central resource management module. Figure 6 A flowchart of a storage resource allocation method provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the process includes the following steps:
[0072] Step S601: Receive a storage resource allocation request from any business subsystem and delay processing the storage resource allocation request. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0073] Step S602: Start the counter corresponding to the storage resource allocation request. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.
[0074] Step S603: determining a target occupancy index value of the business subsystem based on the remaining allocated storage resources of the central resource management module and the remaining requested storage resources of the business subsystem.
[0075] Specifically, the above step S603 includes:
[0076] Step S6031: Obtain the working mode of the central resource management module.
[0077] Among them, the central resource management module has two working modes, namely the business subsystem priority mode and the central resource management module priority mode. The working mode of the central resource management module is pre-set by technical personnel according to the actual application scenario. Among them, in the business subsystem priority mode, even if the core arbitration logic module still has a large amount of storage resources to be allocated, as long as the amount of storage resources allocated to the business subsystem is close to reaching the HWM, it will be affected by the obvious resource application hysteresis effect of the interface arbitration logic module. In the central resource management module priority mode, that is, the core arbitration logic module priority mode, only when the core arbitration logic module has only a small amount of storage resources to be allocated, the interface arbitration logic module corresponding to each business subsystem will begin to produce a hysteresis effect on the resource application of the business subsystem. The strength of the effect depends on the actual current storage resource occupancy of each business subsystem. The more storage resources are occupied, the greater the effect, that is, the longer the waiting time for delayed processing.
[0078] Step S6032: Determine the target occupancy index value of the business subsystem based on the working mode, the remaining allocated storage resources of the central resource management module, and the remaining requested storage resources of the business subsystem.
[0079] Step S604: Based on the preset correspondence table between occupancy index values and impedance values, determine the target impedance value corresponding to the target occupancy index value. The larger the occupancy index value, the smaller the impedance value. Figure 3 Step S304 of the illustrated embodiment will not be described in detail here.
[0080] Step S605: If the target impedance value is not greater than the count value of the counter, the storage resource allocation request is processed. Figure 3 Step S305 of the illustrated embodiment will not be described in detail here.
[0081] Step S606: If the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module do not meet the storage resource allocation request, the central resource management module is updated to be in preemptive mode with the preemptive flag of the business subsystem, and a rejection of allocation information is returned to the business subsystem. Figure 3 Step S306 of the illustrated embodiment will not be described in detail here.
[0082] The storage resource allocation method provided in the embodiment of the present application can flexibly adjust the resource allocation strategy according to the actual application scenario by clarifying the working mode of the central resource management module, which helps to achieve more efficient resource utilization in different application scenarios.
[0083] In some optional implementations, step S6032 includes:
[0084] Step a1: When the working mode is the service subsystem priority mode, the target occupancy index value of the service subsystem is determined by the first formula. The first formula is:
[0085] .
[0086] Step a2: When the working mode is the central resource management module priority mode, the target occupancy index value of the service subsystem is determined by the second formula. The second formula is:
[0087] .
[0088] in, is the target occupancy index value of the business subsystem when the working mode is the business subsystem priority mode, is the target occupancy index value of the business subsystem in the central resource management module priority mode, is the weight coefficient, The remaining allocated storage resources for the central resource management module, The remaining storage resources requested for this business subsystem. is the normalization coefficient.
[0089] It should be noted that the weight coefficient is: ,in, The value is preset by the technician.
[0090] Normalization coefficient: = , ,in, The value is preset by the technician.
[0091] In some optional implementations, the above storage resource allocation method further includes:
[0092] Step b1: when the target occupancy index value is greater than the preset saturation value, updating the target occupancy index value to the preset saturation value.
[0093] It will be appreciated that if the target occupancy index value calculated using the first or second formula is greater than the preset saturation value, the target occupancy index value is updated to the preset saturation value, and the target impedance value is determined based on the updated target occupancy index value. In other words, the maximum value of the target occupancy index value is the preset saturation value.
[0094] When the target occupancy index value calculated by the first formula or the second formula is not greater than the preset saturation value, the target impedance value is determined based on the target occupancy index value calculated by the first formula or the second formula.
[0095] The storage resource allocation method provided in the embodiment of the present application ensures the accuracy of the obtained target impedance value by setting the maximum value of the target occupancy index value to the preset saturation value when the target occupancy index value is greater than the preset saturation value.
[0096] In some optional implementations, the above storage resource allocation method further includes:
[0097] In step c1, a preset saturation value is determined by a third formula. The third formula is:
[0098]
[0099] in, is the preset saturation value, is the preset saturation parameter. The value of b can be 3, 4, or 5, which is preset by the technician.
[0100] In some optional implementations, the above storage resource allocation method further includes:
[0101] Step d1, obtaining different occupancy index values.
[0102] Step d2: for any occupancy index value, determine the impedance value corresponding to the occupancy index value by using the fourth formula to obtain impedance values corresponding to different occupancy index values.
[0103] Step d3: establishing a preset correspondence table between occupancy index values and impedance values based on different occupancy index values and impedance values corresponding to the different occupancy index values.
[0104] Among them, the fourth formula is:
[0105]
[0106] in, is the maximum delay processing time, is the occupancy index value, is the impedance adjustment coefficient, for The corresponding impedance value.
[0107] It is understandable that during the initialization of the system on chip, and The technicians set up the and is given, at this time, different The value corresponds to a different impedance value. The impedance value is a count value, but it actually represents the delay processing duration of the storage resource allocation request. Because the counter counts once at a fixed interval, the delay processing duration can be obtained based on the count value. Figure 7 This is a schematic diagram of the correspondence between different occupancy index values and different delay processing durations provided in the embodiment of the present application. Figure 7 As shown, in , the counter operates at a clock frequency of 500MHz, In the case of changes, different occupancy index values correspond to different delay processing times, where The smaller the value, the longer the delay processing time.
[0108] In some optional implementations, before starting the counter corresponding to the storage resource allocation request, the storage resource allocation method further includes:
[0109] Step e1: determining the current total requested storage resource amount of the business subsystem based on the amount of storage resources to be requested in the storage resource allocation request and the amount of storage resources already occupied by the business subsystem.
[0110] Step e2: If the current total requested storage resource amount is not greater than the storage resource amount watermark of the business subsystem, then the step of starting a counter corresponding to the storage resource allocation request is executed.
[0111] The storage resource allocation method provided in the embodiment of the present application ensures fairer and more reasonable resource allocation among different business subsystems by limiting the maximum amount of storage resources that can be applied for by each business subsystem.
[0112] In some optional implementations, the above storage resource allocation method further includes:
[0113] Step f1: If the total storage resource application amount is greater than the storage resource watermark of the business subsystem, a rejection allocation message is returned to the business subsystem to reject the storage resource allocation request of the business subsystem.
[0114] The storage resource allocation method provided in the embodiment of the present application can avoid subsequent processing of invalid storage resource allocation requests by directly returning allocation rejection information when the current total applied storage resource amount is greater than the storage resource watermark of the business subsystem.
[0115] In some optional implementations, the above storage resource allocation method further includes:
[0116] Step g1: If the central resource management module is in the preemption mode and the preemption identifier is not the identifier of the business subsystem, it returns allocation rejection information to the business subsystem to reject the storage resource allocation request of the business subsystem.
[0117] The storage resource allocation method provided in the embodiments of the present application rejects storage resource allocation requests from a current business subsystem if the central resource management module is in preemptive mode for another business subsystem. This avoids conflicts and confusion caused by multiple business subsystems simultaneously preempting resources, ensuring that resource allocation is executed according to established priority rules.
[0118] In some optional implementations, the above storage resource allocation method further includes:
[0119] Step h1: If the central resource management module is in the preemption mode with the preemption mark being the identifier of the business subsystem, it is determined whether the remaining allocated storage resources of the central resource management module meet the storage resource allocation request.
[0120] Step h2: If the remaining allocated storage resources of the central resource management module meet the storage resource allocation request, the storage resources corresponding to the storage resource allocation request are allocated to the business subsystem, and the central resource management module is updated to be in non-preemptive mode.
[0121] After receiving the allocation rejection information, the business subsystem waits for a first preset time period and initiates a storage resource allocation request again until the storage resource amount corresponding to the storage resource allocation request is obtained or the request duration of the storage resource allocation request exceeds a preset duration threshold.
[0122] It is understood that after receiving the allocation rejection information, any business subsystem will wait for a first preset period of time and then re-initiate the rejected storage resource allocation request until the storage resource amount corresponding to the storage resource allocation request is obtained or the storage resource allocation request times out. The storage resource allocation request timeout occurs when the request duration of the storage resource allocation request exceeds a preset duration threshold. The first preset period of time and the preset duration threshold are set by technical personnel and are not specifically limited here.
[0123] When the business subsystem obtains the storage resource amount corresponding to a storage resource allocation request or when a storage resource allocation request times out, it executes the next storage resource allocation request.
[0124] In some optional implementations, the above storage resource allocation method further includes:
[0125] Step i1: If the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module meet the storage resource allocation request, the storage resources corresponding to the storage resource allocation request are allocated to the business subsystem, and the remaining allocated storage resources of the central resource management module are updated.
[0126] The storage resource allocation method provided in the embodiment of the present application can directly complete resource allocation if the central resource management module has sufficient remaining allocated storage resources and is currently in non-preemptive mode, which can significantly shorten the resource allocation time and improve the system's response speed.
[0127] In some optional implementations, the above storage resource allocation method further includes:
[0128] Step j1: updating the target occupancy index value of the business subsystem based on the remaining allocated storage resources of the central resource management module and the remaining requested storage resources of the business subsystem at intervals of a second preset time period.
[0129] It is understood that because storage resources are dynamically allocated and reclaimed, the remaining allocated storage resources in the central resource management module and the remaining requested storage resources of the business subsystem are constantly changing. Consequently, the target occupancy index value of the business subsystem is constantly changing. Therefore, it is necessary to periodically update the target occupancy index value of the business subsystem to determine the target impedance value based on the latest target occupancy index value and compare the target impedance value with the count value of the counter. The second preset time period is set by technical personnel and is not specifically limited here.
[0130] The storage resource allocation method provided in the embodiment of the present application periodically updates the target occupancy index value, thereby accurately determining the target impedance value, thereby ensuring the accuracy of the timing of processing the storage resource allocation request.
[0131] In some optional implementations, the above storage resource allocation method further includes:
[0132] Step k1: If the target impedance value is greater than the count value of the counter, the storage resource allocation request is delayed.
[0133] The storage resource allocation method provided in the embodiment of the present application ensures the balance of resource allocation by delaying the processing of storage resource allocation requests when the target impedance value is greater than the count value of the counter.
[0134] In some optional implementations, the above storage resource allocation method further includes:
[0135] Step L1, if the central resource management module is in the preemptive mode with the preemption mark as the business subsystem identifier, and the remaining allocated storage resources of the central resource management module do not meet the storage resource allocation request, the central resource management module continues to remain in the preemptive mode with the preemption mark as the business subsystem identifier, and returns the allocation rejection information to the business subsystem.
[0136] In some optional implementations, the above storage resource allocation method further includes:
[0137] Step M1 monitors the processing of any received storage resource allocation request in real time, and issues an alarm if the request duration of any storage resource allocation request exceeds the preset duration and the storage resource amount corresponding to the storage resource allocation request is not allocated to the business subsystem corresponding to the storage resource allocation request.
[0138] The storage resource allocation method provided in the embodiment of the present application can quickly discover and locate problems that may arise in the resource allocation process through real-time monitoring and alarm mechanisms, thereby avoiding business interruptions caused by long-term non-allocation of storage resources, enhancing system reliability, and ensuring the normal operation of the business subsystem.
[0139] Figure 8 This is a schematic diagram of the interaction between the interface arbitration logic module and the core arbitration logic module corresponding to the business subsystem provided in the embodiment of the present application. Figure 8 As shown, the interaction between the interface arbitration logic module corresponding to business subsystem 1 and the core arbitration logic module is described. The interaction between the interface arbitration logic modules corresponding to other business subsystems and the core arbitration logic module is similar to the interaction between the interface arbitration logic modules corresponding to business subsystem 1 and the core arbitration logic module, and will not be repeated here. The interaction between the interface arbitration logic module corresponding to business subsystem 1 and the core arbitration logic module includes the following process:
[0140] Within the interface arbitration logic module corresponding to business subsystem 1, the module is initially in standby mode. Upon receiving a storage resource allocation request, a HWM check is performed on business subsystem 1. This HWM check determines whether the total storage resource requested by business subsystem 1 exceeds the storage resource watermark for that business subsystem.
[0141] If the check passes, meaning the total storage resource requested by business subsystem 1 is not greater than the storage resource watermark for that business subsystem, the allocation impedance mechanism is activated. If the check fails, the interface arbitration logic module switches to the reject state, refusing to respond to business subsystem 1's storage resource allocation request.
[0142] When the target impedance value is not greater than the count value of the counter, the interface arbitration logic module forwards the storage resource allocation request to the core arbitration logic module.
[0143] The core arbitration logic module is initially in standby mode. Upon receiving a storage resource allocation request, if the core arbitration logic module is in non-preemptive mode and the remaining allocated storage resources can satisfy the storage resource allocation request, the core arbitration logic module enters a pre-allocation state and makes an allocation response to the interface arbitration logic module, completing the allocation of the storage resource quantity corresponding to the storage resource allocation request. If the core arbitration logic module is in non-preemptive mode but the remaining allocated storage resources do not satisfy the storage resource allocation request, the core arbitration logic module enters preemptive mode, marks the core arbitration logic module as being exclusively occupied by business subsystem 1, and makes an RRO-type rejection response to the interface arbitration logic module.
[0144] If the core arbitration logic module is in preemptive mode and the core arbitration logic module is marked as being exclusively occupied by other business subsystems, an OCP type rejection response is made to the interface arbitration logic module.
[0145] If the core arbitration logic module is in preemptive mode, and the core arbitration logic module is marked as being exclusively occupied by business subsystem 1, and the remaining allocated storage resources can meet the storage resource allocation request, the core arbitration logic module enters the pre-allocation state and makes an allocation response to the interface arbitration logic module.
[0146] If the core arbitration logic module is in preemptive mode, and the core arbitration logic module is marked as being exclusively occupied by business subsystem 1, and the remaining allocated storage resources do not meet the storage resource allocation request, the core arbitration logic module makes an RRO type rejection response to the interface arbitration logic module.
[0147] If the business subsystem times out the exclusive use of the core arbitration logic module, that is, the request duration of the storage resource allocation request exceeds a preset duration threshold, the core arbitration logic module is in a non-preemptive mode.
[0148] After receiving the allocation response or rejection response from the core arbitration logic module, the interface arbitration logic module switches state accordingly, that is, switches to the allocation state or rejection state, and responds to the service subsystem 1 .
[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0150] The embodiment of the present application also provides an electronic device, such as Figure 9 As shown, it includes a processor 901 and a memory 902, wherein the memory 902 stores a computer program, and the processor 901 is configured to run the computer program to execute the steps in any of the above storage resource allocation method embodiments.
[0151] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned storage resource allocation method embodiments when running.
[0152] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0153] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned storage resource allocation method embodiments are implemented.
[0154] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned storage resource allocation method embodiments are implemented.
[0155] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0156] The above is a detailed introduction to a storage resource allocation method, electronic device, storage medium, and program product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A storage resource allocation method, characterized in that: include: receiving a storage resource allocation request sent by any business subsystem, and delaying processing of the storage resource allocation request; Starting a counter corresponding to the storage resource allocation request; Based on the remaining allocated storage resources of the central resource management module and the remaining applied storage resources of the business subsystem, the target occupancy index value of the business subsystem is determined. The remaining allocated storage resources of the central resource management module are the remaining allocable storage resources of the current central resource management module. The remaining applied storage resources of the business subsystem are the remaining applicable storage resources of the business subsystem. The remaining applied storage resources of the business subsystem are determined based on the difference between the storage resource watermark of the business subsystem and the occupied storage resources of the business subsystem. The storage resource watermark of the business subsystem is the maximum resource limit allowed to be applied by the business subsystem. Determine a target impedance value corresponding to the target occupancy index value based on a preset correspondence table between occupancy index values and impedance values, wherein the larger the occupancy index value, the smaller the impedance value; If the target impedance value is not greater than the count value of the counter, starting to process the storage resource allocation request; If the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module do not satisfy the storage resource allocation request, then the central resource management module is updated to be in preemptive mode with a preemption mark as the business subsystem identifier, and allocation rejection information is returned to the business subsystem. Wherein, if the central resource management module is in preemptive mode with a preemption mark as the business subsystem identifier, then before the resource allocation of the current storage resource allocation request of the business subsystem is completed, the central resource management module is exclusively used by the business subsystem and will not process storage resource allocation requests of other business subsystems; The method further comprises: If the central resource management module is in a preemptive mode with the preemption mark being the identifier of the business subsystem, determining whether the remaining allocated storage resources of the central resource management module meet the storage resource allocation request; If the remaining allocated storage resources of the central resource management module meet the storage resource allocation request, the storage resources corresponding to the storage resource allocation request are allocated to the business subsystem, and the central resource management module is updated to be in non-preemptive mode; After receiving the allocation rejection information, the business subsystem waits for a first preset time period and re-initiates the storage resource allocation request until the amount of storage resources corresponding to the storage resource allocation request is obtained or the request duration of the storage resource allocation request exceeds a preset duration threshold; The method further comprises: If the central resource management module is in non-preemptive mode and the remaining allocated storage resources of the central resource management module meet the storage resource allocation request, the storage resources corresponding to the storage resource allocation request are allocated to the business subsystem, and the remaining allocated storage resources of the central resource management module are updated; The method further comprises: At intervals of a second preset time period, the target occupancy index value of the business subsystem is updated based on the remaining allocated storage resources of the central resource management module and the remaining applied storage resources of the business subsystem.
2. The method according to claim 1, characterized in that The determining of the target occupancy index value of the business subsystem based on the remaining allocated storage resources of the central resource management module and the remaining applied storage resources of the business subsystem includes: Obtaining the working mode of the central resource management module; Based on the working mode, the remaining allocated storage resources of the central resource management module and the remaining applied storage resources of the business subsystem, a target occupancy index value of the business subsystem is determined.
3. The method according to claim 2, characterized in that The determining of the target occupancy index value of the business subsystem based on the working mode, the remaining allocated storage resources of the central resource management module, and the remaining applied storage resources of the business subsystem includes: When the working mode is the service subsystem priority mode, the target occupancy index value of the service subsystem is determined by a first formula, which is: When the working mode is the central resource management module priority mode, the target occupancy index value of the service subsystem is determined by the second formula, which is: in, is the target occupancy index value of the business subsystem when the working mode is the business subsystem priority mode, is the target occupancy index value of the business subsystem in the central resource management module priority mode, is the weight coefficient, The remaining allocated storage resources for the central resource management module, The remaining storage resources requested for this business subsystem. is the normalization coefficient.
4. The method according to claim 3, characterized in that The method further comprises: In a case where the target occupancy index value is greater than a preset saturation value, the target occupancy index value is updated to the preset saturation value.
5. The method according to claim 4, characterized in that The method further comprises: The preset saturation value is determined by a third formula, which is: in, is the preset saturation value, is the preset saturation parameter.
6. The method according to claim 1, characterized in that The method further comprises: Get different occupancy indicator values; For any occupancy index value, determine the impedance value corresponding to the occupancy index value using the fourth formula to obtain impedance values corresponding to different occupancy index values; Based on different occupancy index values and impedance values corresponding to different occupancy index values, establishing a correspondence table of the preset occupancy index values and impedance values; Among them, the fourth formula is: in, is the maximum delay processing time, is the occupancy index value, is the impedance adjustment coefficient, for The corresponding impedance value.
7. The method according to claim 1, characterized in that Before starting the counter corresponding to the storage resource allocation request, the method further includes: Determine the current total requested storage resource amount of the business subsystem based on the amount of storage resources to be requested in the storage resource allocation request and the amount of storage resources already occupied by the business subsystem; If the current total requested storage resource amount is not greater than the storage resource amount watermark of the business subsystem, the step of starting a counter corresponding to the storage resource allocation request is executed.
8. The method according to claim 7, characterized in that The method further comprises: If the current total applied storage resource amount is greater than the storage resource amount watermark of the business subsystem, a rejection allocation message is returned to the business subsystem to reject the storage resource allocation request of the business subsystem.
9. The method according to claim 1, characterized in that The method further comprises: If the central resource management module is in the preemption mode where the preemption identifier is not the identifier of the business subsystem, it returns allocation rejection information to the business subsystem to reject the storage resource allocation request of the business subsystem.
10. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the storage resource allocation method according to any one of claims 1 to 9 when executing the computer program.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the storage resource allocation method according to any one of claims 1 to 9.
12. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the storage resource allocation method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Communication management method and device based on RDMA, electronic device and storage medium
CN115776509A
Resource polling arbitration method and device, medium and computing equipment
CN116501506A