CN114610578B - Resource state management method and device, electronic equipment and storage medium - Google Patents
Resource state management method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114610578B CN114610578B CN202210263326.8A CN202210263326A CN114610578B CN 114610578 B CN114610578 B CN 114610578B CN 202210263326 A CN202210263326 A CN 202210263326A CN 114610578 B CN114610578 B CN 114610578B
- Authority
- CN
- China
- Prior art keywords
- resource
- state
- resources
- pipeline
- dormant
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000007726 management method Methods 0.000 title claims abstract description 66
- 238000003860 storage Methods 0.000 title claims abstract description 22
- 238000000034 method Methods 0.000 claims abstract description 50
- 230000007958 sleep Effects 0.000 claims abstract description 37
- 238000012544 monitoring process Methods 0.000 claims abstract description 11
- 230000005059 dormancy Effects 0.000 claims description 17
- 238000001514 detection method Methods 0.000 claims description 6
- 230000036541 health Effects 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 4
- 238000005265 energy consumption Methods 0.000 abstract description 10
- 230000008569 process Effects 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 4
- 230000006872 improvement Effects 0.000 description 4
- 238000013468 resource allocation Methods 0.000 description 4
- 238000009826 distribution Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000002618 waking effect Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 235000003642 hunger Nutrition 0.000 description 1
- 238000012821 model calculation Methods 0.000 description 1
- 230000037351 starvation Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4418—Suspend and resume; Hibernate and awake
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Power Sources (AREA)
Abstract
The application discloses a resource state management method, a device, electronic equipment and a storage medium. The method is applied to a resource management unit in an electronic device with at least one processor core, the resource management unit distributes resources of the electronic device to the processor core running the pipeline based on the resource requirement of the pipeline, and the state of the resources is controlled by monitoring the calling condition of the resources in a first time interval. For example, in the event that the resource is not invoked, the resource is controlled to switch from the awake state to the sleep state; when the wake-up condition is satisfied, the control resource is switched from the sleep state to the wake-up state. Therefore, on one hand, the resources of the electronic equipment can be managed and distributed based on the pipeline in a centralized way, and the utilization rate of the resources is improved; on the other hand, on the premise of meeting the execution requirement of the pipeline, the rest idle resources are enabled to enter a dormant state, and the resources in the dormant state are controlled to run in a low-energy mode, so that the energy consumption generated by the idle resources is greatly reduced.
Description
Technical Field
The present invention relates to the field of computer resource management, and in particular, to a method and apparatus for managing a resource status, an electronic device, and a storage medium.
Background
To further improve the performance and computing power, most electronic devices (e.g., electronic computers) employ at least one processor core and allocate resources within the electronic device with the processor core as a granularity. When the load of each processor core is uneven, some processor cores may not obtain enough resources to cause blockage; while the resources of other processor cores are idle, resulting in waste.
In addition, the resources of the electronic device generally generate energy consumption when being idle, and once a large amount of resources are idle for a long time, the resource utilization rate is reduced and the energy consumption is wasted.
Disclosure of Invention
The applicant creatively provides a resource state management method, a resource state management device, electronic equipment and a storage medium.
According to a first aspect of embodiments of the present application, there is provided a resource status management method applied to a resource management unit of an electronic device, the resource management unit allocating resources of the electronic device to a processor core executing a pipeline based on resource requirements of the pipeline, the method comprising: monitoring the resource calling condition of the electronic equipment in a first time interval; based on the resource call, the state of the resource is controlled, and the state of the resource comprises a dormant state or an awake state.
According to an embodiment of the present application, allocating resources of an electronic device to a processor core of an execution pipeline includes: resources of the electronic device in an awake state are allocated to processor cores of an execution pipeline.
According to an embodiment of the present application, controlling a state of a resource based on a call condition includes: if the resource is not called in the first time interval, the state of the control resource is switched from the awakening state to the dormant state; in response to meeting the wake condition, the state of the control resource is switched from the sleep state to the wake state.
According to an embodiment of the present application, the wake-up condition includes that a resource size of the wake-up state is smaller than a resource size required by the pipeline; accordingly, before the state of the control resource is switched from the sleep state to the awake state, the method further comprises: the size of the resources required by the pipeline and the size of the resources in the awake state are determined.
According to an embodiment of the present application, the wake-up condition includes that a duration of a sleep state of the resource reaches a set duration threshold; accordingly, after the state of the control resource is switched from the awake state to the sleep state, the method further includes: and starting a dormancy timer, wherein the dormancy timer is used for triggering the resource management unit to control the state of the resource to be switched from the dormancy state to the awakening state after the set time length threshold.
According to an embodiment of the present application, the wake-up condition includes detecting a failed resource, where the failed resource is a resource that is used due to a failure of the resource; accordingly, before the state of the control resource is switched from the sleep state to the awake state, the method further comprises: health detection is carried out on the resources of the electronic equipment to determine fault resources; accordingly, after the state of the control resource is switched from the sleep state to the awake state, the method further includes: the failed resource is replaced with a resource that switches to the awake state.
According to an embodiment of the present application, the method further comprises: establishing a dormant resource pool; adding a dormant state resource into the dormant resource pool, and/or removing the resource from the dormant resource pool after the state controlling the resource is switched from the dormant state to the awake state.
According to a second aspect of embodiments of the present application, there is provided a resource status management apparatus applied to a resource management unit of an electronic device, the resource management unit allocating resources of the electronic device to a processor core executing a pipeline based on resource requirements of the pipeline, the apparatus comprising: the resource calling condition monitoring module is used for monitoring the calling condition of the resource in the first time interval; the resource state control module is used for controlling the state of the resource based on the resource calling condition, wherein the state of the resource comprises a dormant state or an awakening state.
According to a third aspect of embodiments of the present application, there is provided an electronic device, including: a resource management unit and at least one processor core; the resource management unit is used for executing any one of the resource state management methods.
According to a fourth aspect of embodiments of the present application, there is provided a computer storage medium comprising a set of computer executable instructions for performing the above-described resource state management method when the instructions are executed.
The embodiment of the application provides a resource state management method, a device, an electronic device and a storage medium, wherein the method is applied to a resource management unit in the electronic device with at least one processor core, the resource management unit distributes resources of the electronic device to the processor core running a pipeline based on the resource requirement of the pipeline, and the state of the resources is controlled by monitoring the calling condition of the resources in a first time interval. For example, in the event that the resource is not invoked, the resource is controlled to switch from the awake state to the sleep state; when the wake-up condition is satisfied, the control resource is switched from the sleep state to the wake-up state. Therefore, on one hand, the resources of the electronic equipment can be managed and distributed based on the pipeline in a centralized way, and the utilization rate of the resources is improved; on the other hand, on the premise of meeting the execution requirement of the pipeline, the rest idle resources are enabled to enter a dormant state, and the resources in the dormant state are controlled to run in a low-energy mode, so that the energy consumption generated by the idle resources is greatly reduced.
It should be understood that the implementation of the present application does not need to achieve all the above-mentioned advantages, but rather a specific technical solution may achieve a specific technical effect, and other embodiments of the present application may also achieve the above-mentioned advantages.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings, in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
FIG. 1 is a schematic flow chart of a pipeline on which resources are allocated according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a method for implementing resource status management according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating a method for controlling a resource state to be switched from a sleep state to an awake state according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a method for controlling a resource state to be switched from a sleep state to an awake state according to another embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a method for managing resources in a dormant state by a dormant resource pool according to another embodiment of the present application;
FIG. 6 is a schematic diagram of a configuration of a resource status management device according to an embodiment of the present application;
fig. 7 is a schematic diagram of a composition structure of an electronic device to which the resource status management method according to the embodiment of the present application is applied.
Detailed Description
In order to make the objects, features and advantages of the present application more obvious and understandable, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Before further describing embodiments of the present application in detail, the terms and expressions that are referred to in the embodiments of the present application are described, and are suitable for the following explanation.
A processor core: is the core-most portion of the processor interior and may also be referred to as a processor core.
A processor: including one or more processor cores, as well as memory and other components or devices.
And (3) pipeline: the method is an implementation technology for executing a plurality of instructions in an overlapped manner, each step in a pipeline completes a part of the instructions, each step is called a pipeline stage or a pipeline section, and the pipeline stages are connected front and back to form a pipeline; instructions enter at one end of the pipeline and exit at the other end of the pipeline through the pipeline stages; one for each pipeline.
For the processing flow of an instruction in a pipeline, as shown in fig. 1, the life cycle of an instruction in a pipeline includes: fetch, decode, execute, access, and write back. Instruction fetching refers to a process of reading an instruction from a memory. Instruction decoding refers to a process of translating an instruction fetched from a memory, and obtains an operand Register index required by the instruction after decoding, and the operand can be read from a general Register File by using the index. The type of computation required after instruction decoding is known and the required operands have been read from the general purpose register set, then instruction execution follows (Instruction Execute). Instruction execution refers to the flow of real operations on instructions. For example, if the instruction is an add instruction, then the operands are added; in the case of a subtraction instruction, the operands are subtracted. The most common component in the "execute" stage is the ALU, which is a hardware functional unit that performs specific operations. Memory access refers to the process of a memory access instruction reading data from memory or writing data to memory. The write-back refers to the process of writing the result of instruction execution back to the general register set, and if the result value is a common operation instruction, the result value is from the result of 'execution' stage calculation; in the case of a memory read instruction, the result is from data read from memory during the "memory access" phase.
An electronic device refers to an electronic device having a processor and employing at least one processor core in the processor.
The resources of the electronic device refer to resources that may be allocated to the processor cores for executing the various pipeline stages of the pipeline. For example: the resources allocated to the processor cores may be branch prediction resources, instruction fetch resources, decode resources, rename resources, execution resources, and the like; wherein the execution resources may include at least one or more of an operation resource, a register resource, and a memory resource. The memory resource may include a buffer and a memory, and the buffer may include at least one or more of an L1 buffer, an L2 buffer, and an L3 buffer. The memory may be any type of memory such as flash memory. The decoding resources may include at least one decoder. The rename resource may include at least one register.
The resource management unit refers to a unit set in the electronic device for unified management of resources of the electronic device. In the embodiment of the present application, the resource management unit discards an allocation policy that a fixed resource is allocated to each processor core and the resources of each processor core are isolated from each other and cannot be shared, but performs unified management on the resources of the electronic device, and allocates the resources of the electronic device to the processor core executing the pipeline based on the resource requirement of the pipeline. Therefore, more resources can be obtained by the processor cores with large loads, and fewer resources can be obtained by the processor cores with small loads, so that the distribution of the resources among the processor cores is more reasonable and balanced, the utilization rate of the resources is greatly improved, and the problem of asymmetrical resource distribution and processing core loads is avoided.
Moreover, the resources of the electronic device are uniformly managed by the resource management unit, and all idle resources can be centralized for being distributed to the processor cores of the execution pipeline. Thus, the method is easier to meet the requirement of complex pipelines or high-strength pipelines with larger resource requirement on resources, and the processing capacity and the computing performance of the electronic equipment can be further improved.
In addition, the resource management unit can uniformly manage the resources of the electronic equipment, and can further divide the allocable resources in the electronic equipment into the resources in the wake-up state and the resources in the sleep state, and the resources in the sleep state are operated in a low-energy consumption mode, so that the energy consumption of the whole plurality of electronic equipment is reduced.
In particular, the above advantages are emphasized when the electronic device is a multi-core electronic device having at least two processor cores.
Based on the above inventive concept, the embodiment of the present application provides a resource status management method, which is applied to a resource management unit of the above electronic device, and fig. 2 shows a main flow of implementing the resource status management method according to an embodiment of the present application, as shown in fig. 2, and the method includes:
operation S210, monitoring the resource calling condition of the electronic equipment in a first time interval;
wherein the first time interval is preset, for example, 1 minute, 5 minutes, 10 minutes, or the like. Theoretically, too short a first time interval can cause frequent switching of the state of the resource between the awake state and the sleep state, and increase the monitoring cost; the first time interval is too long, so that the resource can be put into a dormant state after being idle for a long time, and the energy consumption cannot be repeatedly saved.
Therefore, a preferred first time interval can be determined according to multiple experimental effects or model calculations.
The resource calling condition refers to the condition of whether the resource of the electronic equipment is called in a first time interval.
The resource management unit can monitor the resource calling condition of the electronic equipment in the first time interval in various modes.
For example, at the beginning time of the first time interval, creating a blank resource call table or clearing the original resource call table; in the process of allocating resources to processor cores of an execution pipeline, recording the allocated resources in the resource call table; and when the first time interval is finished, checking the resource calling table, wherein the resources recorded in the resource calling table are called resources, and the unrecorded resources are unrecorded resources.
Or, in the original resource management items, setting a flag bit for each resource item, and resetting the flag bit to a value representing 'non-calling' when a first time interval starts; when the resource is called, the flag bit is set to a value representing "called"; and when the first time interval is finished, checking the flag bit of each resource item to obtain whether the resource is called.
In the implementation of the present application, each resource does not refer to a single resource in a knight sense, but may refer to a minimum resource unit available for allocation according to a resource allocation policy. These minimum resource units available for allocation may comprise a single resource or may comprise multiple resources.
For example, the resource management unit divides the branch prediction resources into one or more branch prediction sub-resource pools based on a resource allocation policy, each branch prediction sub-resource pool comprising resources of the same or different size. Wherein each branch predictor resource pool is an allocatable resource unit.
In operation S220, the state of the resource is controlled based on the resource call condition, and the state of the resource includes a sleep state or an awake state.
Typically, the default state of the resources of the electronic device is the awake state. If the resource is called in the first time interval, keeping the resource in a wake-up state; and if the resource is not called, controlling the state of the resource to be switched from the awakening state to the dormant state.
When the state of the resource is switched to the dormant state, the resource can be controlled to run in a low-energy consumption mode, so that the energy consumption of the whole electronic equipment is further saved.
For some resources that may lose some of their performance or functionality after running in a low power manner, if they are allocated to a processor core for an execution pipeline, the performance of that processor core may be affected.
To this end, in most embodiments of the present application, only the resources of the awake state will be allocated to the processor cores executing the pipeline; while the dormant state resources are not used for the execution pipeline.
Therefore, the processing range of resource allocation can be further reduced, the calculation load of a resource management unit is reduced, and the management efficiency of resources is improved.
After the state of the resource is switched to the dormant state, the resource in the dormant state can be awakened when the awakening condition is met, the state of the resource is controlled to be switched from the dormant state to the awakened state, and the performance core function is restored.
In an embodiment of the present application, the wake-up condition includes that a size of a resource in a wake-up state is smaller than a size of a resource required by a pipeline, and a flow of waking up a resource in a sleep state is shown in fig. 3, and includes;
operation S310, determining the resource size required by the pipeline and the resource size of the wake-up state;
the amount of resources required by the pipeline may be determined by estimating the amount of resources, such as the amount of data processed by the pipeline, the type of operation, and the execution cycle.
When the pipeline requires multiple resources, then the size of each resource required by the pipeline, and the size of the resources in each resource available for allocation to the wakeup state, needs to be determined.
The resource size of each awake state may be determined by counting the resource sizes of each resource for which the allocated state is awake.
For example, the resource management unit creates a resource pool for each resource, respectively, for storing the resources of the awake state available for allocation. The instruction fetching resource pool is used for storing instruction fetching resources in an awakening state which can be used for distribution; the decoding resource pool is used for storing decoding resources in an allocated awakening state; the operation resource pool is used for storing operation resources in an allocated awakening state; the storage resource pool is used to store storage resources and the like that are available for allocated wakeup states.
When the current pipeline needs to fetch the resources, the decoding resources, the operation resources and the storage resources, the resource size of the fetch resource pool, the resource size of the decoding resource pool, the resource size of the operation resources and the resource size of the storage resources are respectively counted to determine the resource size of each resource in which the state available for allocation is the wake-up state.
Operation S320, determining whether the size of the resources required by the pipeline is smaller than the size of the resources in the awake state, if not, continuing operation S330, if yes, continuing operation S340;
when the pipeline requires multiple resources, it is necessary to determine that the size of each resource required is smaller than the size of the resources in the awake state available for allocation in each resource.
Operation S330, acquiring the resource in the sleep state, and controlling the state of the resource in the sleep state to switch from the sleep state to the awake state;
alternatively, resources in all sleep states may be acquired; the dormant state resources of the required size may also be obtained.
In operation S340, the corresponding resources in the awake state are obtained according to the size of the resources required by the pipeline, and the obtained resources in the awake state are allocated to the processor cores executing the pipeline.
In the implementation of the present application shown in fig. 3, the resources in the sleep state are only woken up if the resources in the wake-up state are not sufficient. In this way, the idle resources can be kept in the dormant state as long as possible, so that the energy consumption of the electronic equipment is reduced as far as possible.
In another embodiment of the present application, the wake-up condition includes that a duration of a sleep state of the resource reaches a set duration threshold; accordingly, after the state of the control resource is switched from the awake state to the sleep state, the method further includes: and starting a dormancy timer, wherein the dormancy timer is used for triggering the resource management unit to control the state of the resource to be switched from the dormancy state to the awakening state after the set time length threshold.
The set time threshold can be flexibly determined according to implementation requirements or implementation effects.
The judgment of the wake-up condition can be simplified through the set time threshold, and the resource size of the existing wake-up state is not required to be known; moreover, through the set time threshold, the resources can be alternately in the sleep state and the core wake state, so that the use frequency of each resource is balanced, and the phenomenon that the service life is shortened due to overload work because individual resources are always in the wake state is avoided.
In order to save starting the dormancy timer, the resource which is not called in the first time interval can be used as a batch of resources, so that the same batch of resources share one dormancy timer.
In another embodiment of the present application, the wake-up condition includes detecting a failed resource, where the failed resource is a resource that is used due to a failure of the resource, and as shown in fig. 4, a process of waking up a resource in a sleep state includes:
operation S410, obtaining a resource from the resources of the electronic device;
the resources acquired here may be used resources or may be resources in an allocable awake state.
Operation S420, health detection is carried out on the resource;
operation S430, determining whether the resource is a failure resource, if yes, continuing to step S440, if no, returning to operation S410 to obtain the next resource;
operation S440, obtaining a dormant state resource;
operation S450, controlling the state of the resource to switch from the sleep state to the awake state;
in operation S460, the awakened resource is used to replace the failed resource.
For example, a table or configuration item referencing the failed resource is scanned, and the awakened resource is used to replace the failed resource.
When a processor core invokes a failed resource, it may cause the processor core to make an error or cause the processor to relinquish the current resource and acquire the next available resource. This may lead to starvation of resources and may cause serious errors such as blocking or crashing.
In the embodiment of the application, by regularly carrying out health detection on the resources in the electronic equipment, the fault resources can be found in time, the resources in the dormant state are awakened, and the awakened resources are used for replacing the fault resources, so that the performance of the processor core is ensured, and the probability of errors caused by the fault resources of the processor core is reduced.
Fig. 5 shows a main flow of implementing a resource status management method through a dormant resource pool according to another embodiment of the present application, including:
operation S510, obtaining an allocable resource;
since the resources in the dormant state are all placed into the dormant resource pool, the resources available for allocation are all those in the awake state.
Operation S520, acquiring a call condition of the resource in the first time interval;
operation S530, judging whether the resource is called, if yes, continuing operation S540, otherwise returning to operation S510 to acquire the next allocable resource;
operation S540, controlling the state of the resource to switch from the awake state to the sleep state;
in operation S550, the resource is added to the dormant resource pool.
The dormant resource pool is pre-created and can be realized through a queue or a stack.
The following operations are performed in another process or thread to wake up the resource in the sleep state:
operation S560, in response to the wake-up condition being satisfied, acquiring resources in a dormant state from the dormant resource pool;
operation S570, performing a wake-up operation, and switching the state of the control resource from the sleep state to the wake-up state;
in operation S580, the dormant resources are removed from the dormant resource pool.
In the embodiment of the application, the dormant resources and the awakened resources are managed separately through the dormant resource pool, so that the operation of traversing each resource to acquire the resource state can be greatly reduced, and the efficiency of resource management is greatly improved.
Further, the embodiment of the present application further provides a resource status management device, which is applied to a resource management unit of an electronic device, where the resource management unit allocates, based on a resource requirement of a pipeline, a resource of the electronic device to a processor core executing the pipeline, as shown in fig. 6, and the device 60 includes: the resource calling condition monitoring module 601 is configured to monitor a calling condition of a resource in a first time interval; the resource state control module 602 is configured to control a state of a resource based on a resource call condition, where the state of the resource includes a sleep state or an awake state.
In an embodiment of the present application, the apparatus further includes a resource allocation module, specifically configured to allocate resources of the wake state of the electronic device to the processor core of the execution pipeline.
In one embodiment of the present application, the resource status control module 602 includes: the dormancy control sub-module is used for controlling the state of the resource to be switched from the awakening state to the dormancy state if the resource is not called in the first time interval; and the wake-up control sub-module is used for controlling the state of the resource to be switched from the dormant state to the wake-up state in response to the wake-up condition.
In an embodiment of the present application, the wake-up condition includes that a resource size of the wake-up state is smaller than a resource size required by the pipeline; accordingly, the apparatus 60 further comprises: and the resource demand assessment module is used for determining the size of the resources required by the pipeline and the size of the resources in the awakening state.
In an embodiment of the present application, the wake-up condition includes that a duration of a sleep state of the resource reaches a set duration threshold; accordingly, the apparatus 60 further comprises: the dormancy timer starting module is used for starting a dormancy timer, and the dormancy timer is used for triggering the resource management unit to control the state of the resource to be switched from a dormancy state to an awakening state after a set time length threshold.
In an embodiment of the present application, the wake-up condition includes detecting a failed resource, where the failed resource is a resource that is used due to a failure of the resource; accordingly, the apparatus 60 further comprises: the resource health detection module is used for carrying out health detection on the resources of the electronic equipment so as to determine fault resources; and the resource replacement module is used for replacing the fault resource by using the resource switched to the awakening state.
In one embodiment of the present application, the apparatus 60 further comprises: the dormant resource pool building module is used for building a dormant resource pool; accordingly, the apparatus 60 further comprises: the dormant resource pool entering module is used for adding resources into a dormant resource pool; the dormant resource obtaining module is used for obtaining the resource in the dormant state from the dormant resource pool; and the dormant resource out-of-pool module is used for moving the resource out of the dormant resource pool.
It should be noted that, since the advent of the first general-purpose electronic computer, computer technology has been rapidly developed over several decades, and the rapid development of computer technology has benefited from improvements in computer architecture and development of computer production technology. The contribution of computer production technology to the development of computer technology has been stable; however, as computer architectures have seen decades of improvement, making the space for improvement of computer architectures increasingly narrow, any small improvement to computer architectures will have a significant impact on the performance of processors and the development of computer technology.
The embodiment of the application also provides an electronic device, which is used for implementing the resource state management method shown in fig. 2 to 6. As shown in fig. 7, the electronic device 70 at least includes: a resource management unit 701 and at least one processor core: a first processor core 702 and a second processor core 703; wherein, the resource management unit 701 is configured to perform any one of the above resource status management methods.
According to a fourth aspect of embodiments of the present application, there is provided a computer storage medium comprising a set of computer executable instructions for performing the method of any one of the above when the instructions are executed.
It should be noted here that: the above description of the embodiments of the resource status management device, the above description of the embodiments of the electronic device, and the above description of the embodiments of the computer storage medium are similar to those of the foregoing method embodiments, and have similar advantageous effects as those of the foregoing method embodiments, so that a detailed description thereof will be omitted. For technical details that have not been disclosed in the description of the embodiments of the resource status management device, the description of the embodiments of the electronic device, and the description of the embodiments of the computer storage medium, please refer to the description of the foregoing method embodiments of the present application, for economy of description, and therefore, will not be repeated.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of units is only one logical function division, and there may be other divisions in actual implementation, such as: multiple units or components may be combined or may be integrated into another device, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with flow order instructions, and the foregoing program may be stored in a computer readable storage medium, which when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a removable storage medium, a Read Only Memory (ROM), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the integrated units described above may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partly contributing to the prior art, and the computer software product may be stored in a storage medium, and include several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a removable storage medium, a ROM, a magnetic disk or an optical disk, or the like, and can store program codes.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (8)
1. A resource status management method, wherein the method is applied to a resource management unit of an electronic device, the electronic device being a multi-core electronic device having at least two processor cores; the resource management unit performs unified management on resources of the electronic equipment, allocates the resources of the electronic equipment to a processor core executing the pipeline based on the resource requirement of the pipeline, wherein the resources comprise branch prediction resources, fetching resources, decoding resources, renaming resources and/or execution resources, the execution resources comprise one or more of operation resources, register resources and memory resources, the decoding resources comprise at least one decoder, the renaming resources comprise at least one register, and the resource management unit respectively creates a resource pool for each resource and is used for storing the resources in an allocated awakening state; the allocating the resources of the electronic device to the processor core executing the pipeline includes: allocating the resources of the electronic device in an awake state to a processor core executing the pipeline; the method comprises the following steps:
monitoring the resource calling condition of the electronic equipment in a first time interval;
controlling the state of the resource based on the resource calling condition, wherein the state of the resource comprises a dormant state or an awakening state;
establishing a dormant resource pool;
adding a dormant state resource into the dormant resource pool, and/or removing the resource from the dormant resource pool after the state controlling the resource is switched from the dormant state to the awake state.
2. The method of claim 1, wherein controlling the state of the resource based on the call condition comprises:
if the resource is not called in the first time interval, controlling the state of the resource to be switched from the awakening state to the dormant state;
and controlling the state of the resource to be switched from the dormant state to the awake state in response to the wake-up condition being satisfied.
3. The method of claim 2, wherein the wake-up condition comprises a wake-up state having a resource size that is less than a pipeline-required resource size;
accordingly, before the state of controlling the resource is switched from the sleep state to the awake state, the method further includes:
the size of the resources required by the pipeline and the size of the resources in the awake state are determined.
4. The method of claim 2, wherein the wake-up condition comprises a duration of a sleep state of the resource reaching a set duration threshold;
accordingly, after the state of controlling the resource is switched from the awake state to the sleep state, the method further includes:
and starting a dormancy timer, wherein the dormancy timer is used for triggering the resource management unit to control the state of the resource to be switched from a dormancy state to an awakening state after the set time length threshold.
5. The method of claim 2, wherein the wake-up condition includes detecting a failed resource, the failed resource being a resource that is used due to a resource failure impact;
accordingly, before the state of controlling the resource is switched from the sleep state to the awake state, the method further includes:
health detection is carried out on the resources of the electronic equipment so as to determine the fault resources;
accordingly, after the state of controlling the resource is switched from the sleep state to the awake state, the method further includes:
and replacing the fault resource by using the resource switched to the awakening state.
6. A resource status management device, wherein the device is applied to a resource management unit of an electronic device, the electronic device being a multi-core electronic device having at least two processor cores; the resource management unit performs unified management on resources of the electronic equipment, allocates the resources of the electronic equipment to a processor core executing the pipeline based on the resource requirement of the pipeline, wherein the resources comprise branch prediction resources, fetching resources, decoding resources, renaming resources and/or execution resources, the execution resources comprise one or more of operation resources, register resources and memory resources, the decoding resources comprise at least one decoder, the renaming resources comprise at least one register, and the resource management unit respectively creates a resource pool for each resource and is used for storing the resources in an allocated awakening state; the allocating the resources of the electronic device to the processor core executing the pipeline includes: allocating the resources of the electronic device in an awake state to a processor core executing the pipeline; the device comprises:
the resource calling condition monitoring module is used for monitoring the calling condition of the resource in the first time interval;
the resource state control module is used for controlling the state of the resource based on the resource calling condition, wherein the state of the resource comprises a dormant state or an awakening state, and the dormant state resource is not used for executing the pipeline; establishing a dormant resource pool; adding a dormant state resource into the dormant resource pool, and/or removing the resource from the dormant resource pool after the state controlling the resource is switched from the dormant state to the awake state.
7. An electronic device, comprising:
a resource management unit and at least two processor cores;
wherein the resource management unit is adapted to perform the method of any of claims 1-5.
8. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210263326.8A CN114610578B (en) | 2022-03-17 | 2022-03-17 | Resource state management method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210263326.8A CN114610578B (en) | 2022-03-17 | 2022-03-17 | Resource state management method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114610578A CN114610578A (en) | 2022-06-10 |
CN114610578B true CN114610578B (en) | 2023-12-29 |
Family
ID=81864037
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210263326.8A Active CN114610578B (en) | 2022-03-17 | 2022-03-17 | Resource state management method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114610578B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117119783B (en) * | 2023-10-25 | 2024-01-30 | 广东迅扬科技股份有限公司 | Control method for standby power consumption of module |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493761A (en) * | 2008-01-25 | 2009-07-29 | 国际商业机器公司 | Method for pipelinedly processing instruction by processor and relevant processor |
CN101510156A (en) * | 2009-03-30 | 2009-08-19 | 阿里巴巴集团控股有限公司 | Information system resource recovery method and device |
CN103744735A (en) * | 2014-01-09 | 2014-04-23 | 福建星网锐捷网络有限公司 | Method and device for scheduling multi-core resource |
US9348602B1 (en) * | 2013-09-03 | 2016-05-24 | Amazon Technologies, Inc. | Resource allocation for staged execution pipelining |
CN106528294A (en) * | 2016-11-04 | 2017-03-22 | 郑州云海信息技术有限公司 | Resource pool management method and system |
CN112486312A (en) * | 2020-11-19 | 2021-03-12 | 杭州电子科技大学 | Low-power-consumption processor |
CN113485841A (en) * | 2021-07-28 | 2021-10-08 | 腾讯科技(深圳)有限公司 | Data processing method and device based on edge calculation and readable storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8271818B2 (en) * | 2009-04-30 | 2012-09-18 | Hewlett-Packard Development Company, L.P. | Managing under-utilized resources in a computer |
US9323584B2 (en) * | 2013-09-06 | 2016-04-26 | Seagate Technology Llc | Load adaptive data recovery pipeline |
-
2022
- 2022-03-17 CN CN202210263326.8A patent/CN114610578B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493761A (en) * | 2008-01-25 | 2009-07-29 | 国际商业机器公司 | Method for pipelinedly processing instruction by processor and relevant processor |
CN101510156A (en) * | 2009-03-30 | 2009-08-19 | 阿里巴巴集团控股有限公司 | Information system resource recovery method and device |
US9348602B1 (en) * | 2013-09-03 | 2016-05-24 | Amazon Technologies, Inc. | Resource allocation for staged execution pipelining |
CN103744735A (en) * | 2014-01-09 | 2014-04-23 | 福建星网锐捷网络有限公司 | Method and device for scheduling multi-core resource |
CN106528294A (en) * | 2016-11-04 | 2017-03-22 | 郑州云海信息技术有限公司 | Resource pool management method and system |
CN112486312A (en) * | 2020-11-19 | 2021-03-12 | 杭州电子科技大学 | Low-power-consumption processor |
CN113485841A (en) * | 2021-07-28 | 2021-10-08 | 腾讯科技(深圳)有限公司 | Data processing method and device based on edge calculation and readable storage medium |
Non-Patent Citations (1)
Title |
---|
萧放等.基于超级基站的集中式接入网络架构的物理层虚拟化方法.高技术通讯.2016,第26卷(第05期),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN114610578A (en) | 2022-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9626295B2 (en) | Systems and methods for scheduling tasks in a heterogeneous processor cluster architecture using cache demand monitoring | |
US11422615B2 (en) | Platform power consumption reduction via power state switching | |
US7904903B2 (en) | Selective register save and restore upon context switch using trap | |
US9632822B2 (en) | Multi-core device and multi-thread scheduling method thereof | |
US7490256B2 (en) | Identifying a target processor idle state | |
KR101029414B1 (en) | Method and apparatus for providing for detecting processor state transitions | |
JP5311234B2 (en) | Computer system and its operation method | |
CN105574141B (en) | Method and device for carrying out data migration on database | |
CN114610578B (en) | Resource state management method and device, electronic equipment and storage medium | |
US9395803B2 (en) | Multi-core processor system implementing migration of a task from a group of cores to another group of cores | |
CN105760294A (en) | Method and device for analysis of thread latency | |
CN102736928B (en) | Fast wake-up computer system method and computer system | |
US8610727B1 (en) | Dynamic processing core selection for pre- and post-processing of multimedia workloads | |
US20080313652A1 (en) | Notifying user mode scheduler of blocking events | |
US11803224B2 (en) | Power management method, multi-processing unit system and power management module | |
CN109426563B (en) | Process management method and device | |
CN114610494A (en) | Resource allocation method, electronic device and computer-readable storage medium | |
CN115904679A (en) | Chip adjusting method and device | |
CN114356586B (en) | Processor and electronic equipment | |
US11880231B2 (en) | Accurate timestamp or derived counter value generation on a complex CPU | |
US20090193423A1 (en) | Wakeup pattern-based colocation of threads | |
WO2022083471A1 (en) | Power consumption management method and apparatus | |
US20240103603A1 (en) | Reward generating method for reducing peak load of power consumption and computing device for performing the same | |
CN116225672A (en) | Task processing method and device based on many-core chip, processing core and electronic equipment | |
CN114443255A (en) | Thread calling method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |