A method, apparatus, device and medium for system resource configuration

By using resource proxy management and resource group flipping, the problem of multi-threaded contention for shared resources in multi-core processors is solved, achieving efficient, flexible, and balanced use of system resources, and improving system performance and storage efficiency.

CN115658174BActive Publication Date: 2026-01-23SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211375152.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2026-01-23
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

In multi-core processor systems, the contention of shared resources by multiple threads leads to a decrease in system performance and storage efficiency. Existing resource scheduling methods consume kernel computing power and are difficult to guarantee in real time.

Method used

By using resource proxy management and resource group flipping, the system can achieve flexible scheduling and balanced use of resources. By adopting resource proxy pre-allocation and resource recycling channel group flipping, the disorderly competition among resource applicants and the receiving pressure on the recycling channel can be reduced.

Benefits of technology

It improves the efficiency and bandwidth of system resources, reduces the time and hardware logic overhead of resource pool initialization, and realizes flexible distribution and balanced access of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658174B_ABST
    Figure CN115658174B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer, and proposes a kind of system resource configuration method, device, equipment and medium.The method comprises: the resource pool is initialized and the resource proxy is allocated for the resource of the resource pool, and the pre-allocation resource corresponding to each resource proxy is obtained;Judge whether the pre-allocation resource number of the resource proxy corresponding to resource applicant satisfies the required resource number of the resource applicant, and feed back the corresponding application result to the resource applicant according to the judgment result;Set resource recycling channel to receive and allocate the resource to be recycled to the corresponding resource proxy for recycling by the way of resource group flip.This method disclosed in the present application realizes the pre-allocation of resource through resource proxy when using resource, reduces the disordered competition of resource applicant to resource;When recycling resource, the operation of resource group flip in resource recycling channel is used, and the receiving pressure of first-in first-out queue of recycling channel is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular to a system resource configuration method, device, equipment and medium. BACKGROUND

[0002] With the increasing complexity of chip design, more and more modules are integrated in the chip, which may initiate access operations on the public resources inside the chip, such as access to shared memory, which causes the problem of multi-device resource competition. For multi-core processors on chip, as the number of processor cores increases, multi-threading competes more fiercely for limited shared resources in the system, and thus has a more obvious impact on system performance.

[0003] In the prior art, the method for allocating and scheduling limited shared resources among multi-threads generally adopts the way of master core to execute scheduling algorithm to allocate shared resources among multi-threads. This way not only consumes on-chip core computing resources, but also is difficult to guarantee real-time performance in the resource scheduling process, thus causing problems such as low work efficiency and system storage fragmentation, which greatly affects system performance and storage efficiency. SUMMARY

[0004] Therefore, the present application provides a system resource configuration method, device, equipment and medium, wherein the system resource configuration method provided by the present application controls the dispatching, use and recycling of system resources, uniformly schedules the internal resources of the system, and coordinates the use strategy of the public resources by the resource applicants. In a typical scenario, the value of the resource is statically mapped to different resource areas of the system by defining or assigning the value of the resource, and the number of resource agents corresponding to different resource applicants is limited to achieve flexibility and efficiency of system resource use. The resource agent in the present application is an intermediate agent responsible for managing part or all of the key information of the resource, and the resource applicant and consumer can apply for resource information from the resource agent or return the resource information to the resource agent. By configuring the number of resources managed by the resource agent, the use amount of resources by different resource applicants and consumers can be effectively controlled and balanced. The resource group flip in the present application is a flip behavior of the recycling resource group, and the recycling resource group is a group formed by recycling resource keys. The flip is to allocate multiple keys in the recycling resource group to multiple recycling channels corresponding to the number of keys according to the order of use of the recycling channel to recycle. According to the resource group flip, the utilization rate of the recycling channel can be improved, and more time can be obtained for each recycling channel to process recycling events.

[0005] Based on the above purpose, one aspect of an embodiment of the present application provides a method for system resource configuration, comprising the following steps: initializing a resource pool and allocating resource agents to resources of the resource pool to obtain pre-allocated resources corresponding to each resource agent; judging whether the pre-allocated resource number of the resource agent corresponding to a resource applicant meets the required resource number of the resource applicant, and feeding back the corresponding application result to the resource applicant according to the judgment result; and setting a resource recycling channel to realize receiving and allocating the to-be-recycled resources to the corresponding resource agent for recycling through resource group flipping.

[0006] In some embodiments, the method further comprises: setting an agent request arbitration logic according to the application request or recycling request of resources by different resource agents, arbitrating the application request and / or recycling request through the agent request arbitration logic and sending the arbitration result to the resource pool to complete the application request or recycling request of resources by different resource agents.

[0007] In some embodiments, the step of initializing the resource pool and allocating resource agents to resources of the resource pool to obtain pre-allocated resources corresponding to each resource agent comprises: setting the resources of the resource pool through the data structure of a ring buffer and configuring the registers associated with the resource pool to set the initialization of the resource pool; allocating resource agents to the resources of the resource pool, setting the maximum allocatable resource number of each resource agent according to the initialization of the resource pool to obtain the pre-allocated resources corresponding to each resource agent.

[0008] In some embodiments, the step of setting the resources of the resource pool through the data structure of a ring buffer and configuring the registers associated with the resource pool to set the initialization of the resource pool comprises: setting the effective range of the resources of the resource pool through the configuration of the registers associated with the resource pool; and realizing the selection of an automatic initialization mode or a configuration initialization mode for the resource pool through the configuration of the registers associated with the resource pool.

[0009] In some embodiments, the step of judging whether the pre-allocated resource number of the resource agent corresponding to a resource applicant meets the required resource number of the resource applicant, and feeding back the corresponding application result to the resource applicant according to the judgment result comprises: in response to the pre-allocated resource number of the resource agent corresponding to a resource applicant meeting the required resource number of the resource applicant, applying the required resource number to the resource pool through the resource agent corresponding to the resource applicant, and returning the value and a valid flag of the applied required resource number to the resource applicant; and in response to the resource applicant judging that the valid flag is valid, the resource applicant initiates access to system resources according to the value of the applied required resource number.

[0010] In some embodiments, the judging whether the pre-allocated resource number of the resource agent corresponding to the resource applicant meets the required resource number of the resource applicant comprises: in response to the pre-allocated resource number of the resource agent corresponding to the resource applicant not meeting the required resource number of the resource applicant, the resource agent corresponding to the resource applicant does not apply for the required resource number from the resource pool, and returns an invalid flag to the resource applicant.

[0011] In some embodiments, the setting the resource recycling channel to receive and allocate the to-be-recycled resource to the corresponding resource agent for recycling through resource group flipping comprises: setting a flipping register in the resource recycling channel, and in response to the flipping register being valid, the resource recycling channel writes the received to-be-recycled resource into a first-in-first-out queue after reversing, so as to reduce the receiving pressure of the first-in-first-out queue of the resource recycling channel.

[0012] Another aspect of the embodiment of the present application also provides a device for system resource configuration, the device comprising: a first module configured to initialize a resource pool and allocate resource agents to resources of the resource pool, to obtain pre-allocated resources corresponding to each resource agent; a second module configured to judge whether the pre-allocated resource number of the resource agent corresponding to the resource applicant meets the required resource number of the resource applicant, and feed back the corresponding application result to the resource applicant according to the judgment result; and a third module configured to set a resource recycling channel to receive and allocate the to-be-recycled resource to the corresponding resource agent for recycling through resource group flipping.

[0013] Another aspect of the embodiment of the present application also provides a computer device, comprising at least one processor, and a memory storing computer instructions executable on the processor, the instructions being executed by the processor to implement the steps of any of the above methods.

[0014] Another aspect of the embodiment of the present application also provides a computer readable storage medium storing a computer program which is executed by a processor to implement the steps of any of the above methods.

[0015] The application has at least the following beneficial effects: the application provides a system resource configuration method, device, equipment and medium, wherein the application provides a system resource configuration method, which balances system resource application and resource recycling operation through resource pool initialization, resource pool control, resource agent and resource recycling. In resource use, the pre-allocation of resources is realized through the resource agent, reducing the disordered competition of resource applicants for resources; in resource recycling, the operation of resource group flipping in the resource recycling channel is adopted to reduce the receiving pressure of the first-in-first-out queue of the recycling channel. In resource pool initialization, two design modes of automatic initialization and configuration initialization are proposed, when the resource pool adopts the automatic initialization mode, the time and hardware logic overhead of resource pool initialization can be effectively reduced, and the balanced use of system resources is realized; when the resource pool adopts the configuration initialization mode, flexible resource distribution can be realized. Through multiple resource agents, concurrent access to the resource pool is realized, not only increasing the access bandwidth of the resource pool, but also limiting the access quantity of the resource applicants to the system resources, so that the system resources are used under the expected register configuration. Through the operation of resource group flipping, the resource recycling channel reduces the receiving pressure of the first-in-first-out queue of the recycling channel. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other embodiments can be obtained from these drawings without creative labor.

[0017] Figure 1 An embodiment of a system resource configuration method provided by the application is shown in the schematic diagram;

[0018] Figure 2 The structure schematic diagram of the resource pool provided by the application is shown in the schematic diagram;

[0019] Figure 3 The structure schematic diagram of the resource pool control unit provided by the application is shown in the schematic diagram;

[0020] Figure 4 The structure schematic diagram of the resource agent provided by the application is shown in the schematic diagram;

[0021] Figure 5 The schematic diagram of forward and reverse write-back in resource recycling provided by the application is shown in the schematic diagram;

[0022] Figure 6 The flowchart of the interaction of the system resource configuration method provided by the application is shown in the schematic diagram;

[0023] Figure 7A schematic diagram of an embodiment of a device for system resource configuration provided by the present application is shown.

[0024] Figure 8 A schematic diagram of an embodiment of a computer device provided by the present application is shown.

[0025] Figure 9 A schematic diagram of an embodiment of a computer readable storage medium provided by the present application is shown. DETAILED DESCRIPTION

[0026] Embodiments of the present application are described below. It should be understood, however, that the disclosed embodiments are merely examples, and that other embodiments can take various alternative forms.

[0027] In addition, it should be noted that all the expressions of "first" and "second" in the embodiments of the present application are used to distinguish two same-named different entities or different parameters. It can be seen that "first" and "second" are only for the convenience of description, and should not be understood as a limitation on the embodiments of the present application. The subsequent embodiments will not be described one by one. The terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device containing a series of elements not only includes those elements, but also includes elements not explicitly listed or inherent to these processes, methods, articles or devices.

[0028] One or more embodiments of the present application will be described below with reference to the accompanying drawings.

[0029] Based on the above purpose, in a first aspect of the embodiments of the present application, an embodiment of a method for system resource configuration is provided. Figure 1 A schematic diagram of an embodiment of a method for system resource configuration provided by the present application is shown. As shown in Figure 1 The method for system resource configuration of the embodiments of the present application includes the following steps:

[0030] S101, initializing a resource pool and allocating resource agents to the resources of the resource pool to obtain pre-allocated resources corresponding to each resource agent;

[0031] S102, judging whether the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the required resource number of the resource applicant, and feeding back the corresponding application result to the resource applicant according to the judgment result;

[0032] S103, setting a resource recycling channel to receive and allocate the to-be-recycled resources to the corresponding resource agents for recycling by means of resource group flipping.

[0033] According to several embodiments of the present invention, the method provided in this application further includes: setting up agent request arbitration logic based on different resource agents' application requests or recycling requests for resources, arbitrating the application requests and / or recycling requests through the agent request arbitration logic, and sending the arbitration result to the resource pool, so as to complete the different resource agents' application requests or recycling requests for resources.

[0034] According to several embodiments of the present invention, initializing a resource pool and allocating resource agents to the resources of the resource pool to obtain pre-allocated resources corresponding to each resource agent includes: setting the resources of the resource pool through a circular buffer data structure and configuring the registers associated with the resource pool to set the initialization of the resource pool; allocating resource agents to the resources of the resource pool, setting the maximum number of allocatable resources for each resource agent according to the initialization of the resource pool, and obtaining the pre-allocated resources corresponding to each resource agent.

[0035] According to several embodiments of the present invention, setting the resources of a resource pool through a circular buffer data structure and configuring the registers associated with the resource pool to set the initialization of the resource pool includes: setting the effective range of the resources of the resource pool by configuring the registers associated with the resource pool; and configuring the registers associated with the resource pool to select an automatic initialization mode or a configuration initialization mode for the resource pool.

[0036] According to several embodiments of the present invention, determining whether the pre-allocated resource number of the resource agent corresponding to the resource applicant meets the resource applicant's required resource number, and feeding back the corresponding application result to the resource applicant based on the determination result includes: in response to the resource agent corresponding to the resource applicant meeting the resource applicant's required resource number, applying for the required resource number from the resource pool through the resource agent corresponding to the resource applicant, and returning the value of the requested required resource number and a validity flag to the resource applicant; in response to the resource applicant determining that the validity flag is valid, the resource applicant initiates access to system resources based on the value of the requested required resource number.

[0037] According to several embodiments of the present invention, determining whether the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the number of resources required by the resource applicant, and feeding back the corresponding application result to the resource applicant based on the determination result includes: in response to the fact that the number of pre-allocated resources of the resource agent corresponding to the resource applicant does not meet the number of resources required by the resource applicant, the resource agent corresponding to the resource applicant does not apply for the required number of resources from the resource pool, and returns an invalid flag to the resource applicant.

[0038] According to several embodiments of the present invention, setting up a resource recycling channel to receive and allocate resources to be recycled to the corresponding resource agent for recycling by means of resource group flipping includes: setting a flip register in the resource recycling channel; in response to the flip register being valid, the resource recycling channel reverses the received resources to be recycled and writes them into a first-in-first-out queue, so as to reduce the receiving pressure of the first-in-first-out queue of the resource recycling channel.

[0039] The system resource configuration method proposed in this invention specifies the initial HP and TP positions and the resource pool initialization content through register configuration during resource pool initialization; reduces disordered competition for resources by resource applicants through key resource pre-allocation by resource proxy; and reduces the receiving pressure of the recycling channel FIFO by key group flipping operation in the resource recycling channel.

[0040] The following provides specific steps of another embodiment of a system resource allocation method based on the present invention.

[0041] Figure 2 A schematic diagram of the resource pool structure provided by the present invention is shown, as follows: Figure 2 As shown, a resource pool is constructed using a Ring Buffer. The resource pool stores the key information of resources. Only when a resource requester obtains the key information can they operate on the resource. A Ring Buffer is a data structure used to represent a fixed-size, contiguous circular buffer, containing storage space, a head pointer (HP), a tail pointer (TP), and their change logic. During resource pool initialization, HP = TP = InitialAddr, where InitialAddr is the initialization register configuration value. When a key (resource) is read from storage space and dispatched, HP = HP + 1. When a key is written to storage space and reclaimed, TP = TP + 1. When HP or TP reaches the maximum storage space value, HP = 0 or TP = 0 when another key is dispatched or reclaimed. An invalid key indicates a key that has been dispatched, and the resource user is using the resource corresponding to that key and has not yet returned it to the resource pool; a valid key indicates a key that has not yet been dispatched, and the resource corresponding to that key is in a pending state.

[0042] By establishing such Figure 3The resource pool control unit shown determines the valid scope of resource information within the resource pool and the initialization method of the resource pool. The valid scope of resource information within the resource pool is determined by the MaxKeyNum register, which includes the usage range of storage space and the maximum values ​​of HP and TP, where HP ≦ MaxKeyNum and TP ≦ MaxKeyNum. The initialization method of the resource pool is determined by the InitForm register. In this embodiment, two initialization modes are supported: automatic initialization mode and configuration initialization mode. In automatic initialization mode, after system startup, the memory address (which can be converted to a resource address through static mapping, generally referring to "adding to the resource base address") is dispatched as the key value of HP. When HP exceeds the memory boundary and rolls back, the value is read from the memory again as the key value for dispatch. In configuration initialization mode, after system startup, the value inside the memory needs to be configured before it can be dispatched as the key value.

[0043] By establishing such Figure 4The resource agent shown limits the number of system resources that resource applicants can access. The maximum number of keys that the current resource agent can allocate is determined by the AgentMaxKeyNum register, whose value is configured during system initialization. The resource agent obtains key information from the resource recycling channel and writes it to the resource pool. When there are enough resources, the resource agent requests keys from the resource pool and prepares them for resource applicants; when there are insufficient resources, the resource agent returns invalid key information after a resource applicant requests key information. When the agent dispatches a key, the register value is decremented by 1; when the agent recycles a key, the register value is incremented by 1. An error is reported when the register value is greater than the initial configuration value or less than 0. When the AgentMaxKeyNum register value is sufficient and the local cache pointer is less than the "key pre-read write boundary," the resource agent pre-requests one or more key values ​​from the resource pool and places them in the local cache. The "key pre-read write boundary" can be a constant value or a register configuration value. When a resource applicant requests a key through a register read operation, the key value and a valid flag are returned directly, indicating that the returned key value is valid. When the AgentMaxKeyNum register value is insufficient, the resource agent cannot or will no longer request a key value from the resource pool in advance. When a resource requester requests a key through a register read operation, it can directly return the key value and an invalid flag, indicating that the resource request failed and the returned key value is invalid. When returning the key value, the current agent's ID information, i.e., AgentID, needs to be included. When the resource agent receives a request to reclaim a key, it first checks whether the local cache pointer is less than the "key reclamation write boundary." If it is less, it directly writes the key value to the local cache; otherwise, it requests to write the key value back to the resource pool. The "key reclamation write boundary" can be a constant value or a register configuration value.

[0044] Arbitration logic is configured to receive request and eviction requests for keys from different resource proxies. Request requests can be arbitrated using Round Rubin (RR) and / or Weight Rubin (WR); eviction requests can be arbitrated using RR.

[0045] A resource recycling channel is set up to receive key recycling requests from resource recyclers and key recycling requests from resource applicants. Within the resource recycling channel, resources to be recycled are received and allocated to corresponding resource agents for recycling through resource group flipping. In this embodiment, resource group flipping is implemented by setting a key group flipping register, i.e., a RevKeyGroup register, within the resource recycling channel. Figure 5 The diagram illustrates the forward and reverse write-back during resource recycling. When the recycler writes multiple keys into the resource recycling channel in groups and the RevKeyGroup register is valid, the channel FIFO will reverse the key group and write it back to the channel FIFO after each key group is received. This reduces the receiving pressure on the recycling channel FIFO.

[0046] The internal resource pool, the Ring Buffer, can be stored using on-chip storage resources such as SRAM and registers, with unlimited storage width. Therefore, a single allocation or reclamation can involve one or more key resources. One or more resource brokers can be used, and each broker can dispatch or reclaim one or more resources per transaction. Broker request arbitration logic can be implemented through custom logic or via a bus. The resources written to the reclamation channel by the resource reclaimer can be a group of keys or a single key.

[0047] This invention proposes a system resource configuration method that balances resource pool initialization, resource pool control, resource proxying, and resource reclamation operations, thereby balancing system resource request and reclamation. In the initial state of the resource pool, initial HP and TP values ​​are configured via registers. When the resource pool adopts automatic initialization mode, balanced use of system resources can be achieved. During resource pool initialization, two design modes are proposed: automatic initialization and configuration initialization. When system resource keys are consecutive, automatic initialization effectively reduces the initialization time and hardware logic overhead. When the system expects flexible distribution of resource keys, configuration initialization provides support for this operation. Concurrent access to the resource pool is achieved through multiple resource proxies. This method not only increases the resource pool access bandwidth but also limits the number of system resources accessed by resource requesters through proxying, ensuring that system resources are used under the expected register configuration. The resource reclamation channel reduces the receiving pressure of the FIFO through key group flipping.

[0048] The following is a schematic diagram illustrating the interactive process of a system resource configuration method based on the present invention. For example... Figure 6 As shown, the steps for interaction using the system resource configuration method proposed in this invention include:

[0049] S1: Key value pre-reading. After the resource pool completes the initial state operation, the resource agent that is allocated the resource will pre-read the key value from the resource pool for use in subsequent resource requests.

[0050] S2: Resource Request. When a resource requester has a need to use resources, they submit a request to the corresponding resource agent.

[0051] S3: Returns the key value. The resource agent returns the key value and the corresponding valid flag to the resource requester.

[0052] S4: Key value matching. The resource applicant confirms the validity by marking it as valid. The applicant then uses this key value to initiate access to the system resource set. When the system resource is storage space, the key value is generally the memory address.

[0053] S5: Resource usage, where the resource applicant uses the system resources they have applied for to complete the current task.

[0054] S6: Key value recycling request. After completing the current task, the resource applicant sends the key value back to the resource recycling channel to release the right to operate on the resource.

[0055] S7: Key value write-back. The recycling channel returns the key value to the corresponding agent based on the agent ID in the recycling information.

[0056] S8: Key value recycling, the agent writes the key value back to the resource pool.

[0057] By interacting with the system resource configuration method proposed in this invention, resource pre-allocation can be achieved through resource proxy during resource use, reducing disorderly competition for resources among resource applicants; during resource reclamation, key group flipping operation within the resource reclamation channel is used to reduce the receiving pressure of the FIFO in the reclamation channel.

[0058] A second aspect of the present invention provides an apparatus for system resource allocation. Figure 7 The diagram shown is a schematic representation of an embodiment of a system resource configuration apparatus provided by the present invention. Figure 7 As shown, the device for system resource configuration provided by the present invention includes: a first module 011, configured to initialize a resource pool and allocate resource agents to the resources in the resource pool, thereby obtaining pre-allocated resources corresponding to each resource agent; a second module 012, configured to determine whether the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the resource applicant's required resource number, and to provide feedback on the corresponding application result to the resource applicant based on the determination result; and a third module 013, configured to set up a resource recycling channel to receive and allocate resources to be recycled to the corresponding resource agent for recycling through resource group flipping.

[0059] To achieve the above objectives, a third aspect of the present invention provides a computer device. Figure 8 The diagram shown is a schematic representation of an embodiment of a computer device provided by the present invention. Figure 8 As shown, an embodiment of a computer device provided by the present invention includes the following modules: at least one processor 021; and a memory 022, the memory 022 storing computer instructions 023 that can be executed on the processor 021, the computer instructions 023 implementing the steps of the method described above when executed by the processor 021.

[0060] The present invention also provides a computer-readable storage medium. Figure 9 The diagram shown is a schematic representation of an embodiment of a computer-readable storage medium provided by the present invention. Figure 9 As shown, computer-readable storage medium 031 stores a computer program 032 that, when executed by a processor, performs the methods described above. The methods executed by computer program 032 include: initializing a resource pool and allocating resource agents to the resources in the resource pool, obtaining pre-allocated resources corresponding to each resource agent; determining whether the number of pre-allocated resources for the resource agent corresponding to a resource applicant meets the resource applicant's required resource quantity, and providing feedback on the application result to the resource applicant based on the determination result; and setting up a resource recycling channel to receive and allocate resources to be recycled to the corresponding resource agent for recycling through resource group flipping.

[0061] In some embodiments, the method further includes: setting up proxy request arbitration logic based on different resource agents' resource application requests or recycling requests, arbitrating the application requests and / or recycling requests through the proxy request arbitration logic, and sending the arbitration result to the resource pool to complete the different resource agents' resource application requests or recycling requests.

[0062] In some embodiments, initializing the resource pool and allocating resource agents to the resources of the resource pool to obtain pre-allocated resources corresponding to each resource agent includes: setting the resources of the resource pool through a circular buffer data structure and configuring the registers associated with the resource pool to set the initialization of the resource pool; allocating resource agents to the resources of the resource pool, setting the maximum number of allocatable resources for each resource agent according to the initialization of the resource pool, and obtaining the pre-allocated resources corresponding to each resource agent.

[0063] In some embodiments, setting the resources of the resource pool through a circular buffer data structure and configuring the registers associated with the resource pool to set the initialization of the resource pool includes: setting the effective range of the resources of the resource pool by configuring the registers associated with the resource pool; and configuring the registers associated with the resource pool to select an automatic initialization mode or a configuration initialization mode for the resource pool.

[0064] In some embodiments, determining whether the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the number of resources required by the resource applicant, and feeding back the corresponding application result to the resource applicant based on the determination result includes: in response to the fact that the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the number of resources required by the resource applicant, applying for the required number of resources from the resource pool through the resource agent corresponding to the resource applicant, and returning the value of the requested number of resources and a validity flag to the resource applicant; in response to the resource applicant determining that the validity flag is valid, the resource applicant initiates access to system resources based on the value of the requested number of resources.

[0065] In some embodiments, determining whether the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the number of resources required by the resource applicant, and feeding back the corresponding application result to the resource applicant based on the determination result includes: in response to the fact that the number of pre-allocated resources of the resource agent corresponding to the resource applicant does not meet the number of resources required by the resource applicant, the resource agent corresponding to the resource applicant does not apply for the required number of resources from the resource pool, and returns an invalid flag to the resource applicant.

[0066] In some embodiments, the method of setting up a resource recycling channel to receive and allocate resources to be recycled to the corresponding resource agent for recycling by resource group flipping includes: setting a flip register in the resource recycling channel; in response to the flip register being valid, the resource recycling channel reverses the received resources to be recycled and writes them into a first-in-first-out queue to reduce the receiving pressure on the first-in-first-out queue of the resource recycling channel.

[0067] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program for setting system parameters can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium for the program can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The above computer program embodiments can achieve the same or similar effects as any of the corresponding foregoing method embodiments.

[0068] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0069] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.

[0070] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.

[0071] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0072] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.

[0073] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.

[0074] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0075] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0076] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. A method for system resource allocation, characterized in that, include: The resource pool is initialized and resource agents are allocated to the resources in the resource pool to obtain the pre-allocated resources corresponding to each resource agent; Determine whether the number of pre-allocated resources for the resource agent corresponding to the resource applicant meets the resource applicant's required resource quantity, and provide feedback on the corresponding application result to the resource applicant based on the determination result; The resource recycling channel is configured to receive and allocate resources to corresponding resource agents for recycling by means of resource group flipping. This includes setting a flip register in the resource recycling channel. In response to the flip register being valid, the resource recycling channel reverses the received resources to be recycled and writes them into a first-in-first-out queue to reduce the receiving pressure on the first-in-first-out queue of the resource recycling channel.

2. The method according to claim 1, characterized in that, Also includes: Based on the different resource agents' requests for or requests to reclaim resources, an arbitration logic for agent requests is set up. The application requests and / or reclaim requests are arbitrated through the agent request arbitration logic, and the arbitration result is sent to the resource pool to complete the different resource agents' requests for or requests to reclaim resources.

3. The method according to claim 1, characterized in that, The process of initializing the resource pool and allocating resource proxies to the resources in the resource pool, resulting in pre-allocated resources for each resource proxy, includes: The resources of the resource pool are set using a circular buffer data structure, and the initialization of the resource pool is set by configuring the registers associated with the resource pool. Resource agents are assigned to the resource pool. Based on the initial settings of the resource pool, the maximum number of allocatable resources for each resource agent is determined, and the pre-allocated resources corresponding to each resource agent are obtained.

4. The method according to claim 3, characterized in that, The process of setting the resources of the resource pool through a circular buffer data structure and configuring the registers associated with the resource pool to initialize the resource pool includes: The effective range of resources in the resource pool is set by configuring the registers associated with the resource pool; By configuring the registers associated with the resource pool, the system can select between an automatic initialization mode and a configuration initialization mode for the resource pool.

5. The method according to claim 1, characterized in that, The process of determining whether the pre-allocated resource quantity of the resource agent corresponding to the resource applicant meets the resource applicant's required resource quantity, and feeding back the corresponding application result to the resource applicant based on the determination result, includes: In response to the resource requester's corresponding resource agent having a pre-allocated resource quantity that meets the resource requester's required resource quantity, the resource requester's corresponding resource agent requests the required resource quantity from the resource pool and returns the requested required resource quantity value and validity flag to the resource requester. In response to the resource requester determining that the validity flag is valid, the resource requester initiates access to system resources based on the requested required resource quantity value.

6. The method according to claim 1, characterized in that, The process of determining whether the pre-allocated resource quantity of the resource agent corresponding to the resource applicant meets the resource applicant's required resource quantity, and feeding back the corresponding application result to the resource applicant based on the determination result, includes: If the number of pre-allocated resources of the resource agent corresponding to the resource applicant does not meet the number of resources required by the resource applicant, the resource agent corresponding to the resource applicant will not apply for the required number of resources from the resource pool and will return an invalid flag to the resource applicant.

7. A device for system resource allocation, characterized in that, include: The first module configures the initialization of the resource pool and the allocation of resource agents to the resources of the resource pool, thereby obtaining the pre-allocated resources corresponding to each resource agent; The second module is configured to determine whether the number of pre-allocated resources of the resource agent corresponding to the resource applicant meets the number of resources required by the resource applicant, and to provide the corresponding application result to the resource applicant based on the determination result. The third module, configuration, is used to set up the resource recycling channel to receive and allocate the resources to be recycled to the corresponding resource agent for recycling through resource group flipping. The third module is also used to: set a flip register in the resource recycling channel; in response to the flip register being valid, the resource recycling channel reverses the received resources to be recycled and writes them into the first-in-first-out queue, so as to reduce the receiving pressure of the first-in-first-out queue of the resource recycling channel.

8. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Cluster resource management scheduling method and device, equipment and readable storage medium

    CN112948113A

  • First-in-first-out buffer and control method of first-in-first-out buffer

    CN114995780A