WO2021081813A1 - Multi-core processor and scheduling method therefor, device, and storage medium - Google Patents
Multi-core processor and scheduling method therefor, device, and storage medium Download PDFInfo
- Publication number
- WO2021081813A1 WO2021081813A1 PCT/CN2019/114383 CN2019114383W WO2021081813A1 WO 2021081813 A1 WO2021081813 A1 WO 2021081813A1 CN 2019114383 W CN2019114383 W CN 2019114383W WO 2021081813 A1 WO2021081813 A1 WO 2021081813A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- processor
- core
- management mechanism
- power management
- disabled
- Prior art date
Links
Images
Classifications
-
- 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/48—Program initiating; Program switching, e.g. by interrupt
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- This application relates to the technical field of power consumption management, and in particular to a multi-core processor and its scheduling method, device and storage medium.
- DVFS Dynamic Power Management
- DPM Dynamic Power Management
- DVFS Dynamic Voltage and Frequency Scaling
- Various aspects of the present application provide a multi-core processor and its scheduling method, device, and storage medium, which are used to minimize performance loss and ensure task execution efficiency while reducing system power consumption.
- An embodiment of the present application provides a multi-core processor, including: a plurality of processor cores; wherein a power consumption management mechanism on at least one processor core is in a disabled state.
- the embodiment of the present application also provides a multi-core processor scheduling method, including: receiving a task to be processed; in the case that the task to be processed belongs to the first type of task, allocating the task to be processed to the multi-core processor
- the power consumption management mechanism is on a processor core in a disabled state; wherein the multi-core processor includes a plurality of processor cores, and the power consumption management mechanism on at least one processor core is in a disabled state.
- An embodiment of the present application also provides a computer device, including: a multi-core processor; the multi-core processor includes a plurality of processor cores; wherein the power consumption management mechanism on at least one of the processor cores is in a disabled state.
- the embodiment of the present application also provides a computer-readable storage medium storing a computer program.
- the processor When the computer program is executed by a processor, the processor is caused to implement the steps in the multi-core processor scheduling method provided by the embodiment of the present application. .
- a multi-core processor is used.
- the multi-core processor includes multiple processor cores, and the power consumption management mechanism on at least one processor core is disabled.
- the processor cores in the multi-core processor support power consumption.
- the management mechanism is conducive to saving the power consumption of multi-core processors; and by disabling the power management mechanism on some processor cores, some tasks that are sensitive to the power management mechanism can be executed on these processor cores, which is beneficial to ensure these The performance requirements of the task. It can be seen that the embodiment of the present application can reduce the performance loss as much as possible while reducing the overall power consumption, and ensure the execution efficiency of the task.
- FIG. 1a is a schematic structural diagram of a multi-core processor provided by an exemplary embodiment of this application;
- FIG. 1b is a schematic structural diagram of another multi-core processor provided by an exemplary embodiment of this application.
- FIG. 1c is a schematic diagram of state changes of a power consumption management mechanism on a processor core provided by an exemplary embodiment of this application;
- FIG. 3 is a schematic flowchart of another multi-core processor scheduling method provided by an exemplary embodiment of this application.
- Fig. 4 is a schematic structural diagram of a computer device provided by an exemplary embodiment of this application.
- a multi-core processor is used, and the multi-core processor includes multiple processor cores, and at least one processor core
- the power management mechanism on the CPU is in a disabled state; among them, the processor core supports the power management mechanism, which is conducive to saving the power consumption of multi-core processors; and the power management mechanism on some processor cores is disabled, which can be used in these processor cores.
- Performing some tasks that are more sensitive to the power management mechanism is conducive to ensuring the performance requirements of these tasks. It can be seen that the embodiment of the present application can reduce the performance loss as much as possible while reducing the overall power consumption, and ensure the execution efficiency of the task.
- Fig. 1a is a schematic structural diagram of a multi-core processor provided by an exemplary embodiment of this application.
- the multi-core processor 100 includes a plurality of processor cores (Core) 101. Multiple refers to two or more.
- the processor core is an important part of a multi-core processor.
- the implementation form of the multi-core processor 100 and the processor core 101 is not limited. According to the different implementation forms of the processor core 101, the multi-core processor 100 will also have different implementation forms.
- the processor core 101 may be a CPU core, and the multi-core processor 100 may be implemented as a multi-core CPU.
- the processor core 101 may be a GPU core, and the multi-core processor 100 may be implemented as a multi-core GPU.
- the processor core 101 in this embodiment can also be implemented as other chip cores with information processing and program execution capabilities.
- the multi-core processor 100 can also be implemented as a chip with corresponding functions. Multi-core chips.
- the processor core of the multi-core processor 100 supports a power management mechanism;
- the power management mechanism is a mechanism for power management of the processor core 101, which can dynamically adjust the power consumption of the processor core 101 to achieve savings The purpose of power consumption.
- the power management mechanism supported by the processor core 101 will be different. The following is an example of the power management mechanism supported by the processor core 101:
- the power management mechanism supported by the processor core 101 includes DVFS and C-state. In another optional embodiment, the power consumption management mechanism supported by the processor core 101 only includes DVFS. In another optional embodiment, the power consumption management mechanism supported by the processor core 101 only includes C-state. DVFS and C-sate belong to the operating system-level power management mechanism and need to run in the kernel mode, which is referred to as the power management mechanism in the kernel mode for short.
- DVFS is a dynamic technology that dynamically adjusts the operating frequency and voltage of the processor core 11 according to the different needs of the computing power of the application program that the processor core 11 runs, so as to achieve the purpose of energy saving.
- the frequency adjustment is usually related to the load, and is generally not real-time, and the adjustment speed may be relatively slow.
- C-state is a low-power mechanism that allows the processor core 11 to enter a low-power state when it is idle.
- the C mode included in C-states starts from C0 to Cn, and C0 is the processor core 11 In normal working mode, the processor core 11 In normal working mode, the processor core 11 is in a normal operating state; the higher the value of n after C, the deeper the sleep of the processor core 11, the lower the power consumption of the processor core 11, and of course it takes more time to return To C0 mode; where n is a positive integer.
- the power management mechanism supported by the processor core 101 may include an operating system-level power management mechanism, and may also include an application-level power management mechanism.
- the power consumption management mechanism supported by it may include one or more.
- the supported power management mechanisms may be completely the same, may also be partially the same, or may be completely different.
- the processor core 101 supports a power management mechanism.
- the processor core can be dynamically adjusted according to the computing power demand, load condition, or busyness of the processor core 101.
- the frequency of 101 or the state of the hardware circuit, etc. (the object of dynamic adjustment may be determined by the specific power consumption management mechanism), which is beneficial to reduce the power consumption of the processor core 101, thereby reducing the overall power consumption of the multi-core processor 100.
- the power management mechanism on at least one processor core 101 is in a disabled state, and the processor cores 101 with these power management mechanisms in a disabled state will always run at the set operating frequency.
- the idle state here does not enter the idle state actually means that it will not enter the low-power mode or will not run at other frequencies lower than the set operating frequency, so it can provide better performance .
- the higher the operating frequency set for the processor core 101 the faster the processing speed of the processor core 101 and the higher the performance.
- the operating frequency can be flexibly set for the processor core 101 according to performance requirements.
- the set operating frequency may be the highest operating frequency of the processor core 101, and when the power management mechanism on the processor core 101 is disabled, the processor core 101 will always run at the highest operating frequency. Advance can bring optimal performance.
- the same operating frequency can be set for different processor cores 101, or different operating frequencies can be set for different processor cores 101.
- executing these tasks on the processor core 101 in which the power management mechanism is in a disabled state can overcome the adverse effect of the power management mechanism on the performance of these tasks, and is beneficial to satisfy the performance requirements of these tasks.
- the number of processor cores 101 whose power management mechanism is in a disabled state is not limited, and there may be one or more.
- the power consumption management mechanisms on 2N (ie, even number) processor cores 101 are in a disabled state; N is a positive integer.
- the number of processor cores 101 with the power management mechanism in the disabled state may also be an odd number, for example, 1, 3, 5, etc., which is not limited.
- a scheduler 102 runs on multiple processor cores 101 of the multi-core processor 100.
- the scheduler 102 can run on any one or several processor cores 101.
- the scheduler 102 is a software scheduler, which is a program running on multiple processor cores 101 and is mainly responsible for task scheduling on the multiple processor cores 101.
- the scheduler 102 may be an operating system (OS) level program of the multi-core processor 100, or an application level program (for example, an application program), which is not limited.
- OS operating system
- FIG. 1b a program in which the scheduler belongs to the OS level is taken as an example for illustration, but it is not limited to this.
- the scheduler 102 can receive the task to be processed, determine the type of the task to be processed; and in the case of determining that the task to be processed belongs to the first type of task, assign the task to be processed to the power management mechanism is disabled
- the processor core 101 whose power management mechanism is in the disabled state is responsible for executing tasks to be processed. Because the processor core 101 with the power management mechanism in the disabled state will not enter the idle state, it will run at the set operating frequency, and this type of processor core 101 will perform pending tasks, and will not be generated by the power management mechanism. Delay, can process the task to be processed in time, can ensure that the task to be processed is not affected by the power management mechanism, improve the execution efficiency of the task to be processed, and ensure the performance of the task to be processed.
- the first type of tasks can be tasks that have certain requirements on performance and are more sensitive to power management mechanisms.
- the first type of tasks can include, but are not limited to: tasks that require high processing delay (for example, require a delay less than the set delay threshold), and have high real-time requirements ( For example, tasks that require response time not to exceed the set response time threshold), and so on.
- some control tasks may have higher real-time requirements.
- some interrupt tasks such as network interrupt processing tasks
- instant analysis tasks, instant query tasks, etc. can be used as examples of the first type of tasks. It should be noted that this embodiment does not limit the first type of tasks, and allows flexible setting according to application scenarios.
- the scheduler 102 may compare the utilization rates of the processor cores 101 whose power management mechanism is disabled, and select the utilization rate to be lower than the set utilization threshold value or select the lowest utilization rate among them.
- the processor core 101 of the processor allocates the task to be processed to the selected processor core 101.
- the utilization rate of the processor core 101 is low, indicating that the processor core 101 is relatively easy or has better performance.
- the processor core 101 with the power management mechanism in the disabled state the processor core 101 that is relatively easy or has the better performance is executed. Processing tasks, while ensuring task performance, is conducive to further improving the execution efficiency of the tasks to be processed.
- the scheduler 102 may compare the load of each processor core 101 whose power management mechanism is disabled, and select the load to be lower than the set load threshold or select the load from it.
- the lowest processor core 101 allocates the task to be processed to the selected processor core 101.
- the load of the processor core 101 is relatively low, indicating that the processor core 101 is relatively easy and has sufficient computing resources.
- the relatively easy processor core 101 among the processor cores 101 whose power management mechanism is disabled performs the tasks to be processed. , Under the condition of ensuring task performance, it is helpful to further improve the execution efficiency of the task to be processed.
- the load of each processor core 101 can be determined according to the task information being queued in the task queue of each processor core 101.
- the load of each processor core 101 can be determined according to the number of tasks being queued in the task queue. Generally speaking, the higher the number of tasks being queued, the greater the load of the corresponding processor core 101.
- the load of each processor core 101 can also be determined according to the priority of the task being queued in the task queue. Generally speaking, the higher the priority of the task being queued, the greater the load of the corresponding processor core 101.
- the load of each processor core 101 can also be determined according to the number and priority of the tasks being queued in the task queue at the same time.
- a weighted summation of the number and priority of the tasks being queued can be performed to obtain the load of the corresponding processor core 101; the larger the result of the weighted summation, the greater the load of the processor core 101.
- the operating frequencies of the processor cores 101 whose power management mechanism is in a disabled state are not completely the same.
- the scheduler 102 can compare the operating frequencies of the processor cores 101 whose power management mechanism is disabled, and select the processor core 101 whose operating frequency is higher than the set frequency threshold or the highest operating frequency to be processed. Tasks are assigned to the selected processor core 101.
- the operating frequency of the processor core 101 is relatively high, indicating that the processing speed of the processor core 101 is relatively fast. Processing tasks, while ensuring task performance, is conducive to further improving the execution efficiency of the tasks to be processed.
- the scheduler 102 may use a hash algorithm to allocate the tasks to be processed to each of the processor cores 101 whose power management mechanism is disabled.
- the application scenarios of the multi-core processor 100 may be combined to pre-categorize each task into the first type of task and the second type of task according to the performance requirements of each task in the application scenario.
- the second type of tasks refer to tasks other than the first type of tasks.
- the mapping relationship between the identification information of the task and the task type can be maintained.
- the mapping relationship includes the identification information of each task under the first type of task, or includes the identification information of each task under the second type of task, Or include the identification information of each task under the first type of task and the identification information of each task under the second type of task at the same time.
- the scheduler 102 can match the identification information of the task to be processed in the mapping relationship between the identification information of the task to be maintained and the task type, and according to the matching result, it is obtained that the task to be processed belongs to The judgment result of the first type of task or the second type of task.
- the task to be processed can be allocated to the processor core 101 whose power consumption management mechanism is enabled.
- the processor core 101 whose management mechanism is in an enabled state is responsible for executing tasks to be processed. With the help of the power consumption management mechanism on the processor core 101, the power consumption of the processor core 101 can be saved while the tasks to be processed are completed.
- the allocation method of allocating tasks to be processed to the processor cores 101 whose power management mechanism is in the enabled state is not limited.
- the specific allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the enabled state is similar to the allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the disabled state, see The foregoing implementation manners will not be repeated here.
- the multi-core processor 100 includes multiple processor cores 101.
- some of the processor cores 101 have a power management mechanism in a disabled state, and the other part of the processor cores is disabled.
- the power consumption management mechanism on 101 is in an enabled state, thus forming a heterogeneous multi-core processor.
- the number of processor cores 101 with the power management mechanism in the disabled state and the number of processor cores 101 with the power management mechanism in the enabled state are fixed.
- a multi-core processor includes 4 processor cores, of which the power management mechanism on 2 processor cores is disabled, and the power management mechanism on these 2 processor cores will always be disabled ;
- the power management mechanism on the other two processor cores is in the enabled state, and the power management mechanism on the two processor cores will always be in the enabled state.
- a multi-core processor includes 6 processor cores, of which, the power management mechanisms on 3 processor cores are disabled, and the power management mechanisms on these 3 processor cores will always be disabled ;
- the power management mechanisms on the other three processor cores are in the enabled state, and the power management mechanisms on the three processor cores will always be in the enabled state.
- a multi-core processor includes 4 processor cores, of which, the power management mechanism on one processor core is disabled, and the power management mechanism on this processor core will always be disabled; in addition, The power management mechanisms on the three processor cores are in an enabled state, and the power management mechanisms on the three processor cores will always be in an enabled state.
- the multi-core processor 100 includes multiple processor cores 101.
- some of the processor cores 101 have a power management mechanism in a disabled state, and some of the processor cores 101 are disabled.
- the power consumption management mechanism on the core 101 is in an enabled state, thereby forming a heterogeneous multi-core processor.
- the number of processor cores 101 whose power management mechanism is in a disabled state can be dynamically changed according to application requirements; accordingly, the number of processor cores 101 whose power management mechanism is in an enabled state will also be dynamically changed according to application requirements. Variety.
- the application requirements here mainly refer to the requirements generated by the first type of tasks that are more sensitive to the power management mechanism.
- the multi-core processor 100 further includes a manager 103.
- the manager 103 is mainly used to dynamically adjust the state of the power management mechanism on the multiple processor cores 101 according to application requirements, so as to achieve the purpose of dynamically changing the number of processor cores 101 with the power management mechanism in the disabled state according to the application requirements.
- the state of the power management mechanism includes two states: a disabled state and an enabled state.
- the manager 103 adjusting the state of the power management mechanism on the processor core 101 includes: adjusting the power management mechanism on the processor core 101 from a disabled state to an enabled state, or changing the power management mechanism on the processor core 101 from a disabled state to an enabled state.
- the enabled state is adjusted to the disabled state.
- the manager 103 is a manager in the form of software, and is a program running on multiple processor cores 101. Specifically, the manager 103 can run on any one or several processor cores 101. Of course, in addition to running the manager 103, the remaining processing capacity of the processor core 101 running the manager 103 can also be used to perform other tasks.
- the manager 103 may be an operating system (OS) level program of the multi-core processor 100, or an application level program (for example, an application program), which is not limited.
- OS operating system
- FIG. 1b a program of the manager 103 belonging to the OS level is taken as an example for illustration, but it is not limited to this.
- the implementation manner in which the manager 103 dynamically adjusts the state of the power consumption management mechanism on the multiple processor cores 101 according to application requirements is not limited.
- the following example illustrates:
- the manager 103 can monitor the overall processing capacity of the processor cores whose power management mechanism is disabled.
- the overall processing capabilities of the processor cores cannot meet application requirements. That is, when the overall processing capacity of the processor core with the power management mechanism in the disabled state is insufficient, select the processor cores to be disabled from the processor cores with the power management mechanism in the enabled state, and set the processor cores on the processor cores to be disabled.
- the power management mechanism is disabled.
- the number of processor cores to be disabled may be one or more. This can increase the number of processor cores with the power management mechanism in the disabled state, and increase the overall processing capacity of the processor cores with the power management mechanism in the disabled state, so as to meet application requirements.
- the manner in which the manager 103 selects the processor core to be disabled is not limited, and the following manners can be used but not limited to:
- Method A1 In method A1, one or more processor cores can be randomly selected as the processor cores to be disabled from among the processor cores in which the power consumption management mechanism is in the enabled state. This method is relatively simple, easy to implement, and highly efficient. This method A1 is suitable for various types of multi-core processors, especially suitable for multi-core processors with exactly the same processor cores, such as X86 processors.
- the number of processor cores to be disabled that are allowed to be selected each time can be preset. Assuming that the number is preset to 1, 2, or 4, etc., one, 2, or 4 processor cores can be randomly selected from the processor cores in which the power management mechanism is enabled each time. The processor core is to be disabled.
- Manner A2 In Manner A2, all processor cores among the processor cores whose power consumption management mechanism is in the enabled state may be used as processor cores to be disabled. This method is relatively simple, easy to implement, and highly efficient. The method A2 is suitable for various types of multi-core processors, both for multi-core processors with identical processor cores, and for multi-core processors with different processor cores.
- method A2 suppose that the multi-core processor contains a total of 6 processor cores, and the power management mechanism on 2 processor cores is currently disabled, and the overall processing capacity of these 2 processor cores does not meet the application requirements ( That is, the overall processing capacity of these 2 processor cores is insufficient), the remaining 4 processor cores can be used as processor cores to be disabled, thereby disabling the power management mechanism on these 4 processor cores, so that 6 processing
- the processor cores are all processor cores with the power management mechanism in the disabled state, and the overall processing capabilities of the processor cores with the power management mechanism in the disabled state will be greatly improved.
- Method A3 In method A3, one or more processor cores can be selected as the to-be-disabled processor cores from the processor cores in the enabled state of the power consumption management mechanism according to the amount of tasks corresponding to the application requirements. This method can more accurately and reasonably determine the number of processor cores to be disabled, avoid disabling the power management mechanism on the processor cores too much, and maximize power savings while meeting application requirements.
- This method A3 is suitable for various types of multi-core processors, not only for multi-core processors with identical processor cores, but also for multi-core processors with different processor cores.
- the task amount corresponding to the application demand can be predicted based on the task amount in the historical period.
- the task volume corresponding to the application demand can also be predicted according to the utilization rate or the load volume of the processor core in the disabled state of the power management mechanism in the recent period of time.
- the corresponding task amount can also be carried in the application requirements, so that the corresponding task amount can be extracted from the application requirements.
- the amount of tasks corresponding to application requirements mainly refers to the amount of tasks belonging to the first type of task.
- the task amount corresponding to the application requirement can be converted into the target load amount, and the load amount that can be processed by each processor core with the power management mechanism in the enabled state can be calculated, according to the processing of the power management mechanism in the enabled state.
- the processor core can be used as the processor core to be disabled.
- processor cores For another example, if the load that a single processor core can handle is less than the target load, several processor cores can be selected. The sum of the load that these processor cores can handle is greater than the target load, and is equal to the target load. The load is the closest, and these processor cores are used as the processor cores to be disabled.
- Method A4 In method A4, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, according to the processing capabilities of the processor cores, one or more processor cores can be selected as the processor cores to be disabled from the processor cores in which the power management mechanism is in the enabled state. This method A4 is suitable for multi-core processors with different processor cores.
- a processor core with stronger processing capability may be selected as the processor core to be disabled.
- a processor core with a weaker processing capability may be selected from among the processor cores in which the power management mechanism is in an enabled state.
- the multi-core processor includes multiple processor cores, and the multiple processor cores are divided into two types, namely the first type of processor core and the second type of processor core.
- the first type of processor The processing power of the core is stronger than that of the second type of processor core.
- the multi-core processor may be implemented as a multi-core processor of the ARM architecture.
- the multi-core processor of the ARM architecture includes a big core (big Core) and a small core (LITTLE core), where the big core is equivalent to the first type of processing The small core is equivalent to the second type of processor core.
- the manager 103 when the manager 103 selects the processor cores to be disabled according to the processing capabilities of the processor cores, it may first determine the processor cores whose power management mechanism is in the enabled state. Whether there is a second type of processor core in the, if there is a second type of processor core with the power management mechanism in the enabled state, select the processor core to be disabled from the second type of processor core with the power management mechanism in the enabled state; If there is no second-type processor core with the power management mechanism in the enabled state, select the to-be-disabled processor core from the first-type processor cores with the power management mechanism in the enabled state.
- the processor core with lower processing capability has relatively low power consumption, and the power consumption management mechanism on this type of processor core is preferentially disabled, and the increase in power consumption is relatively small. or
- the manager 103 when the manager 103 selects the processor cores to be disabled according to the processing capabilities of the processor cores, it may also consider the processing capabilities of the processor cores and the corresponding application requirements. The amount of tasks. In the case that the task volume corresponding to the application demand is greater than or equal to the set task volume threshold, select the processor core to be disabled from the first type of processor cores with the power management mechanism in the enabled state; in the task volume corresponding to the application demand If it is less than the set task amount threshold, the processor core to be disabled is selected from the second type of processor cores in which the power consumption management mechanism is in the enabled state.
- the power consumption management mechanism on the second type of processor cores with relatively low processing capabilities is preferentially disabled, due to the processing capabilities of this type of processor cores. Relatively low, its power consumption is relatively low, and the increase in power consumption is relatively small.
- the manager 103 may monitor the overall processing capability of the processor cores whose power management mechanism is disabled, and the overall processing capabilities of the processor cores whose power management mechanism is disabled meet application requirements and In the case of surplus, select the processor cores to be enabled from the processor cores with the power management mechanism in the disabled state, and re-enable the power management mechanism on the processor cores to be enabled to reduce multi-core processing with the help of the power management mechanism
- the power consumption of the device 100 The number of processor cores to be activated can be one or more.
- the manner in which the manager 103 selects the processor core to be activated is not limited, and the following manners can be used but not limited to:
- Manner B1 In Manner B1, one or more processor cores can be randomly selected as the processor cores to be enabled from the processor cores in which the power management mechanism is in a disabled state. This method is relatively simple, easy to implement, and highly efficient. This method B1 is suitable for various types of multi-core processors, and is especially suitable for multi-core processors with identical processor cores.
- the number of processor cores to be activated that are allowed to be selected each time can be preset. Assuming that the number is preset to 1, 2, or 4, etc., one, 2, or 4 processor cores can be randomly selected from the processor cores in which the power management mechanism is disabled each time. The processor core is to be enabled.
- Method B2 In method B2, one or more processor cores can be selected as the to-be-enabled processor cores from the processor cores whose power consumption management mechanism is in the disabled state according to the amount of tasks corresponding to the application requirements.
- This method can more accurately and reasonably determine the number of processor cores to be activated, and can avoid excessively enabling the power management mechanism on the processor cores, thus failing to meet the application requirements. It can meet the application requirements while doing as many as possible Enable the power management mechanism on the processor core to save power.
- This method B2 is suitable for various types of multi-core processors, not only for multi-core processors with identical processor cores, but also for multi-core processors with different processor cores.
- Manner B3 In Manner B3, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, one or more processor cores can be selected as the processor cores to be enabled from among the processor cores whose power management mechanism is in a disabled state according to the processing capabilities of the processor cores. This method B3 is suitable for multi-core processors with different processor cores.
- a processor core with stronger processing capability may be preferentially selected as the processor core to be activated.
- the processing power of the processor core is stronger, which means that its power consumption is also higher.
- the power management mechanism on this type of processor core is preferentially enabled, which is conducive to saving power consumption.
- the multi-core processor includes multiple processor cores, and the multiple processor cores are divided into two types, namely the first type of processor core and the second type of processor core.
- the first type of processor The processing power of the core is stronger than that of the second type of processor core.
- the power consumption management mechanism on the first type of processor cores with relatively strong processing capabilities is preferentially enabled, due to the processing capabilities of such processor cores. Stronger, its power consumption is relatively high, and priority is given to enabling the power management mechanism on it, which is conducive to saving power consumption.
- the manager 103 needs to monitor the overall processing capabilities of the processor cores whose power management mechanism is in a disabled state.
- various indicators or attribute information of each processor core with the power management mechanism in the disabled state can be used to characterize the overall processing capability of the processor core with the power management mechanism in the disabled state.
- the utilization rate of each processor core whose power management mechanism is disabled can be monitored; according to the utilization rate of each processor core whose power management mechanism is disabled, determine the processor whose power management mechanism is disabled Whether the overall processing capability of the core meets the application requirements, that is, it is determined whether the overall processing capability of the processor core whose power management mechanism is disabled is sufficient.
- the utilization rate of each processor core whose power management mechanism is disabled is greater than or equal to the set utilization threshold, it is determined that the overall processing capacity of the processor core whose power management mechanism is disabled cannot meet the application requirements , That is, the overall processing capacity of the processor cores whose power management mechanism is disabled is insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements.
- the proportion of processor cores whose utilization is less than the set utilization threshold is greater than or equal to the set first proportion threshold, for example, there are more than 2/3 If the utilization of the processor core is less than the set utilization threshold, it can be determined that the processing capacity of the processor core with the power management mechanism in the disabled state can not only meet the application requirements but also far exceed the application requirements, that is, the overall processing capacity is surplus.
- the proportion of processor cores whose utilization rate is greater than the set utilization threshold value in each processor core is greater than the set second proportion threshold value, for example, the utilization rate of more than 2/3 of the processor cores is greater than the set utilization rate threshold.
- the utilization threshold determines that the overall processing capability of the processor core whose power management mechanism is disabled cannot meet application requirements, that is, the overall processing capability of the processor core whose power management mechanism is disabled is insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements.
- the proportion of processor cores whose utilization is less than the set utilization threshold is greater than or equal to the set first proportion threshold, for example, there are more than 1/2 If the utilization rate of the processor core is less than the set utilization threshold, it can be determined that the processing capacity of the processor core whose power management mechanism is disabled not only meets the application requirements but also far exceeds the application requirements, that is, the overall processing capacity is surplus. It should be noted that the first ratio threshold may be the same as or different from the second ratio threshold, which is not limited.
- the load of each processor core with the power management mechanism in the disabled state can be monitored; according to the load of each processor core with the power management mechanism in the disabled state, determine the processor with the power management mechanism in the disabled state Whether the overall processing capability of the core meets the application requirements, that is, it is determined whether the overall processing capability of the processor core whose power management mechanism is disabled is sufficient.
- the load of each processor core with the power management mechanism in the disabled state is greater than or equal to the set load threshold, it is determined that the overall processing capacity of the processor core with the power management mechanism in the disabled state cannot meet the application requirements , That is, the overall processing capacity of the processor cores whose power management mechanism is disabled is insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements.
- the proportion of processor cores whose load is less than the set load threshold is greater than or equal to the set third proportion threshold, for example, more than 2/3 If the load of the processor core is less than the set load threshold, it can be determined that the processing capacity of the processor core with the power management mechanism in the disabled state can not only meet the application requirements but also far exceed the application requirements, that is, the overall processing capacity is surplus.
- the proportion of processor cores with load greater than the set load threshold in each processor core is greater than the set fourth proportion threshold, for example, more than 2/3 of the processor cores have load greater than the set threshold.
- the load threshold determines that the overall processing capabilities of the processor cores with the power management mechanism in the disabled state cannot meet application requirements, that is, the overall processing capabilities of the processor cores with the power management mechanism in the disabled state are insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements.
- the proportion of processor cores whose load is less than the set load threshold is greater than or equal to the set third proportion threshold, for example, there are more than 1/2 If the load of the processor core is less than the set load threshold, it can be determined that the processing power of the processor core whose power management mechanism is disabled can not only meet the application requirements but also far exceed the application requirements, that is, the power management mechanism is disabled The overall processing power of the state of the processor core is excessive.
- the third ratio threshold may be the same as or different from the fourth ratio threshold, which is not limited.
- the utilization rate and load of each processor core whose power management mechanism is disabled can be monitored at the same time; power management can be determined according to the utilization and load of each processor core whose power management mechanism is disabled Whether the overall processing capacity of the processor core with the mechanism in the disabled state meets the application requirements.
- the multi-core processor of this embodiment is applied to a multi-queue NIC, and the multi-queue NIC includes multiple processor cores; in the initial state, the power consumption management mechanisms on the two processor cores, such as C-state and DVFS, are disabled; The power management mechanisms on the remaining processor cores, such as C-state and DVFS, are in an enabled state.
- this type of processor core can be called a performance-type processor core, as shown in Figure 1c.
- the scheduler prioritizes the performance-based processor core, and can use a hash algorithm to assign the network interrupt task to the performance-based processor core.
- the performance-based processor core will not enter the idle state, so there is no delay caused by the C-state or DVFS mechanism, and the network interrupt task can be processed in time.
- the performance-based processor core can run at the highest frequency, so that the network interrupt task can be processed with the best performance.
- the manager can monitor some performance indicators of the performance-type processor core, such as the utilization rate and load of the processor core. If the overall performance index of the current performance-based processor core is greater than or equal to the corresponding index threshold, the manager can remap the network interrupt task to the remaining processor cores; at the same time, the power management mechanism on the remaining processor cores, such as C-state and DVFS will be disabled. This means that some energy-saving processor cores will become performance-based processor cores. It may be that all energy-saving processor cores become performance-based processor cores, or some energy-saving processor cores will become performance-based processor cores. Processor core. Among them, in FIG. 1c, the graying of the dashed box where the performance-based processor core is located indicates that the performance-based processor core exceeds the corresponding indicator threshold. In Fig. 1c, an example is illustrated by taking all energy-saving processor cores into performance processor cores.
- the manager will continue to monitor some performance indicators of the performance-based processor core, such as the utilization rate and load of the processor core. If the overall performance index of the current performance-based processor core is less than the corresponding indicator threshold, the manager can change some performance-based processor cores back to energy-saving processor cores, and remap network interrupt tasks to the remaining performance-based processor cores on.
- the embodiment of the present application provides a multi-core processor with a heterogeneous power management mechanism, which can save the power consumption of the multi-core processor as much as possible while ensuring task performance, and can meet the performance requirements of C-state or DVFS for some tasks.
- Such as power consumption management mechanism is more sensitive to the needs of task scenarios.
- FIG. 2 is a schematic flowchart of a multi-core processor scheduling method provided by an exemplary embodiment of this application. As shown in Figure 2, the method includes:
- the multi-core processor includes multiple processor cores, the processor cores support a power consumption management mechanism, and the power consumption management mechanism on at least one processor core is in a disabled state.
- the power management mechanisms supported by the processor core include, but are not limited to, DVFS and C-state.
- the number of processor cores whose power management mechanism is in a disabled state is not limited, and it may be one or multiple.
- the power consumption management mechanisms on 2N that is, an even number
- processor cores are in a disabled state; N is a positive integer.
- the number of processor cores with the power management mechanism in the disabled state may also be an odd number, for example, 1, 3, 5, etc., which is not limited.
- the first type of tasks may be tasks that have certain requirements on performance and are more sensitive to the power management mechanism.
- the first type of tasks can include, but are not limited to: tasks that require high processing delay (for example, require a delay less than the set delay threshold), and have high real-time requirements ( For example, tasks that require response time not to exceed the set response time threshold), and so on.
- some control tasks may have higher real-time requirements.
- some interrupt tasks such as network interrupt processing tasks
- real-time scheduling tasks, instant analysis tasks, and instant query tasks can all be used as examples of the first type of tasks. It should be noted that this embodiment does not limit the first type of tasks, and allows flexible setting according to application scenarios.
- the task to be processed is received, and the type of the task to be processed is determined; and when it is determined that the task to be processed belongs to the first type of task, the task to be processed is assigned to the processor whose power management mechanism is disabled On the core, the processor core whose power management mechanism is disabled is responsible for executing tasks to be processed. Because the processor cores with the power management mechanism in the disabled state will not enter the idle state, they will run at the set operating frequency, and such processor cores will perform pending tasks without delay due to the power management mechanism.
- the task to be processed can be processed in time, which can ensure that the task to be processed is not affected by the power management mechanism, improve the execution efficiency of the task to be processed, and ensure the performance of the task to be processed.
- the allocation method for allocating to-be-processed tasks to processor cores whose power management mechanism is in a disabled state is not limited.
- the utilization rate of each processor core whose power management mechanism is disabled may be compared, and the utilization rate may be selected from the set utilization threshold value or the processor core with the lowest utilization rate may be selected.
- the task to be processed is assigned to the selected processor core.
- the low utilization rate of the processor core indicates that the processor core is relatively easy or has better performance.
- the processor cores with the power management mechanism in the disabled state the processor core that is relatively easy or has the better performance performs the task to be processed. In the case of ensuring task performance, it is beneficial to further improve the execution efficiency of the task to be processed.
- the load of each processor core whose power management mechanism is disabled can be compared, and the load is lower than the set load threshold, or the processor with the lowest load can be selected from it.
- Core the task to be processed is allocated to the selected processor core.
- the load of the processor core is relatively low, indicating that the processor core is relatively easy, and the computing resources are sufficient.
- the relatively easy processor core among the processor cores in the disabled state of the power management mechanism executes the tasks to be processed, and the task is guaranteed. In the case of performance, it is helpful to further improve the execution efficiency of the task to be processed.
- the load of each processor core can be determined according to the task information being queued in the task queue of each processor core.
- the load of each processor core can be determined according to the number of tasks being queued in the task queue. Generally speaking, the higher the number of tasks being queued, the greater the load on the corresponding processor core.
- the load of each processor core can also be determined according to the priority of the task being queued in the task queue. Generally speaking, the higher the priority of the task being queued, the greater the load of the corresponding processor core.
- the load of each processor core can also be determined according to the number and priority of the tasks being queued in the task queue at the same time. Generally speaking, for example, you can perform a weighted summation on the number and priority of the tasks being queued to obtain the load of the corresponding processor core; the larger the result of the weighted summation, the greater the load of the processor core.
- the operating frequencies of the processor cores in the disabled state of the power management mechanism are not completely the same. Based on this, the operating frequency of each processor core whose power management mechanism is disabled can be compared, and the processor core with the operating frequency higher than the set frequency threshold or the highest operating frequency can be selected, and the tasks to be processed can be assigned to the selected Processor cores.
- the working frequency of the processor core is relatively high, indicating that the processing speed of the processor core is relatively fast, and the processor core with the faster processing speed among the processor cores in the disabled state of the power management mechanism executes the tasks to be processed. In the case of ensuring task performance, it is beneficial to further improve the execution efficiency of the task to be processed.
- a hash algorithm may be used to allocate tasks to be processed to each processor core whose power management mechanism is in a disabled state.
- the process of allocating tasks to be processed to the processor cores with the power management mechanism in the disabled state is solely based on the utilization, load, or operating frequency of the processor cores.
- other indicators or attribute information of the processor core may also be considered.
- the cache size, bus speed, and/or operating voltage of the processor core may also be considered.
- FIG. 3 is a schematic flowchart of another multi-core processor scheduling method provided by an embodiment of the application. As shown in Figure 3, the method includes:
- step 302. Determine whether the task to be processed belongs to the first type of task; if the result of the judgment is yes, it means that the task to be processed belongs to the first type of task, then execute step 303; if the result of the judgment is no, it means that the task to be processed belongs to the second type of task Task, go to step 304.
- the task to be processed belongs to the first type of task
- the task to be processed is allocated to the processor core of the multi-core processor whose power management mechanism is in the disabled state, and the processor core of the power management mechanism is in the disabled state. Perform pending tasks.
- the task to be processed belongs to the second type of task
- the task to be processed is allocated to the processor core of the multi-core processor whose power management mechanism is enabled, and the processor core of the power management mechanism is enabled. Perform pending tasks.
- the application scenario of the multi-core processor may be combined, and each task may be pre-classified into the first type of task and the second type of task according to the performance requirements of each task in the application scenario.
- the second type of tasks refer to tasks other than the first type of tasks.
- the first type of task please refer to the above description, which will not be repeated here.
- mapping relationship between the identification information of the task and the task type can be maintained.
- the mapping relationship includes the identification information of each task under the first type of task, or includes the identification information of each task under the second type of task.
- the identification information of the task to be processed can be matched in the mapping relationship between the identification information of the task to be maintained and the task type. According to the matching result, it is obtained that the task to be processed belongs to the first category. Tasks or judgment results belonging to the second category of tasks.
- the task to be processed can be allocated to the processor cores with the power management mechanism in the disabled state, and the processor cores with the power management mechanism in the disabled state are responsible for executing the tasks to be processed task.
- the tasks to be processed can be processed in time, which is beneficial to ensure the performance of the tasks to be processed.
- the task to be processed can be allocated to the processor cores with the power management mechanism in the enabled state.
- the processor core is responsible for executing pending tasks. With the help of the power consumption management mechanism on these processor cores, while completing the tasks to be processed, it is beneficial to save the power consumption of the processor cores.
- the allocation method for allocating the tasks to be processed to the processor cores with the power management mechanism in the enabled state is not limited either.
- the specific allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the enabled state is similar to the allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the disabled state, see The foregoing implementation manners will not be repeated here.
- the multi-core processor includes multiple processor cores.
- the power management mechanism on some of the processor cores is disabled, and the power management mechanism on the other part of the processor cores is disabled.
- the power management mechanism is in an enabled state, thus forming a heterogeneous multi-core processor.
- the number of processor cores with the power management mechanism in the disabled state can be dynamically changed according to application requirements; accordingly, the number of processor cores with the power management mechanism in the enabled state will also dynamically change according to the application requirements.
- the method of this embodiment further includes: dynamically adjusting the states of the power management mechanisms on the multiple processor cores according to application requirements, so that the processor cores with different power management mechanisms in different states can meet the application requirements.
- the implementation manner of dynamically adjusting the states of the power consumption management mechanisms on multiple processor cores according to application requirements is not limited.
- the following example illustrates:
- the overall processing capacity of the processor cores with the power management mechanism in the disabled state can be monitored, and the overall processing capabilities of the processor cores with the power management mechanism in the disabled state cannot meet the application requirements.
- the overall processing capacity of the processor cores in the disabled state of the mechanism is insufficient, select the processor cores to be disabled from the processor cores with the power management mechanism in the enabled state, and set the power management mechanism on the processor cores to be disabled Disabled.
- the number of processor cores to be disabled may be one or more. This can increase the number of processor cores with the power management mechanism in the disabled state, and increase the overall processing capacity of the processor cores with the power management mechanism in the disabled state, so as to meet application requirements.
- Method A1 In method A1, one or more processor cores can be randomly selected as the processor cores to be disabled from among the processor cores in which the power consumption management mechanism is in the enabled state.
- Manner A2 In Manner A2, all processor cores among the processor cores whose power consumption management mechanism is in the enabled state may be used as processor cores to be disabled.
- Method A4 In method A4, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, according to the processing capabilities of the processor cores, one or more processor cores can be selected as the processor cores to be disabled from the processor cores in which the power management mechanism is in the enabled state. This method A4 is suitable for multi-core processors with different processor cores.
- Embodiment B the overall processing capacity of the processor core with the power management mechanism in the disabled state can be monitored, and the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements and is in excess.
- the number of processor cores to be activated can be one or more.
- the method for selecting the processor core to be activated is not limited, and the following methods can be adopted but not limited to:
- Manner B1 In Manner B1, one or more processor cores can be randomly selected as the processor cores to be enabled from the processor cores in which the power management mechanism is in a disabled state.
- Method B2 In method B2, one or more processor cores can be selected as the to-be-enabled processor cores from the processor cores whose power consumption management mechanism is in the disabled state according to the amount of tasks corresponding to the application requirements.
- Manner B3 In Manner B3, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, one or more processor cores can be selected as the processor cores to be enabled from among the processor cores whose power management mechanism is in a disabled state according to the processing capabilities of the processor cores. This method B3 is suitable for multi-core processors with different processor cores.
- the utilization rate of each processor core whose power management mechanism is disabled can be monitored; according to the utilization rate of each processor core whose power management mechanism is disabled, determine the processor whose power management mechanism is disabled Whether the overall processing capacity of the core meets the application requirements.
- the load of each processor core with the power management mechanism in the disabled state can be monitored; according to the load of each processor core with the power management mechanism in the disabled state, determine the processor with the power management mechanism in the disabled state Whether the overall processing capacity of the core meets the application requirements.
- the utilization rate and load of each processor core whose power management mechanism is disabled can be monitored at the same time; power management can be determined according to the utilization and load of each processor core whose power management mechanism is disabled Whether the overall processing capacity of the processor core with the mechanism in the disabled state meets the application requirements.
- a multi-core processor is used, and the multi-core processor includes multiple processor cores, and the power management mechanism on at least one processor core is in a disabled state; wherein the processor core supports the power management mechanism, Conducive to saving the power consumption of multi-core processors; and disabling the power management mechanism on some processor cores can perform some tasks sensitive to the power management mechanism on these processor cores, which is helpful to ensure the performance requirements of these tasks .
- the execution subject of each step of the method provided in the foregoing embodiment may be the same device, or different devices may also be the execution subject of the method.
- the execution subject of step 201 to step 202 may be device A; for another example, the execution subject of step 201 may be device A, and the execution subject of step 202 may be device B; and so on.
- Fig. 4 is a schematic structural diagram of a computer device provided by an exemplary embodiment of this application.
- the computer device includes: a multi-core processor 41, and the multi-core processor 41 includes a plurality of processor cores 401, wherein the power management mechanism on at least one of the processor cores 401 is disabled.
- This embodiment does not limit the number of processor cores 401 whose power management mechanism is in a disabled state, and it may be one or more.
- the power consumption management mechanisms on 2N ie, an even number
- the number of processor cores 401 whose power management mechanism is in the disabled state may also be an odd number, for example, 1, 3, 5, etc., which is not limited.
- the computer device further includes: a memory 42 for storing computer programs, and can be configured to store various other data to support operations on the computer device. Examples of such data include instructions for any application or method operated on a computer device, contact data, phone book data, messages, pictures, videos, etc.
- the computer program stored in the memory 42 includes a program corresponding to the power consumption management mechanism, and also includes: a program related to task scheduling and a program related to the state adjustment of the power consumption management mechanism.
- the program related to task scheduling is equivalent to the scheduler in the foregoing embodiment, and may be simply referred to as the scheduler.
- the program related to the state adjustment of the power consumption management mechanism is equivalent to the manager in the foregoing embodiment, and may be simply referred to as the management program.
- the scheduler can be an operating system level program or an application level program.
- the management program can be an operating system level program or an application level program.
- the memory 42 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable and Programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
- SRAM static random access memory
- EEPROM electrically erasable programmable read-only memory
- EPROM erasable and Programmable read only memory
- PROM programmable read only memory
- ROM read only memory
- magnetic memory magnetic memory
- flash memory magnetic disk or optical disk.
- the multi-core processor 41 is coupled with the memory 42 and is used to execute the computer program (mainly referring to the scheduler) in the memory 42 for: receiving the task to be processed; in the case that the task to be processed belongs to the first type of task, the The tasks to be processed are allocated to the processor cores whose power management mechanism is disabled. It should be noted that the actual execution of the scheduler may be one or several processor cores 401 in the multi-core processor 41.
- the first type of tasks can be tasks that have certain requirements on performance and are more sensitive to power management mechanisms.
- the first type of tasks can include, but are not limited to: tasks that require high processing delay (for example, require a delay less than the set delay threshold), and have high real-time requirements ( For example, tasks that require response time not to exceed the set response time threshold), and so on.
- some control tasks may have higher real-time requirements.
- some interrupt tasks such as network interrupt processing tasks
- real-time scheduling tasks, instant analysis tasks, and instant query tasks can all be used as examples of the first type of tasks. It should be noted that this embodiment does not limit the first type of tasks, and allows flexible setting according to application scenarios.
- the multi-core processor 41 when the multi-core processor 41 allocates tasks to be processed to the processor cores whose power management mechanism is in the disabled state, it is specifically used to: each processor core whose power management mechanism is in the disabled state The utilization rate of 401 is compared, the utilization rate is lower than the set utilization threshold value or the processor core 401 with the lowest utilization rate is selected from among them, and the task to be processed is allocated to the selected processor core 401.
- the multi-core processor 41 when the multi-core processor 41 allocates tasks to be processed to the processor cores whose power management mechanism is disabled, it is specifically used to: each processor whose power management mechanism is disabled The load of the cores 401 is compared, and the load is lower than the set load threshold or the processor core 401 with the lowest load is selected, and the task to be processed is allocated to the selected processor core 401.
- the multi-core processor 41 when the multi-core processor 41 allocates tasks to be processed to the processor cores whose power management mechanism is disabled, it is specifically used to: each processor whose power management mechanism is disabled The operating frequencies of the cores 401 are compared, and the processor core 401 whose operating frequency is higher than the set frequency threshold or the highest operating frequency is selected, and the tasks to be processed are allocated to the selected processor core 401.
- the multi-core processor 41 when the multi-core processor 41 allocates the task to be processed to the processor core whose power management mechanism is disabled, it is specifically used to: use a hash algorithm to allocate the task to be processed to a certain processor core.
- the power consumption management mechanism is on each processor core 401 in a disabled state.
- the multi-core processor 41 is further configured to: if the task to be processed belongs to the second type of task, allocate the task to be processed to the processor cores whose power management mechanism is in the enabled state.
- the second type of tasks refer to tasks other than the first type of tasks.
- the power management mechanism on some of the processor cores 401 is disabled, and the power management mechanism on the other part of the processor cores 401 is enabled, so Form a heterogeneous multi-core processor.
- the number of processor cores 401 with the power management mechanism in the disabled state and the number of processor cores 401 with the power management mechanism in the enabled state are fixed.
- the power management mechanism on some of the processor cores 401 is disabled, and the power management mechanism on the other part of the processor cores 401 is enabled.
- the number of processor cores 401 with the power management mechanism in the disabled state can be dynamically changed according to application requirements; accordingly, the number of processor cores 401 with the power management mechanism in the enabled state will also be dynamically changed according to the application requirements. Variety.
- the multi-core processor 41 is also used to execute a computer program (mainly refers to a management program) in the memory 42 to dynamically adjust the state of the power consumption management mechanism on the multiple processor cores 401 according to application requirements. It should be noted that the actual execution of the hypervisor may be one or several processor cores 401 in the multi-core processor 41.
- the multi-core processor 41 dynamically adjusts the state of the power management mechanism on the multiple processor cores 401, it is specifically used for: when the overall processing capacity of the processor core whose power management mechanism is disabled cannot meet application requirements In this case, the processor core to be disabled is selected from the processor cores in which the power consumption management mechanism is in the enabled state, and the power consumption management mechanism on the processor core to be disabled is disabled.
- the multi-core processor 41 dynamically adjusts the state of the power management mechanism on the multiple processor cores 401, it is specifically used to: when the power management mechanism is disabled, the overall processing capacity of the processor core meets application requirements and is in excess In the case of, select the processor core to be enabled from the processor cores whose power management mechanism is in a disabled state, and re-enable the power consumption management mechanism on the processor core to be enabled.
- the multi-core processor 41 is also used to: monitor the utilization and/or load of each processor core in the disabled state of the power management mechanism; according to the utilization and/or the utilization of each processor core in the disabled state of the power management mechanism Load, to determine whether the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements.
- the multi-core processor 41 selects the processor cores to be disabled, it is specifically used to: randomly select one or more processor cores as the processor cores to be disabled from the processor cores whose power management mechanism is in the enabled state ; Or, use all the processor cores in the processor cores with the power management mechanism in the enabled state as the processor cores to be disabled; or, according to the task volume corresponding to the application requirements, from the processor cores with the power management mechanism in the enabled state Select one or more processor cores as the processor cores to be disabled; or, according to the processing capabilities of the processor cores, select one or more processor cores from the processor cores in which the power management mechanism is enabled.
- the processor core is to be disabled.
- the multi-core processor 41 selects the processor cores to be enabled, it is specifically used to: randomly select one or more processor cores as the processor cores to be enabled from the processor cores whose power management mechanism is in a disabled state ; Or, according to the task volume corresponding to the application requirements, select one or more processor cores from the processor cores in the disabled state of the power management mechanism as the processor cores to be enabled; or, according to the processing capabilities of the processor cores, From the processor cores in which the power management mechanism is in the disabled state, one or more processor cores are selected as the processor cores to be enabled.
- the computer device further includes: a communication component 43, a display 44, a power supply component 45, an audio component 46 and other components. Only some of the components are schematically shown in FIG. 4, which does not mean that the computer device only includes the components shown in FIG. 4. In addition, the components in the dashed box in FIG. 4 are optional components, not mandatory components, and the specifics may depend on the product form of the computer equipment.
- the computer device in this embodiment can be implemented as a terminal device such as a desktop computer, a notebook computer, a smart phone, or an IOT device, or a server device such as a conventional server, a cloud server, or a server array, and can also be implemented as a network interface card or a network router , Gateways and other network equipment.
- a terminal device such as a desktop computer, a notebook computer, a smart phone, etc.
- it may include the components in the dashed box in FIG. 4;
- the computer device of this embodiment is implemented as a conventional server, a cloud server, or a server array, etc.
- the server device, or implemented as a network device such as a network interface card, a network router, or a gateway, may not include the components in the dashed box in FIG. 4.
- the computer device provided in this embodiment adopts a multi-core processor.
- the multi-core processor includes multiple processor cores, and the power consumption management mechanism on at least one processor core is disabled.
- the processor cores in the multi-core processor support functions.
- the power consumption management mechanism is conducive to saving the power consumption of multi-core processors; and by disabling the power management mechanism on some processor cores, some tasks that are sensitive to the power management mechanism can be performed on these processor cores, which is conducive to ensuring The performance requirements of these tasks. It can be seen that the computer device provided in this embodiment can reduce performance loss as much as possible while reducing overall power consumption, and ensure task execution efficiency.
- an embodiment of the present application also provides a computer-readable storage medium storing a computer program.
- the processor causes the processor to implement the steps in the foregoing method embodiments.
- the computer program in this embodiment may be a system-level program, an application-level program, or both a system-level program and an application-level program.
- the computer program in this embodiment includes a program corresponding to the power consumption management mechanism, and also includes: a program related to task scheduling and a program related to the state adjustment of the power consumption management mechanism.
- the program related to task scheduling is equivalent to the scheduler in the foregoing embodiment, and may be simply referred to as the scheduler.
- the program related to the state adjustment of the power consumption management mechanism is equivalent to the manager in the foregoing embodiment, and may be simply referred to as the management program.
- the scheduler can be an operating system level program or an application level program.
- the management program can be an operating system level program or an application level program.
- the above-mentioned communication component in FIG. 4 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices.
- the device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination of them.
- the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
- the communication component may further include a near field communication (NFC) module, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology Wait.
- NFC near field communication
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- the above-mentioned display in FIG. 4 includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
- the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
- the power supply components in Figure 4 above provide power for various components of the equipment where the power supply components are located.
- the power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.
- the audio component in FIG. 4 may be configured to output and/or input audio signals.
- the audio component includes a microphone (MIC).
- the microphone When the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals.
- the received audio signal can be further stored in a memory or sent via a communication component.
- the audio component further includes a speaker for outputting audio signals.
- the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
- RAM random access memory
- ROM read-only memory
- flash RAM flash memory
- Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
- the information can be computer-readable instructions, data structures, program modules, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
Abstract
A multi-core processor (100) and a scheduling method therefor, a device, and a storage medium. Using a multi-core processor (100), the multi-core processor (100) comprising multiple processing cores (101), and a power consumption management mechanism on at least one of the processing cores (101) being in a disabled state. The processing core (101) supports the power consumption management mechanism, which is conducive to saving the power consumption of the multi-core processor (100); by disabling the power consumption management mechanism on some processing cores (101), tasks that are relatively sensitive to the power consumption management mechanism can be executed on said processing cores (101), ensuring the performance requirements of the tasks. Performance loss can be reduced as much as possible whilst reducing overall power consumption, ensuring the task execution efficiency.
Description
本申请涉及功耗管理技术领域,尤其涉及一种多核处理器及其调度方法、设备及存储介质。This application relates to the technical field of power consumption management, and in particular to a multi-core processor and its scheduling method, device and storage medium.
降低系统功耗的方法有多种,例如动态电源管理(Dynamic Power Management,DPM)和动态电压频率调整技术(Dynamic Voltage and Frequency Scaling,DVFS)等。以DVFS为例,DVFS本质上是一种低功耗技术,目的是根据的CPU当时的实际功耗需要设定工作电压和时钟频率,这样可以保证提供的功率既满足要求又不会性能过剩,从而可以降低功耗。There are many ways to reduce system power consumption, such as Dynamic Power Management (DPM) and Dynamic Voltage and Frequency Scaling (DVFS). Take DVFS as an example. DVFS is essentially a low-power technology. The purpose is to set the operating voltage and clock frequency according to the actual power consumption of the CPU at the time, so as to ensure that the provided power meets the requirements without excessive performance. Thereby power consumption can be reduced.
然而,在有些应用场景中,DVFS及其它技术的使用效果并不是很理想,在降低系统功耗的同时,也会造成系统性能的损失,增加响应延迟。However, in some application scenarios, the effect of DVFS and other technologies is not very satisfactory. While reducing system power consumption, it will also cause loss of system performance and increase response delay.
发明内容Summary of the invention
本申请的多个方面提供一种多核处理器及其调度方法、设备及存储介质,用以在降低系统功耗的情况下,尽量减少性能上的损失,保证任务的执行效率。Various aspects of the present application provide a multi-core processor and its scheduling method, device, and storage medium, which are used to minimize performance loss and ensure task execution efficiency while reducing system power consumption.
本申请实施例提供一种多核处理器,包括:多个处理器核;其中,至少一个处理器核上的功耗管理机制处于禁用状态。An embodiment of the present application provides a multi-core processor, including: a plurality of processor cores; wherein a power consumption management mechanism on at least one processor core is in a disabled state.
本申请实施例还提供一种多核处理器调度方法,包括:接收待处理任务;在所述待处理任务属于第一类任务的情况下,将所述待处理任务分配到所述多核处理器中功耗管理机制处于禁用状态的处理器核上;其中,所述多核处 理器包括多个处理器核,其中,至少一个处理器核上的功耗管理机制处于禁用状态。The embodiment of the present application also provides a multi-core processor scheduling method, including: receiving a task to be processed; in the case that the task to be processed belongs to the first type of task, allocating the task to be processed to the multi-core processor The power consumption management mechanism is on a processor core in a disabled state; wherein the multi-core processor includes a plurality of processor cores, and the power consumption management mechanism on at least one processor core is in a disabled state.
本申请实施例还提供一种计算机设备,包括:多核处理器;所述多核处理器包括多个处理器核;其中,至少一个处理器核上的功耗管理机制处于禁用状态。An embodiment of the present application also provides a computer device, including: a multi-core processor; the multi-core processor includes a plurality of processor cores; wherein the power consumption management mechanism on at least one of the processor cores is in a disabled state.
本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,当所述计算机程序被处理器执行时,致使所述处理器实现本申请实施例提供的多核处理器调度方法中的步骤。The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to implement the steps in the multi-core processor scheduling method provided by the embodiment of the present application. .
在本申请实施例中,采用多核处理器,多核处理器包括多个处理器核,且至少一个处理器核上的功耗管理机制处于禁用状态,该多核处理器中的处理器核支持功耗管理机制,有利于节约多核处理器的功耗;而通过禁用一些处理器核上的功耗管理机制,可在这些处理器核上执行一些对功耗管理机制比较敏感的任务,有利于保证这些任务的性能要求。由此可见,本申请实施例可在降低整体功耗的情况下,尽量减少性能上的损失,保证任务的执行效率。In the embodiment of the present application, a multi-core processor is used. The multi-core processor includes multiple processor cores, and the power consumption management mechanism on at least one processor core is disabled. The processor cores in the multi-core processor support power consumption. The management mechanism is conducive to saving the power consumption of multi-core processors; and by disabling the power management mechanism on some processor cores, some tasks that are sensitive to the power management mechanism can be executed on these processor cores, which is beneficial to ensure these The performance requirements of the task. It can be seen that the embodiment of the present application can reduce the performance loss as much as possible while reducing the overall power consumption, and ensure the execution efficiency of the task.
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are used to explain the application, and do not constitute an improper limitation of the application. In the attached picture:
图1a为本申请示例性实施例提供的一种多核处理器的结构示意图;FIG. 1a is a schematic structural diagram of a multi-core processor provided by an exemplary embodiment of this application;
图1b为本申请示例性实施例提供的另一种多核处理器的结构示意图;FIG. 1b is a schematic structural diagram of another multi-core processor provided by an exemplary embodiment of this application;
图1c为本申请示例性实施例提供的一种处理器核上的功耗管理机制的状态变化示意图;FIG. 1c is a schematic diagram of state changes of a power consumption management mechanism on a processor core provided by an exemplary embodiment of this application;
图2为本申请示例性实施例提供的一种多核处理器调度方法的流程示意图;2 is a schematic flowchart of a multi-core processor scheduling method provided by an exemplary embodiment of this application;
图3为本申请示例性实施例提供的另一种多核处理器调度方法的流程示意图;FIG. 3 is a schematic flowchart of another multi-core processor scheduling method provided by an exemplary embodiment of this application;
图4为本申请示例性实施例提供的一种计算机设备的结构示意图。Fig. 4 is a schematic structural diagram of a computer device provided by an exemplary embodiment of this application.
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
针对现有功耗管理机制会造成系统性能的损失,增加响应延迟等技术问题,在本申请一些实施例中,采用多核处理器,多核处理器包括多个处理器核,且至少一个处理器核上的功耗管理机制处于禁用状态;其中,处理器核支持功耗管理机制,有利于节约多核处理器的功耗;而禁用一些处理器核上的功耗管理机制,可在这些处理器核上执行一些对功耗管理机制比较敏感的任务,有利于保证这些任务的性能要求。由此可见,本申请实施例可在降低整体功耗的情况下,尽量减少性能上的损失,保证任务的执行效率。In view of technical problems such as loss of system performance caused by the existing power consumption management mechanism and increased response delay, in some embodiments of the present application, a multi-core processor is used, and the multi-core processor includes multiple processor cores, and at least one processor core The power management mechanism on the CPU is in a disabled state; among them, the processor core supports the power management mechanism, which is conducive to saving the power consumption of multi-core processors; and the power management mechanism on some processor cores is disabled, which can be used in these processor cores. Performing some tasks that are more sensitive to the power management mechanism is conducive to ensuring the performance requirements of these tasks. It can be seen that the embodiment of the present application can reduce the performance loss as much as possible while reducing the overall power consumption, and ensure the execution efficiency of the task.
以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
图1a为本申请示例性实施例提供的一种多核处理器的结构示意图。如图1a所示,该多核处理器100包括:多个处理器核(Core)101。多个是指两个或两个以上。处理器核是多核处理器的重要的组成部分。Fig. 1a is a schematic structural diagram of a multi-core processor provided by an exemplary embodiment of this application. As shown in FIG. 1a, the multi-core processor 100 includes a plurality of processor cores (Core) 101. Multiple refers to two or more. The processor core is an important part of a multi-core processor.
在本实施例中,并不限定多核处理器100和处理器核101的实现形态。根据处理器核101实现形态的不同,多核处理器100也会有不同的实现形态。例如,处理器核101可以是CPU核,则多核处理器100可以实现为多核CPU。又例如,处理器核101可以是GPU核,则多核处理器100可实现为多核GPU。当然,随着处理器技术的发展,本实施例中的处理器核101也可以实现为其 它具有信息处理和程序执行能力的芯片核,相应地,多核处理器100也可实现为具有相应功能的多核芯片。In this embodiment, the implementation form of the multi-core processor 100 and the processor core 101 is not limited. According to the different implementation forms of the processor core 101, the multi-core processor 100 will also have different implementation forms. For example, the processor core 101 may be a CPU core, and the multi-core processor 100 may be implemented as a multi-core CPU. For another example, the processor core 101 may be a GPU core, and the multi-core processor 100 may be implemented as a multi-core GPU. Of course, with the development of processor technology, the processor core 101 in this embodiment can also be implemented as other chip cores with information processing and program execution capabilities. Correspondingly, the multi-core processor 100 can also be implemented as a chip with corresponding functions. Multi-core chips.
在本实施例中,多核处理器100的处理器核支持功耗管理机制;功耗管理机制是对处理器核101进行功耗管理的机制,可动态调节处理器核101的功耗,达到节约功耗的目的。根据多核处理器100实现形态的不同,处理器核101支持的功耗管理机制会有所不同。下面对处理器核101支持的功耗管理机制进行举例说明:In this embodiment, the processor core of the multi-core processor 100 supports a power management mechanism; the power management mechanism is a mechanism for power management of the processor core 101, which can dynamically adjust the power consumption of the processor core 101 to achieve savings The purpose of power consumption. According to different implementation forms of the multi-core processor 100, the power management mechanism supported by the processor core 101 will be different. The following is an example of the power management mechanism supported by the processor core 101:
在一可选实施例中,处理器核101支持的功耗管理机制包括DVFS和C-state。在另一可选实施例中,处理器核101支持的功耗管理机制仅包括DVFS。在又一可选实施例中,处理器核101支持的功耗管理机制仅包括C-state。DVFS和C-sate属于操作系统级的功耗管理机制,需要运行在内核态,简称为内核态的功耗管理机制。In an optional embodiment, the power management mechanism supported by the processor core 101 includes DVFS and C-state. In another optional embodiment, the power consumption management mechanism supported by the processor core 101 only includes DVFS. In another optional embodiment, the power consumption management mechanism supported by the processor core 101 only includes C-state. DVFS and C-sate belong to the operating system-level power management mechanism and need to run in the kernel mode, which is referred to as the power management mechanism in the kernel mode for short.
其中,DVFS是根据处理器核11所运行的应用程序对计算能力的不同需要,动态调节处理器核11的运行频率和电压,从而达到节能目的的一种动态技术。对于同一处理器核11来说,其运行频率越高,需要的电压也越高,能耗越大;反之,其运行频率越低,需要的电压也越低,能耗越小。但是,频率的调整通常与负载有关,一般不是实时的,调整速度可能会比较慢。Among them, DVFS is a dynamic technology that dynamically adjusts the operating frequency and voltage of the processor core 11 according to the different needs of the computing power of the application program that the processor core 11 runs, so as to achieve the purpose of energy saving. For the same processor core 11, the higher the operating frequency, the higher the required voltage, and the greater the energy consumption; on the contrary, the lower the operating frequency, the lower the required voltage and the lower the energy consumption. However, the frequency adjustment is usually related to the load, and is generally not real-time, and the adjustment speed may be relatively slow.
其中,C-state是一种可以让处理器核11在空闲状态时进入低功耗状态的低功耗机制,C-states包含的C模式从C0开始一直到Cn,C0是处理器核11的正常工作模式,处理器核11处于正常运行状态;C后n的取值越高,处理器核11睡眠的越深,处理器核11的功耗越小,当然也就需要更多的时间返回到C0模式;其中,n是正整数。Among them, C-state is a low-power mechanism that allows the processor core 11 to enter a low-power state when it is idle. The C mode included in C-states starts from C0 to Cn, and C0 is the processor core 11 In normal working mode, the processor core 11 is in a normal operating state; the higher the value of n after C, the deeper the sleep of the processor core 11, the lower the power consumption of the processor core 11, and of course it takes more time to return To C0 mode; where n is a positive integer.
需要说明的是,处理器核101支持的功耗管理机制可以包括操作系统级的功耗管理机制,也可以包括应用级的功耗管理机制。另外,对于同一处理器核101来说,其支持的功耗管理机制可以包括一种,也可以包括多种。对于不同处理器核101来说,所支持的功耗管理机制可以完全相同,也可以部分相同,也可以完全不相同。It should be noted that the power management mechanism supported by the processor core 101 may include an operating system-level power management mechanism, and may also include an application-level power management mechanism. In addition, for the same processor core 101, the power consumption management mechanism supported by it may include one or more. For different processor cores 101, the supported power management mechanisms may be completely the same, may also be partially the same, or may be completely different.
在本实施例中,处理器核101支持功耗管理机制,在功耗管理机制处于启用状态时,可根据处理器核101对计算能力的需求、负载情况或忙碌程度等,动态调节处理器核101的频率或硬件电路的状态等(这里动态调整的对象可视具体功耗管理机制而定),有利于降低处理器核101的功耗,进而降低多核处理器100的整体功耗。In this embodiment, the processor core 101 supports a power management mechanism. When the power management mechanism is enabled, the processor core can be dynamically adjusted according to the computing power demand, load condition, or busyness of the processor core 101. The frequency of 101 or the state of the hardware circuit, etc. (the object of dynamic adjustment may be determined by the specific power consumption management mechanism), which is beneficial to reduce the power consumption of the processor core 101, thereby reducing the overall power consumption of the multi-core processor 100.
但是,在实际应用中,有些任务对性能要求较高,其性能对C-state或DVFS等功耗管理机制比较敏感。如果在C-state或DVFS等功耗管理机制处于启用状态的情况下执行这些任务,这些任务的性能会被降低或无法得到保证;如果全部关闭C-state或DVFS等功耗管理机制,意味着整体能耗将会提升。鉴于此,在本实施例中,至少一个处理器核101上的功耗管理机制处于禁用状态,这些功耗管理机制处于禁用状态的处理器核101会一直运行在设定的工作频率下,不会进入空闲状态(idle state),这里不会进入空闲状态实际上是指不会进入低功耗模式或也不会运行在低于设定工作频率的其它频率下,因此可以提供较优的性能。其中,为处理器核101设定的工作频率越高,处理器核101的处理速度越快,性能也会越高。其中,可根据性能要求灵活地为处理器核101设定工作频率。例如,设定的工作频率可以是处理器核101的最高工作频率,则在处理器核101上的功耗管理机制处于禁用状态的情况下,处理器核101会一直运行在最高工作频率下,进可带来最优的性能。另外,可以为不同处理器核101设定相同的工作频率,也可以为不同处理器核101设定不同的工作频率。其中,在这些功耗管理机制处于禁用状态的处理器核101上执行这些任务,可克服功耗管理机制给这些任务带来的性能上的不利影响,有利于满足这些任务的性能要求。However, in practical applications, some tasks have higher performance requirements, and their performance is more sensitive to power management mechanisms such as C-state or DVFS. If these tasks are executed with power management mechanisms such as C-state or DVFS enabled, the performance of these tasks will be reduced or cannot be guaranteed; if all power management mechanisms such as C-state or DVFS are turned off, it means The overall energy consumption will increase. In view of this, in this embodiment, the power management mechanism on at least one processor core 101 is in a disabled state, and the processor cores 101 with these power management mechanisms in a disabled state will always run at the set operating frequency. Will enter the idle state (idle state), here does not enter the idle state actually means that it will not enter the low-power mode or will not run at other frequencies lower than the set operating frequency, so it can provide better performance . Among them, the higher the operating frequency set for the processor core 101, the faster the processing speed of the processor core 101 and the higher the performance. Among them, the operating frequency can be flexibly set for the processor core 101 according to performance requirements. For example, the set operating frequency may be the highest operating frequency of the processor core 101, and when the power management mechanism on the processor core 101 is disabled, the processor core 101 will always run at the highest operating frequency. Advance can bring optimal performance. In addition, the same operating frequency can be set for different processor cores 101, or different operating frequencies can be set for different processor cores 101. Among them, executing these tasks on the processor core 101 in which the power management mechanism is in a disabled state can overcome the adverse effect of the power management mechanism on the performance of these tasks, and is beneficial to satisfy the performance requirements of these tasks.
在本申请实施例中,并不限定功耗管理机制处于禁用状态的处理器核101的数量,可以是一个,也可以是多个。在一可选实施例中,在同一时刻,由2N个(即偶数个)处理器核101上的功耗管理机制处于禁用状态;N是正整数。当然,在同一时刻,功耗管理机制处于禁用状态的处理器核101的数量也可以是奇数个,例如,1个、3个、5个等,对此不做限定。In the embodiment of the present application, the number of processor cores 101 whose power management mechanism is in a disabled state is not limited, and there may be one or more. In an optional embodiment, at the same time, the power consumption management mechanisms on 2N (ie, even number) processor cores 101 are in a disabled state; N is a positive integer. Of course, at the same moment, the number of processor cores 101 with the power management mechanism in the disabled state may also be an odd number, for example, 1, 3, 5, etc., which is not limited.
在一可选实施例中,如图1b所示,多核处理器100的多个处理器核101上运行有调度器102。具体地,该调度器102可以运行于任何一个或几个处理器核101上。当然,运行有调度器102的处理器核101除了运行调度器102之外,其剩余处理能力也可以用来执行其它任务。另外,调度器102是软件形式的调度器,是运行于多个处理器核101上的程序,主要负责对多个处理器核101进行任务调度。调度器102可以是多核处理器100的操作系统(OS)级的程序,也可以是应用级别的程序(例如应用程序),对此不做限定。在图1b中,以调度器属于OS级的程序为例进行图示,但并不限于此。In an alternative embodiment, as shown in FIG. 1b, a scheduler 102 runs on multiple processor cores 101 of the multi-core processor 100. Specifically, the scheduler 102 can run on any one or several processor cores 101. Of course, in addition to running the scheduler 102 on the processor core 101 running the scheduler 102, its remaining processing capacity can also be used to perform other tasks. In addition, the scheduler 102 is a software scheduler, which is a program running on multiple processor cores 101 and is mainly responsible for task scheduling on the multiple processor cores 101. The scheduler 102 may be an operating system (OS) level program of the multi-core processor 100, or an application level program (for example, an application program), which is not limited. In FIG. 1b, a program in which the scheduler belongs to the OS level is taken as an example for illustration, but it is not limited to this.
在本实施例中,调度器102可接收待处理任务,判断待处理任务的类型;并在判断出待处理任务属于第一类任务的情况下,将待处理任务分配到功耗管理机制处于禁用状态的处理器核101上,由功耗管理机制处于禁用状态的处理器核101负责执行待处理任务。由于功耗管理机制处于禁用状态的处理器核101不会进入空闲状态,会运行在设定的工作频率下,由这类处理器核101执行待处理任务,不会因功耗管理机制而产生延迟,可及时对待处理任务进行处理,可保证待处理任务不受功耗管理机制的影响,提高待处理任务的执行效率,保证待处理任务的性能。In this embodiment, the scheduler 102 can receive the task to be processed, determine the type of the task to be processed; and in the case of determining that the task to be processed belongs to the first type of task, assign the task to be processed to the power management mechanism is disabled On the processor core 101 in the state, the processor core 101 whose power management mechanism is in the disabled state is responsible for executing tasks to be processed. Because the processor core 101 with the power management mechanism in the disabled state will not enter the idle state, it will run at the set operating frequency, and this type of processor core 101 will perform pending tasks, and will not be generated by the power management mechanism. Delay, can process the task to be processed in time, can ensure that the task to be processed is not affected by the power management mechanism, improve the execution efficiency of the task to be processed, and ensure the performance of the task to be processed.
其中,第一类任务可以是一些对性能有一定要求,对功耗管理机制较为敏感的任务。例如,从性能要求的角度来看,第一类任务可以包括但不限于:对处理时延要求较高(例如要求时延小于设定的时延阈值)的任务,对实时性要求较高(例如要求响应时间不能超过设定的响应时间阈值)的任务,等等。例如,一些控制类任务可能对实时性要求较高。又例如,一些中断类任务(例如网络中断处理任务)对时延要求较高。另外,即时分析类任务、即时查询类任务等都可作为第一类任务的示例。需要说明的是,本实施例并不对第一类任务进行限定,允许根据应用场景灵活设定。Among them, the first type of tasks can be tasks that have certain requirements on performance and are more sensitive to power management mechanisms. For example, from the perspective of performance requirements, the first type of tasks can include, but are not limited to: tasks that require high processing delay (for example, require a delay less than the set delay threshold), and have high real-time requirements ( For example, tasks that require response time not to exceed the set response time threshold), and so on. For example, some control tasks may have higher real-time requirements. For another example, some interrupt tasks (such as network interrupt processing tasks) have higher requirements for time delay. In addition, instant analysis tasks, instant query tasks, etc. can be used as examples of the first type of tasks. It should be noted that this embodiment does not limit the first type of tasks, and allows flexible setting according to application scenarios.
在本实施例中,并不限定调度器102将待处理任务分配到功耗管理机制处于禁用状态的处理器核101上的分配方式。下面对分配方式进行举例说明:In this embodiment, there is no limitation on the allocation manner in which the scheduler 102 allocates to-be-processed tasks to the processor cores 101 whose power management mechanism is in the disabled state. The following is an example of the allocation method:
例如,在一种实施方式中,调度器102可以将功耗管理机制处于禁用状 态的各处理器核101的利用率进行比较,从中选择利用率低于设定利用率阈值或者从中选择利用率最低的处理器核101,将待处理任务分配给所选择的处理器核101。其中,处理器核101利用率较低,说明处理器核101相对轻松或性能较优,由功耗管理机制处于禁用状态的处理器核101中相对轻松或性能较优的处理器核101执行待处理任务,在保证任务性能的情况下,有利于进一步提高待处理任务的执行效率。For example, in one embodiment, the scheduler 102 may compare the utilization rates of the processor cores 101 whose power management mechanism is disabled, and select the utilization rate to be lower than the set utilization threshold value or select the lowest utilization rate among them. The processor core 101 of the processor allocates the task to be processed to the selected processor core 101. Among them, the utilization rate of the processor core 101 is low, indicating that the processor core 101 is relatively easy or has better performance. Among the processor cores 101 with the power management mechanism in the disabled state, the processor core 101 that is relatively easy or has the better performance is executed. Processing tasks, while ensuring task performance, is conducive to further improving the execution efficiency of the tasks to be processed.
又例如,在一种实施方式中,调度器102可以将功耗管理机制处于禁用状态的各处理器核101的负载量进行比较,从中选择负载量低于设定负载量阈值或从中选择负载量最低的处理器核101,将待处理任务分配给所选择的处理器核101。其中,处理器核101的负载量相对较低,说明处理器核101相对轻松,计算资源充足,由功耗管理机制处于禁用状态的处理器核101中相对轻松的处理器核101执行待处理任务,在保证任务性能的情况下,有利于进一步提高待处理任务的执行效率。For another example, in an embodiment, the scheduler 102 may compare the load of each processor core 101 whose power management mechanism is disabled, and select the load to be lower than the set load threshold or select the load from it. The lowest processor core 101 allocates the task to be processed to the selected processor core 101. Among them, the load of the processor core 101 is relatively low, indicating that the processor core 101 is relatively easy and has sufficient computing resources. The relatively easy processor core 101 among the processor cores 101 whose power management mechanism is disabled performs the tasks to be processed. , Under the condition of ensuring task performance, it is helpful to further improve the execution efficiency of the task to be processed.
其中,可以根据各处理器核101的任务队列中正在排队的任务信息来确定各处理器核101的负载量。例如,可以依据任务队列中正在排队的任务数量来确定各处理器核101的负载量。一般来说,正在排队的任务数量越高,对应处理器核101的负载量就越大。又例如,也可以依据任务队列中正在排队的任务优先级来确定各处理器核101的负载量。一般来说,正在排队的任务优先级越高,对应处理器核101的负载量就越大。又例如,也可以同时依据任务队列中正在排队的任务数量和优先级来确定各处理器核101的负载量。一般来说,例如可以对正在排队的任务数量和优先级进行加权求和,得到对应处理器核101的负载量;加权求和的结果越大,意味着处理器核101的负载量越大。Wherein, the load of each processor core 101 can be determined according to the task information being queued in the task queue of each processor core 101. For example, the load of each processor core 101 can be determined according to the number of tasks being queued in the task queue. Generally speaking, the higher the number of tasks being queued, the greater the load of the corresponding processor core 101. For another example, the load of each processor core 101 can also be determined according to the priority of the task being queued in the task queue. Generally speaking, the higher the priority of the task being queued, the greater the load of the corresponding processor core 101. For another example, the load of each processor core 101 can also be determined according to the number and priority of the tasks being queued in the task queue at the same time. Generally speaking, for example, a weighted summation of the number and priority of the tasks being queued can be performed to obtain the load of the corresponding processor core 101; the larger the result of the weighted summation, the greater the load of the processor core 101.
又例如,在一种实施方式中,功耗管理机制处于禁用状态的各处理器核101的工作频率不完全相同。基于此,调度器102可以将功耗管理机制处于禁用状态的各处理器核101的工作频率进行比较,从中选择工作频率高于设定频率阈值或工作频率最高的处理器核101,将待处理任务分配给所选择的处理 器核101。其中,处理器核101的工作频率相对较高,说明处理器核101的处理速度相对较快,由功耗管理机制处于禁用状态的处理器核101中处理速度较快的处理器核101执行待处理任务,在保证任务性能的情况下,有利于进一步提高待处理任务的执行效率。For another example, in an implementation manner, the operating frequencies of the processor cores 101 whose power management mechanism is in a disabled state are not completely the same. Based on this, the scheduler 102 can compare the operating frequencies of the processor cores 101 whose power management mechanism is disabled, and select the processor core 101 whose operating frequency is higher than the set frequency threshold or the highest operating frequency to be processed. Tasks are assigned to the selected processor core 101. Among them, the operating frequency of the processor core 101 is relatively high, indicating that the processing speed of the processor core 101 is relatively fast. Processing tasks, while ensuring task performance, is conducive to further improving the execution efficiency of the tasks to be processed.
又例如,在一种实施方式中,调度器102可以采用哈希算法将待处理任务分配到某个功耗管理机制处于禁用状态的各处理器核101上。For another example, in an implementation manner, the scheduler 102 may use a hash algorithm to allocate the tasks to be processed to each of the processor cores 101 whose power management mechanism is disabled.
在此说明,在上述几种实施方式中,在将待处理任务分配给功耗管理机制处于禁用状态的处理器核101的过程中,单独地依据处理器核101的利用率、负载量或工作频率。当然,也可以同时结合处理器核101的利用率、负载量和工作频率中任意两种或三种,来确定将待处理任务分配给哪个功耗管理机制处于禁用状态的处理器核101。另外,除了上述三种信息之外,还可以考虑处理器核101的其它指标或属性信息,例如还可以考虑处理器核101的缓存大小、总线速度和/或工作电压等。It is explained here that in the above-mentioned several implementation manners, in the process of allocating tasks to be processed to the processor cores 101 whose power management mechanism is in a disabled state, it is solely based on the utilization, load, or work of the processor cores 101. frequency. Of course, any two or three of the utilization, load, and operating frequency of the processor core 101 can also be combined simultaneously to determine which processor core 101 whose power management mechanism is in a disabled state to allocate the task to be processed. In addition, in addition to the above three types of information, other indicators or attribute information of the processor core 101 may also be considered. For example, the cache size, bus speed, and/or operating voltage of the processor core 101 may also be considered.
进一步,在本申请一些实施例中,可结合多核处理器100的应用场景,根据应用场景中各任务的性能要求,预先将各任务分类为第一类任务和第二类任务。其中,第二类任务是指除第一类任务之外的其它任务。关于第一类任务的描述可参见上文中的描述,在此不再赘述。进一步,可维护任务的标识信息与任务类型之间的映射关系,可选地,该映射关系中包括第一类任务下各任务的标识信息,或者包括第二类任务下各任务的标识信息,或者同时包括第一类任务下各任务的标识信息和第二类任务下各任务的标识信息。基于此,调度器102在接收到待处理任务之后,可以将待处理任务的标识信息在所维护的任务的标识信息与任务类型之间的映射关系中进行匹配,根据匹配结果得到待处理任务属于第一类任务或属于第二类任务的判断结果。Further, in some embodiments of the present application, the application scenarios of the multi-core processor 100 may be combined to pre-categorize each task into the first type of task and the second type of task according to the performance requirements of each task in the application scenario. Among them, the second type of tasks refer to tasks other than the first type of tasks. For the description of the first type of task, please refer to the above description, which will not be repeated here. Further, the mapping relationship between the identification information of the task and the task type can be maintained. Optionally, the mapping relationship includes the identification information of each task under the first type of task, or includes the identification information of each task under the second type of task, Or include the identification information of each task under the first type of task and the identification information of each task under the second type of task at the same time. Based on this, after receiving the task to be processed, the scheduler 102 can match the identification information of the task to be processed in the mapping relationship between the identification information of the task to be maintained and the task type, and according to the matching result, it is obtained that the task to be processed belongs to The judgment result of the first type of task or the second type of task.
进一步可选地,若判断出待处理任务属于第二类任务,不属于第一类任务,则可以将待处理任务分配到功耗管理机制处于启用状态的处理器核101上,由这些功耗管理机制处于启用状态的处理器核101负责执行待处理任务。 借助于这些处理器核101上的功耗管理机制,在完成待处理任务的同时,有利于节约处理器核101的功耗。Further optionally, if it is determined that the task to be processed belongs to the second type of task and does not belong to the first type of task, the task to be processed can be allocated to the processor core 101 whose power consumption management mechanism is enabled. The processor core 101 whose management mechanism is in an enabled state is responsible for executing tasks to be processed. With the help of the power consumption management mechanism on the processor core 101, the power consumption of the processor core 101 can be saved while the tasks to be processed are completed.
同理,在本申实施例中,也不限定将待处理任务分配到功耗管理机制处于启用状态的处理器核101上的分配方式。将待处理任务分配到功耗管理机制处于启用状态的处理器核上的具体分配方式,与将待处理任务分配到功耗管理机制处于禁用状态的处理器核上的分配方式相类似,可参见上述实施方式,在此不再赘述。In the same way, in this embodiment of the present application, the allocation method of allocating tasks to be processed to the processor cores 101 whose power management mechanism is in the enabled state is not limited. The specific allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the enabled state is similar to the allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the disabled state, see The foregoing implementation manners will not be repeated here.
在本申请一些实施例中,多核处理器100包括多个处理器核101,在多个处理器核101中,有一部分处理器核101上的功耗管理机制处于禁用状态,另一部分处理器核101上的功耗管理机制处于启用状态,从而形成异构多核处理器。在这些实施例中,功耗管理机制处于禁用状态的处理器核101的数量和功耗管理机制处于启用状态的处理器核101的数量是固定不变的。In some embodiments of the present application, the multi-core processor 100 includes multiple processor cores 101. Among the multiple processor cores 101, some of the processor cores 101 have a power management mechanism in a disabled state, and the other part of the processor cores is disabled. The power consumption management mechanism on 101 is in an enabled state, thus forming a heterogeneous multi-core processor. In these embodiments, the number of processor cores 101 with the power management mechanism in the disabled state and the number of processor cores 101 with the power management mechanism in the enabled state are fixed.
例如,假设一多核处理器包括4个处理器核,其中,2个处理器核上的功耗管理机制处于禁用状态,且这2个处理器核上的功耗管理机制会一直处于禁用状态;另外2个处理器核上的功耗管理机制处于启用状态,且这2个处理器核上的功耗管理机制会一直处于启用状态。For example, suppose a multi-core processor includes 4 processor cores, of which the power management mechanism on 2 processor cores is disabled, and the power management mechanism on these 2 processor cores will always be disabled ; The power management mechanism on the other two processor cores is in the enabled state, and the power management mechanism on the two processor cores will always be in the enabled state.
又例如,一多核处理器包括6个处理器核,其中,3个处理器核上的功耗管理机制处于禁用状态,且这3个处理器核上的功耗管理机制会一直处于禁用状态;另外3个处理器核上的功耗管理机制处于启用状态,且这3个处理器核上的功耗管理机制会一直处于启用状态。For another example, a multi-core processor includes 6 processor cores, of which, the power management mechanisms on 3 processor cores are disabled, and the power management mechanisms on these 3 processor cores will always be disabled ; The power management mechanisms on the other three processor cores are in the enabled state, and the power management mechanisms on the three processor cores will always be in the enabled state.
又例如,一多核处理器包括4个处理器核,其中,1个处理器核上的功耗管理机制处于禁用状态,且这个处理器核上的功耗管理机制会一直处于禁用状态;另外3个处理器核上的功耗管理机制处于启用状态,且这3个处理器核上的功耗管理机制会一直处于启用状态。For another example, a multi-core processor includes 4 processor cores, of which, the power management mechanism on one processor core is disabled, and the power management mechanism on this processor core will always be disabled; in addition, The power management mechanisms on the three processor cores are in an enabled state, and the power management mechanisms on the three processor cores will always be in an enabled state.
在本申请另一些实施例中,多核处理器100包括多个处理器核101,在多 个处理器核101中,有一部分处理器核101上的功耗管理机制处于禁用状态,另一部分处理器核101上的功耗管理机制处于启用状态,从而形成异构多核处理器。在这些实施例中,功耗管理机制处于禁用状态的处理器核101的数量可根据应用需求动态变化;相应地,功耗管理机制处于启用状态的处理器核101的数量也会根据应用需求动态变化。这里的应用需求主要是指由对功耗管理机制比较敏感的第一类任务产生的需求。基于此,如图1b所示,多核处理器100还包括管理器103。管理器103主要用于根据应用需求动态调整多个处理器核101上的功耗管理机制的状态,从而达到功耗管理机制处于禁用状态的处理器核101的数量根据应用需求动态变化的目的。其中,功耗管理机制的状态包括禁用状态和启用状态两种。管理器103调整处理器核101上的功耗管理机制的状态包括:将处理器核101上的功耗管理机制从禁用状态调整为启用状态,或者将处理器核101上的功耗管理机制从启用状态调整为禁用状态。In some other embodiments of the present application, the multi-core processor 100 includes multiple processor cores 101. Among the multiple processor cores 101, some of the processor cores 101 have a power management mechanism in a disabled state, and some of the processor cores 101 are disabled. The power consumption management mechanism on the core 101 is in an enabled state, thereby forming a heterogeneous multi-core processor. In these embodiments, the number of processor cores 101 whose power management mechanism is in a disabled state can be dynamically changed according to application requirements; accordingly, the number of processor cores 101 whose power management mechanism is in an enabled state will also be dynamically changed according to application requirements. Variety. The application requirements here mainly refer to the requirements generated by the first type of tasks that are more sensitive to the power management mechanism. Based on this, as shown in FIG. 1b, the multi-core processor 100 further includes a manager 103. The manager 103 is mainly used to dynamically adjust the state of the power management mechanism on the multiple processor cores 101 according to application requirements, so as to achieve the purpose of dynamically changing the number of processor cores 101 with the power management mechanism in the disabled state according to the application requirements. Among them, the state of the power management mechanism includes two states: a disabled state and an enabled state. The manager 103 adjusting the state of the power management mechanism on the processor core 101 includes: adjusting the power management mechanism on the processor core 101 from a disabled state to an enabled state, or changing the power management mechanism on the processor core 101 from a disabled state to an enabled state. The enabled state is adjusted to the disabled state.
其中,管理器103是软件形式的管理器,是运行于多个处理器核101上的程序。具体地,该管理器103可以运行于任何一个或几个处理器核101上。当然,运行有管理器103的处理器核101除了运行管理器103之外,其剩余处理能力也可以用来执行其它任务。另外,管理器103可以是多核处理器100的操作系统(OS)级的程序,也可以是应用级别的程序(例如应用程序),对此不做限定。在图1b中,以管理器103属于OS级的程序为例进行图示,但并不限于此。Among them, the manager 103 is a manager in the form of software, and is a program running on multiple processor cores 101. Specifically, the manager 103 can run on any one or several processor cores 101. Of course, in addition to running the manager 103, the remaining processing capacity of the processor core 101 running the manager 103 can also be used to perform other tasks. In addition, the manager 103 may be an operating system (OS) level program of the multi-core processor 100, or an application level program (for example, an application program), which is not limited. In FIG. 1b, a program of the manager 103 belonging to the OS level is taken as an example for illustration, but it is not limited to this.
在本申请实施例中,并不限定管理器103根据应用需求动态调整多个处理器核101上的功耗管理机制的状态的实施方式。下面举例说明:In the embodiment of the present application, the implementation manner in which the manager 103 dynamically adjusts the state of the power consumption management mechanism on the multiple processor cores 101 according to application requirements is not limited. The following example illustrates:
例如,在实施方式A中,管理器103可以监控功耗管理机制处于禁用状态的处理器核的整体处理能力,在功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求,即功耗管理机制处于禁用状态的处理器核的整体处理能力不足的情况下,从功耗管理机制处于启用状态的处理器核中选择待禁用处理器核,并将待禁用处理器核上的功耗管理机制禁用。其中, 待禁用处理器核的数量可以是一个,也可以是多个。这可以增加功耗管理机制处于禁用状态的处理器核的数量,增加功耗管理机制处于禁用状态的处理器核的整体处理能力,以便满足应用需求。For example, in Embodiment A, the manager 103 can monitor the overall processing capacity of the processor cores whose power management mechanism is disabled. When the power management mechanism is disabled, the overall processing capabilities of the processor cores cannot meet application requirements. That is, when the overall processing capacity of the processor core with the power management mechanism in the disabled state is insufficient, select the processor cores to be disabled from the processor cores with the power management mechanism in the enabled state, and set the processor cores on the processor cores to be disabled. The power management mechanism is disabled. Wherein, the number of processor cores to be disabled may be one or more. This can increase the number of processor cores with the power management mechanism in the disabled state, and increase the overall processing capacity of the processor cores with the power management mechanism in the disabled state, so as to meet application requirements.
在本实施方式中,并不限定管理器103选择待禁用处理器核的方式,可以采用但不限于以下几种方式:In this embodiment, the manner in which the manager 103 selects the processor core to be disabled is not limited, and the following manners can be used but not limited to:
方式A1:在方式A1中,可以从功耗管理机制处于启用状态的处理器核中,随机选择一个或多个处理器核作为待禁用处理器核。该方式相对简单,易于实施,效率较高。该方式A1适用于各种类型的多核处理器,尤其适用于处理器核完全相同的多核处理器,例如X86处理器。Method A1: In method A1, one or more processor cores can be randomly selected as the processor cores to be disabled from among the processor cores in which the power consumption management mechanism is in the enabled state. This method is relatively simple, easy to implement, and highly efficient. This method A1 is suitable for various types of multi-core processors, especially suitable for multi-core processors with exactly the same processor cores, such as X86 processors.
在方式A1中,可以预先设定允许每次选择的待禁用处理器核的数量。假设,预先设定该数量为1个、2个或4个等,则每次可以从功耗管理机制处于启用状态的处理器核中,随机选择1个、2个或4个处理器核作为待禁用处理器核。In method A1, the number of processor cores to be disabled that are allowed to be selected each time can be preset. Assuming that the number is preset to 1, 2, or 4, etc., one, 2, or 4 processor cores can be randomly selected from the processor cores in which the power management mechanism is enabled each time. The processor core is to be disabled.
方式A2:在方式A2中,可以将功耗管理机制处于启用状态的处理器核中的所有处理器核作为待禁用处理器核。该方式相对简单,易于实施,效率较高。该方式A2适用于各种类型的多核处理器,既适用于处理器核完全相同的多核处理器,也适用于处理器核有区别的多核处理器。Manner A2: In Manner A2, all processor cores among the processor cores whose power consumption management mechanism is in the enabled state may be used as processor cores to be disabled. This method is relatively simple, easy to implement, and highly efficient. The method A2 is suitable for various types of multi-core processors, both for multi-core processors with identical processor cores, and for multi-core processors with different processor cores.
在方式A2中,假设多核处理器一共包含6个处理器核,当前有2个处理器核上的功耗管理机制处于禁用状态,且这2个处理器核的整体处理能力不满足应用需求(即这2个处理器核的整体处理能力不足),则可以将剩余4个处理器核都作为待禁用处理器核,从而禁用这4个处理器核上的功耗管理机制,这样6个处理器核就都是功耗管理机制处于禁用状态的处理器核了,功耗管理机制处于禁用状态的处理器核的整体处理能力会有极大地提升。In method A2, suppose that the multi-core processor contains a total of 6 processor cores, and the power management mechanism on 2 processor cores is currently disabled, and the overall processing capacity of these 2 processor cores does not meet the application requirements ( That is, the overall processing capacity of these 2 processor cores is insufficient), the remaining 4 processor cores can be used as processor cores to be disabled, thereby disabling the power management mechanism on these 4 processor cores, so that 6 processing The processor cores are all processor cores with the power management mechanism in the disabled state, and the overall processing capabilities of the processor cores with the power management mechanism in the disabled state will be greatly improved.
方式A3:在方式A3中,可依据应用需求对应的任务量,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为待禁用处理器核。该方式可更加准确、合理地确定待禁用处理器核的数量,可避免过多地禁用处理器核上的功耗管理机制,可以在满足应用需求的同时,最大化地节 约功耗。该方式A3适用于各种类型的多核处理器,既适用于处理器核完全相同的多核处理器,也适用于处理器核有区别的多核处理器。Method A3: In method A3, one or more processor cores can be selected as the to-be-disabled processor cores from the processor cores in the enabled state of the power consumption management mechanism according to the amount of tasks corresponding to the application requirements. This method can more accurately and reasonably determine the number of processor cores to be disabled, avoid disabling the power management mechanism on the processor cores too much, and maximize power savings while meeting application requirements. This method A3 is suitable for various types of multi-core processors, not only for multi-core processors with identical processor cores, but also for multi-core processors with different processor cores.
可选地,可以根据历史时段内的任务量预测应用需求对应的任务量。或者,也可以根据功耗管理机制处于禁用状态的处理器核在最近一段时间内的利用率或负载量预测应用需求对应的任务量。或者,应用需求中也可以携带相应任务量,从而可以从应用需求中提取对应的任务量。应用需求对应的任务量主要是指属于第一类任务的任务量。Optionally, the task amount corresponding to the application demand can be predicted based on the task amount in the historical period. Alternatively, the task volume corresponding to the application demand can also be predicted according to the utilization rate or the load volume of the processor core in the disabled state of the power management mechanism in the recent period of time. Alternatively, the corresponding task amount can also be carried in the application requirements, so that the corresponding task amount can be extracted from the application requirements. The amount of tasks corresponding to application requirements mainly refers to the amount of tasks belonging to the first type of task.
进一步可选地,可以将应用需求对应的任务量转换为目标负载量,并计算功耗管理机制处于启用状态的各处理器核能够处理的负载量,根据功耗管理机制处于启用状态的各处理器核能够处理的负载量,从中选择与目标负载量适配的处理器核,作为待禁用处理器核。Further optionally, the task amount corresponding to the application requirement can be converted into the target load amount, and the load amount that can be processed by each processor core with the power management mechanism in the enabled state can be calculated, according to the processing of the power management mechanism in the enabled state. The amount of load that the processor core can handle, from which a processor core adapted to the target load amount is selected as the processor core to be disabled.
例如,若存在单个处理器核能够处理的负载量大于目标负载量,且与目标负载量最接近,则可以将该处理器核作为待禁用处理器核。For example, if there is a load that can be handled by a single processor core that is greater than the target load and is closest to the target load, the processor core can be used as the processor core to be disabled.
又例如,若单个处理器核能够处理的负载量均小于目标负载量,则可以选择出几个处理器核,这几个处理器核能够处理的负载量之和大于目标负载量,且与目标负载量最接近,将这几个处理器核作为待禁用处理器核。For another example, if the load that a single processor core can handle is less than the target load, several processor cores can be selected. The sum of the load that these processor cores can handle is greater than the target load, and is equal to the target load. The load is the closest, and these processor cores are used as the processor cores to be disabled.
方式A4:在方式A4中,多核处理器包括的各处理器核的处理能力不完全相同。基于此,可依据处理器核的处理能力,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为待禁用处理器核。该方式A4适用于处理器核有区别的多核处理器。Method A4: In method A4, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, according to the processing capabilities of the processor cores, one or more processor cores can be selected as the processor cores to be disabled from the processor cores in which the power management mechanism is in the enabled state. This method A4 is suitable for multi-core processors with different processor cores.
可选地,可以从功耗管理机制处于启用状态的处理器核中,优先选择处理能力较强的处理器核作为待禁用处理器核。当然,也可以从功耗管理机制处于启用状态的处理器核中,优先选择处理能力较弱的处理器核作为待禁用处理器核。Optionally, from among the processor cores in which the power consumption management mechanism is in an enabled state, a processor core with stronger processing capability may be selected as the processor core to be disabled. Of course, it is also possible to preferentially select a processor core with a weaker processing capability as a processor core to be disabled from among the processor cores in which the power management mechanism is in an enabled state.
在本申请一实施例中,多核处理器包括多个处理器核,多个处理器核被划分为两类,分别是第一类处理器核和第二类处理器核,第一类处理器核的处理能力强于第二类处理器核的处理能力。可选地,该多核处理器可实现为 ARM架构的多核处理器,该ARM架构的多核处理器包括大核(big Core)和小核(LITTLE Core),这里的大核相当于第一类处理器核,小核相当于第二类处理器核。In an embodiment of the present application, the multi-core processor includes multiple processor cores, and the multiple processor cores are divided into two types, namely the first type of processor core and the second type of processor core. The first type of processor The processing power of the core is stronger than that of the second type of processor core. Optionally, the multi-core processor may be implemented as a multi-core processor of the ARM architecture. The multi-core processor of the ARM architecture includes a big core (big Core) and a small core (LITTLE core), where the big core is equivalent to the first type of processing The small core is equivalent to the second type of processor core.
可选地,对于上述包括两类处理器核的多核处理器,管理器103在依据处理器核的处理能力选择待禁用处理器核时,可以先行判断功耗管理机制处于启用状态的处理器核中是否存在第二类处理器核;若存在功耗管理机制处于启用状态的第二类处理器核,从功耗管理机制处于启用状态的第二类处理器核中选择待禁用处理器核;若不存在功耗管理机制处于启用状态的第二类处理器核,从功耗管理机制处于启用状态的第一类处理器核中选择待禁用处理器核。在该实施方式中,处理能力较低的处理器核,其功耗相对较低,优先禁用这类处理器核上的功耗管理机制,功耗增加量相对较小。或者Optionally, for the above-mentioned multi-core processors including two types of processor cores, when the manager 103 selects the processor cores to be disabled according to the processing capabilities of the processor cores, it may first determine the processor cores whose power management mechanism is in the enabled state. Whether there is a second type of processor core in the, if there is a second type of processor core with the power management mechanism in the enabled state, select the processor core to be disabled from the second type of processor core with the power management mechanism in the enabled state; If there is no second-type processor core with the power management mechanism in the enabled state, select the to-be-disabled processor core from the first-type processor cores with the power management mechanism in the enabled state. In this embodiment, the processor core with lower processing capability has relatively low power consumption, and the power consumption management mechanism on this type of processor core is preferentially disabled, and the increase in power consumption is relatively small. or
可选地,对于上述包括两类处理器核的多核处理器,管理器103在依据处理器核的处理能力选择待禁用处理器核时,可以同时考虑处理器核的处理能力和应用需求对应的任务量。在应用需求对应的任务量大于或等于设定的任务量阈值的情况下,从功耗管理机制处于启用状态的第一类处理器核中选择待禁用处理器核;在应用需求对应的任务量小于设定的任务量阈值的情况下,从功耗管理机制处于启用状态的第二类处理器核中选择待禁用处理器核。在该实施方式中,在应用需求对应的任务量相对较小的情况下,优先禁用处理能力相对较低的第二类处理器核上的功耗管理机制,由于这类处理器核的处理能力相对较低,其功耗相对较低,功耗增加量相对较小。Optionally, for the foregoing multi-core processor including two types of processor cores, when the manager 103 selects the processor cores to be disabled according to the processing capabilities of the processor cores, it may also consider the processing capabilities of the processor cores and the corresponding application requirements. The amount of tasks. In the case that the task volume corresponding to the application demand is greater than or equal to the set task volume threshold, select the processor core to be disabled from the first type of processor cores with the power management mechanism in the enabled state; in the task volume corresponding to the application demand If it is less than the set task amount threshold, the processor core to be disabled is selected from the second type of processor cores in which the power consumption management mechanism is in the enabled state. In this embodiment, when the amount of tasks corresponding to the application requirements is relatively small, the power consumption management mechanism on the second type of processor cores with relatively low processing capabilities is preferentially disabled, due to the processing capabilities of this type of processor cores. Relatively low, its power consumption is relatively low, and the increase in power consumption is relatively small.
又例如,在实施方式B中,管理器103可以监控功耗管理机制处于禁用状态的处理器核的整体处理能力,在功耗管理机制处于禁用状态的处理器核的整体处理能力满足应用需求且过剩的情况下,从功耗管理机制处于禁用状态的处理器核中选择待启用处理器核,并重新启用待启用处理器核上的功耗管理机制,以借助于功耗管理机制降低多核处理器100的功耗。待启用处理器核的数量可以是一个,也可以是多个。For another example, in Embodiment B, the manager 103 may monitor the overall processing capability of the processor cores whose power management mechanism is disabled, and the overall processing capabilities of the processor cores whose power management mechanism is disabled meet application requirements and In the case of surplus, select the processor cores to be enabled from the processor cores with the power management mechanism in the disabled state, and re-enable the power management mechanism on the processor cores to be enabled to reduce multi-core processing with the help of the power management mechanism The power consumption of the device 100. The number of processor cores to be activated can be one or more.
在本实施方式中,并不限定管理器103选择待启用处理器核的方式,可 以采用但不限于以下几种方式:In this embodiment, the manner in which the manager 103 selects the processor core to be activated is not limited, and the following manners can be used but not limited to:
方式B1:在方式B1中,可以从功耗管理机制处于禁用状态的处理器核中,随机选择一个或多个处理器核作为待启用处理器核。该方式相对简单,易于实施,效率较高。该方式B1适用于各种类型的多核处理器,尤其适用于处理器核完全相同的多核处理器。Manner B1: In Manner B1, one or more processor cores can be randomly selected as the processor cores to be enabled from the processor cores in which the power management mechanism is in a disabled state. This method is relatively simple, easy to implement, and highly efficient. This method B1 is suitable for various types of multi-core processors, and is especially suitable for multi-core processors with identical processor cores.
在方式B1中,可以预先设定允许每次选择的待启用处理器核的数量。假设,预先设定该数量为1个、2个或4个等,则每次可以从功耗管理机制处于禁用状态的处理器核中,随机选择1个、2个或4个处理器核作为待启用处理器核。In method B1, the number of processor cores to be activated that are allowed to be selected each time can be preset. Assuming that the number is preset to 1, 2, or 4, etc., one, 2, or 4 processor cores can be randomly selected from the processor cores in which the power management mechanism is disabled each time. The processor core is to be enabled.
方式B2:在方式B2中,可依据应用需求对应的任务量,从功耗管理机制处于禁用状态的处理器核中,选择一个或多个处理器核作为待启用处理器核。该方式可更加准确、合理地确定待启用处理器核的数量,可避免过多地启用处理器核上的功耗管理机制,从而无法满足应用需求,可在满足应用需求的同时,尽可能多地启用处理器核上的功耗管理机制,以节约功耗。该方式B2适用于各种类型的多核处理器,既适用于处理器核完全相同的多核处理器,也适用于处理器核有区别的多核处理器。Method B2: In method B2, one or more processor cores can be selected as the to-be-enabled processor cores from the processor cores whose power consumption management mechanism is in the disabled state according to the amount of tasks corresponding to the application requirements. This method can more accurately and reasonably determine the number of processor cores to be activated, and can avoid excessively enabling the power management mechanism on the processor cores, thus failing to meet the application requirements. It can meet the application requirements while doing as many as possible Enable the power management mechanism on the processor core to save power. This method B2 is suitable for various types of multi-core processors, not only for multi-core processors with identical processor cores, but also for multi-core processors with different processor cores.
关于应用需求对应的任务量,可参见前述方式A3中的描述,此处不再赘述。Regarding the task amount corresponding to the application requirements, please refer to the description in the aforementioned method A3, which will not be repeated here.
方式B3:在方式B3中,多核处理器包括的各处理器核的处理能力不完全相同。基于此,可依据处理器核的处理能力,从功耗管理机制处于禁用状态的处理器核中,选择一个或多个处理器核作为待启用处理器核。该方式B3适用于处理器核有区别的多核处理器。Manner B3: In Manner B3, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, one or more processor cores can be selected as the processor cores to be enabled from among the processor cores whose power management mechanism is in a disabled state according to the processing capabilities of the processor cores. This method B3 is suitable for multi-core processors with different processor cores.
可选地,可以从功耗管理机制处于禁用状态的处理器核中,优先选择处理能力较强的处理器核作为待启用处理器核。处理器核的处理能力较强,意味着其功耗也较大,优先启用这类处理器核上的功耗管理机制,有利于节约功耗。Optionally, from among the processor cores in which the power consumption management mechanism is in a disabled state, a processor core with stronger processing capability may be preferentially selected as the processor core to be activated. The processing power of the processor core is stronger, which means that its power consumption is also higher. The power management mechanism on this type of processor core is preferentially enabled, which is conducive to saving power consumption.
在本申请一实施例中,多核处理器包括多个处理器核,多个处理器核被 划分为两类,分别是第一类处理器核和第二类处理器核,第一类处理器核的处理能力强于第二类处理器核的处理能力。In an embodiment of the present application, the multi-core processor includes multiple processor cores, and the multiple processor cores are divided into two types, namely the first type of processor core and the second type of processor core. The first type of processor The processing power of the core is stronger than that of the second type of processor core.
可选地,对于上述包括两类处理器核的多核处理器,管理器103在确定待启用处理器核时,可以同时结合处理器核的处理能力和和应用需求对应的任务量。例如,在应用需求对应的任务量小于或等于设定的任务量下限值的情况下,说明应用需求对应的任务量相对较少,故可以从功耗管理机制处于禁用状态的第一类处理器核中选择待启用处理器核;在应用需求对应的任务量大于设定的任务量下限值的情况下,从功耗管理机制处于禁用状态的第二类处理器核中选择待启用处理器核。在该实施方式中,在应用需求对应的任务量相对较小的情况下,优先启用处理能力相对较强的第一类处理器核上的功耗管理机制,由于这类处理器核的处理能力较强,其功耗相对较高,优先启用其上的功耗管理机制,有利于节约功耗。Optionally, for the foregoing multi-core processors including two types of processor cores, when determining the processor cores to be activated, the manager 103 may simultaneously combine the processing capabilities of the processor cores and the amount of tasks corresponding to application requirements. For example, in the case that the task volume corresponding to the application demand is less than or equal to the set lower limit of the task volume, it means that the task volume corresponding to the application demand is relatively small, so the first type of processing can be taken from the power management mechanism in the disabled state. Select the processor core to be enabled in the processor core; in the case that the task volume corresponding to the application demand is greater than the set task volume lower limit, select the processor core to be enabled from the second type of processor core with the power management mechanism in the disabled state器核。 The core. In this embodiment, when the amount of tasks corresponding to the application requirements is relatively small, the power consumption management mechanism on the first type of processor cores with relatively strong processing capabilities is preferentially enabled, due to the processing capabilities of such processor cores. Stronger, its power consumption is relatively high, and priority is given to enabling the power management mechanism on it, which is conducive to saving power consumption.
在此说明,在上述实施方式A和B中,管理器103需要监控功耗管理机制处于禁用状态的处理器核的整体处理能力。其中,可以通过功耗管理机制处于禁用状态的各处理器核的各种指标或属性信息,来表征功耗管理机制处于禁用状态的处理器核的整体处理能力。It is explained here that in the foregoing implementations A and B, the manager 103 needs to monitor the overall processing capabilities of the processor cores whose power management mechanism is in a disabled state. Among them, various indicators or attribute information of each processor core with the power management mechanism in the disabled state can be used to characterize the overall processing capability of the processor core with the power management mechanism in the disabled state.
可选地,可以监控功耗管理机制处于禁用状态的各个处理器核的利用率;根据功耗管理机制处于禁用状态的各个处理器核的利用率,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求,即判断功耗管理机制处于禁用状态的处理器核的整体处理能力是否充足。Optionally, the utilization rate of each processor core whose power management mechanism is disabled can be monitored; according to the utilization rate of each processor core whose power management mechanism is disabled, determine the processor whose power management mechanism is disabled Whether the overall processing capability of the core meets the application requirements, that is, it is determined whether the overall processing capability of the processor core whose power management mechanism is disabled is sufficient.
例如,如果功耗管理机制处于禁用状态的各个处理器核的利用率均大于或等于设定的利用率阈值,则确定功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求,即功耗管理机制处于禁用状态的处理器核的整体处理能力不足。反之,可以确定功耗管理机制处于禁用状态的处理器核的整体处理能力可以满足应用需求。进一步,如果功耗管理机制处于禁用状态的各个处理器核中,利用率小于设定的利用率阈值的处理器核的比例大于或等于设定的第一比例阈值,例如有超过2/3的处理器核的利用率小于设定 的利用率阈值,则可以确定功耗管理机制处于禁用状态的处理器核的处理能力不仅可以满足应用需求且远大于应用需求,即整体处理能力过剩。For example, if the utilization rate of each processor core whose power management mechanism is disabled is greater than or equal to the set utilization threshold, it is determined that the overall processing capacity of the processor core whose power management mechanism is disabled cannot meet the application requirements , That is, the overall processing capacity of the processor cores whose power management mechanism is disabled is insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements. Further, if the power management mechanism is in the disabled state of each processor core, the proportion of processor cores whose utilization is less than the set utilization threshold is greater than or equal to the set first proportion threshold, for example, there are more than 2/3 If the utilization of the processor core is less than the set utilization threshold, it can be determined that the processing capacity of the processor core with the power management mechanism in the disabled state can not only meet the application requirements but also far exceed the application requirements, that is, the overall processing capacity is surplus.
又例如,若各处理器核中利用率大于设定的利用率阈值的处理器核的比例大于设定的第二比例阈值,例如有超过2/3的处理器核的利用率大于设定的利用率阈值,则确定功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求,即功耗管理机制处于禁用状态的处理器核的整体处理能力不足。反之,可以确定功耗管理机制处于禁用状态的处理器核的整体处理能力可以满足应用需求。进一步,如果功耗管理机制处于禁用状态的各个处理器核中,利用率小于设定的利用率阈值的处理器核的比例大于或等于设定的第一比例阈值,例如有超过1/2的处理器核的利用率小于设定的利用率阈值,则可以确定功耗管理机制处于禁用状态的处理器核的处理能力不仅可以满足应用需求而且远超过了应用需求,即整体处理能力过剩。需要说明的是,第一比例阈值可以与第二比例阈值相同,也可以不相同,对此不做限定。For another example, if the proportion of processor cores whose utilization rate is greater than the set utilization threshold value in each processor core is greater than the set second proportion threshold value, for example, the utilization rate of more than 2/3 of the processor cores is greater than the set utilization rate threshold. The utilization threshold determines that the overall processing capability of the processor core whose power management mechanism is disabled cannot meet application requirements, that is, the overall processing capability of the processor core whose power management mechanism is disabled is insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements. Further, if the power management mechanism is in the disabled state of each processor core, the proportion of processor cores whose utilization is less than the set utilization threshold is greater than or equal to the set first proportion threshold, for example, there are more than 1/2 If the utilization rate of the processor core is less than the set utilization threshold, it can be determined that the processing capacity of the processor core whose power management mechanism is disabled not only meets the application requirements but also far exceeds the application requirements, that is, the overall processing capacity is surplus. It should be noted that the first ratio threshold may be the same as or different from the second ratio threshold, which is not limited.
可选地,可以监控功耗管理机制处于禁用状态的各个处理器核的负载量;根据功耗管理机制处于禁用状态的各个处理器核的负载量,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求,即判断功耗管理机制处于禁用状态的处理器核的整体处理能力是否充足。Optionally, the load of each processor core with the power management mechanism in the disabled state can be monitored; according to the load of each processor core with the power management mechanism in the disabled state, determine the processor with the power management mechanism in the disabled state Whether the overall processing capability of the core meets the application requirements, that is, it is determined whether the overall processing capability of the processor core whose power management mechanism is disabled is sufficient.
例如,如果功耗管理机制处于禁用状态的各个处理器核的负载量均大于或等于设定的负载量阈值,则确定功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求,即功耗管理机制处于禁用状态的处理器核的整体处理能力不足。反之,可以确定功耗管理机制处于禁用状态的处理器核的整体处理能力可以满足应用需求。进一步,如果功耗管理机制处于禁用状态的各个处理器核中,负载量小于设定的负载量阈值的处理器核的比例大于或等于设定的第三比例阈值,例如有超过2/3的处理器核的负载量小于设定的负载量阈值,则可以确定功耗管理机制处于禁用状态的处理器核的处理能力不仅可以满足应用需求而且远超过了应用需求,即整体处理能力过剩。For example, if the load of each processor core with the power management mechanism in the disabled state is greater than or equal to the set load threshold, it is determined that the overall processing capacity of the processor core with the power management mechanism in the disabled state cannot meet the application requirements , That is, the overall processing capacity of the processor cores whose power management mechanism is disabled is insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements. Further, if the power management mechanism is in the disabled state of each processor core, the proportion of processor cores whose load is less than the set load threshold is greater than or equal to the set third proportion threshold, for example, more than 2/3 If the load of the processor core is less than the set load threshold, it can be determined that the processing capacity of the processor core with the power management mechanism in the disabled state can not only meet the application requirements but also far exceed the application requirements, that is, the overall processing capacity is surplus.
又例如,若各处理器核中负载量大于设定的负载量阈值的处理器核的比 例大于设定的第四比例阈值,例如有超过2/3的处理器核的负载量大于设定的负载量阈值,则确定功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求,即功耗管理机制处于禁用状态的处理器核的整体处理能力不足。反之,可以确定功耗管理机制处于禁用状态的处理器核的整体处理能力可以满足应用需求。进一步,如果功耗管理机制处于禁用状态的各个处理器核中,负载量小于设定的负载量阈值的处理器核的比例大于或等于设定的第三比例阈值,例如有超过1/2的处理器核的负载量小于设定的负载量阈值,则可以确定功耗管理机制处于禁用状态的处理器核的处理能力不仅可以满足应用需求而且远超过了应用需求,即功耗管理机制处于禁用状态的处理器核的整体处理能力过剩。需要说明的是,第三比例阈值可以与第四比例阈值相同,也可以不相同,对此不做限定。For another example, if the proportion of processor cores with load greater than the set load threshold in each processor core is greater than the set fourth proportion threshold, for example, more than 2/3 of the processor cores have load greater than the set threshold. The load threshold determines that the overall processing capabilities of the processor cores with the power management mechanism in the disabled state cannot meet application requirements, that is, the overall processing capabilities of the processor cores with the power management mechanism in the disabled state are insufficient. Conversely, it can be determined that the overall processing capability of the processor core with the power management mechanism in the disabled state can meet the application requirements. Further, if the power management mechanism is in the disabled state of each processor core, the proportion of processor cores whose load is less than the set load threshold is greater than or equal to the set third proportion threshold, for example, there are more than 1/2 If the load of the processor core is less than the set load threshold, it can be determined that the processing power of the processor core whose power management mechanism is disabled can not only meet the application requirements but also far exceed the application requirements, that is, the power management mechanism is disabled The overall processing power of the state of the processor core is excessive. It should be noted that the third ratio threshold may be the same as or different from the fourth ratio threshold, which is not limited.
可选地,可以同时监控功耗管理机制处于禁用状态的各个处理器核的利用率和负载量;根据功耗管理机制处于禁用状态的各个处理器核的利用率和负载量,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。Optionally, the utilization rate and load of each processor core whose power management mechanism is disabled can be monitored at the same time; power management can be determined according to the utilization and load of each processor core whose power management mechanism is disabled Whether the overall processing capacity of the processor core with the mechanism in the disabled state meets the application requirements.
关于根据功耗管理机制处于禁用状态的各个处理器核的利用率和负载量,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求的详细实施方式,可参考上述实施例类似实现,在此不再赘述。For a detailed implementation of determining whether the overall processing capacity of a processor core with a power management mechanism in a disabled state meets application requirements based on the utilization and load of each processor core with the power management mechanism in the disabled state, please refer to the above implementation The example is similar to the implementation, so I won't repeat it here.
结合图1c所示的处理器核上的功耗管理机制的状态变化示意图,以多队列(multiqueue)网络接口卡(Network Interface Card,NIC)中的网络中断(network interrupt)任务为例,对本申请实施例提供的多核处理器的工作原理进行说明。With reference to the state change diagram of the power management mechanism on the processor core shown in FIG. 1c, taking the network interrupt task in the multiqueue network interface card (Network Interface Card, NIC) as an example, the present application The working principle of the multi-core processor provided in the embodiment is described.
本实施例的多核处理器应用于多队列NIC,该多队列NIC包括多个处理器核;在初始状态下,2个处理器核上的功耗管理机制,例如C-state和DVFS被禁用;其余处理器核上的功耗管理机制,例如C-state和DVFS处于启用状态。The multi-core processor of this embodiment is applied to a multi-queue NIC, and the multi-queue NIC includes multiple processor cores; in the initial state, the power consumption management mechanisms on the two processor cores, such as C-state and DVFS, are disabled; The power management mechanisms on the remaining processor cores, such as C-state and DVFS, are in an enabled state.
在方便描述和区分的情况下,考虑到功耗管理机制处于禁用状态的处理器核可优先保证任务的性能要求,故可以将这类处理器核称为性能型处理器核,如图1c中虚线框内的处理器核;同理,考虑到功耗管理机制处于启用状态的处理器核具有明显的功耗节约优势,故可以将这类处理器核称为节能型处理器核,如图1c中实线框内的处理器核。For the convenience of description and distinction, considering that the processor cores with the power management mechanism in the disabled state can give priority to ensuring the performance requirements of the task, this type of processor core can be called a performance-type processor core, as shown in Figure 1c. The processor cores in the dotted frame; for the same reason, considering that the processor cores with the power management mechanism in the enabled state have obvious power saving advantages, such processor cores can be called energy-saving processor cores, as shown in the figure The processor core in the solid line box in 1c.
当有网络中断任务到达时,调度器优先考虑性能型处理器核,可以采用哈希(hash)算法将网络中断任务分配到性能型处理器核上。性能型处理器核不会进入空闲状态,故不存在因C-state或DVFS机制引起的延迟,可及时处理网络中断任务。可选地,性能型处理器核可运行在最高频率下,从而可以以最佳性能处理网络中断任务。When a network interrupt task arrives, the scheduler prioritizes the performance-based processor core, and can use a hash algorithm to assign the network interrupt task to the performance-based processor core. The performance-based processor core will not enter the idle state, so there is no delay caused by the C-state or DVFS mechanism, and the network interrupt task can be processed in time. Optionally, the performance-based processor core can run at the highest frequency, so that the network interrupt task can be processed with the best performance.
在性能型处理器核运行期间,管理器可监控性能型处理器核的一些性能指标,例如处理器核的使用率、负载量等。如果当前性能型处理器核的整体性能指标大于或等于相应指标阈值,管理器可以将网络中断任务重新映射到其余处理器核上;与此同时,其余处理器核上的功耗管理机制,如C-state和DVFS会被禁用。这意味着,一些节能型处理器核会变成性能型处理器核,可能是全部节能型处理器核均变成性能型处理器核,也可能是一部分节能型处理器核会变成性能型处理器核。其中,在图1c中,以性能型处理器核所在虚线框的灰色化表示性能型处理器核超过相应指标阈值。在图1c中,以全部节能型处理器核均变成性能型处理器核为例进行图示。During the operation of the performance-type processor core, the manager can monitor some performance indicators of the performance-type processor core, such as the utilization rate and load of the processor core. If the overall performance index of the current performance-based processor core is greater than or equal to the corresponding index threshold, the manager can remap the network interrupt task to the remaining processor cores; at the same time, the power management mechanism on the remaining processor cores, such as C-state and DVFS will be disabled. This means that some energy-saving processor cores will become performance-based processor cores. It may be that all energy-saving processor cores become performance-based processor cores, or some energy-saving processor cores will become performance-based processor cores. Processor core. Among them, in FIG. 1c, the graying of the dashed box where the performance-based processor core is located indicates that the performance-based processor core exceeds the corresponding indicator threshold. In Fig. 1c, an example is illustrated by taking all energy-saving processor cores into performance processor cores.
之后,在性能型处理器核运行期间,管理器会继续监控性能型处理器核的一些性能指标,例如处理器核的使用率、负载量等。如果当前性能型处理器核的整体性能指标小于相应指标阈值,管理器可以将一些性能型处理器核变回到节能型处理器核,并将网络中断任务重新映射到剩余的性能型处理器核上。Later, during the operation of the performance-based processor core, the manager will continue to monitor some performance indicators of the performance-based processor core, such as the utilization rate and load of the processor core. If the overall performance index of the current performance-based processor core is less than the corresponding indicator threshold, the manager can change some performance-based processor cores back to energy-saving processor cores, and remap network interrupt tasks to the remaining performance-based processor cores on.
由此可见,本申请实施例提供一种功耗管理机制异构的多核处理器,能够在保证任务性能的同时,尽量节约多核处理器的功耗,可满足一些任务性能对C-state或DVFS等功耗管理机制比较敏感的任务场景的需求。It can be seen that the embodiment of the present application provides a multi-core processor with a heterogeneous power management mechanism, which can save the power consumption of the multi-core processor as much as possible while ensuring task performance, and can meet the performance requirements of C-state or DVFS for some tasks. Such as power consumption management mechanism is more sensitive to the needs of task scenarios.
图2为本申请示例性实施例提供的一种多核处理器调度方法的流程示意图。如图2所示,该方法包括:FIG. 2 is a schematic flowchart of a multi-core processor scheduling method provided by an exemplary embodiment of this application. As shown in Figure 2, the method includes:
201、接收待处理任务。201. Receive a task to be processed.
202、在待处理任务属于第一类任务的情况下,将待处理任务分配到多核处理器中功耗管理机制处于禁用状态的处理器核上。202. In a case where the task to be processed belongs to the first type of task, allocate the task to be processed to the processor core of the multi-core processor whose power consumption management mechanism is in a disabled state.
在本实施例中,多核处理器包括多个处理器核,处理器核支持功耗管理机制,且至少一个处理器核上的功耗管理机制处于禁用状态。处理器核支持的功耗管理机制包括DVFS和C-state,但不限于此。在本实施例中,并不限定功耗管理机制处于禁用状态的处理器核的数量,可以是一个,也可以是多个。在一可选实施例中,在同一时刻,由2N个(即偶数个)处理器核上的功耗管理机制处于禁用状态;N是正整数。当然,在同一时刻,功耗管理机制处于禁用状态的处理器核的数量也可以是奇数个,例如,1个、3个、5个等,对此不做限定。In this embodiment, the multi-core processor includes multiple processor cores, the processor cores support a power consumption management mechanism, and the power consumption management mechanism on at least one processor core is in a disabled state. The power management mechanisms supported by the processor core include, but are not limited to, DVFS and C-state. In this embodiment, the number of processor cores whose power management mechanism is in a disabled state is not limited, and it may be one or multiple. In an optional embodiment, at the same moment, the power consumption management mechanisms on 2N (that is, an even number) of processor cores are in a disabled state; N is a positive integer. Of course, at the same moment, the number of processor cores with the power management mechanism in the disabled state may also be an odd number, for example, 1, 3, 5, etc., which is not limited.
在本实施例中,第一类任务可以是一些对性能有一定要求,对功耗管理机制较为敏感的任务。例如,从性能要求的角度来看,第一类任务可以包括但不限于:对处理时延要求较高(例如要求时延小于设定的时延阈值)的任务,对实时性要求较高(例如要求响应时间不能超过设定的响应时间阈值)的任务,等等。例如,一些控制类任务可能对实时性要求较高。又例如,一些中断类任务(例如网络中断处理任务)对时延要求较高。另外,实时调度类任务、即时分析类任务、即时查询类任务等都可作为第一类任务的示例。需要说明的是,本实施例并不对第一类任务进行限定,允许根据应用场景灵活设定。In this embodiment, the first type of tasks may be tasks that have certain requirements on performance and are more sensitive to the power management mechanism. For example, from the perspective of performance requirements, the first type of tasks can include, but are not limited to: tasks that require high processing delay (for example, require a delay less than the set delay threshold), and have high real-time requirements ( For example, tasks that require response time not to exceed the set response time threshold), and so on. For example, some control tasks may have higher real-time requirements. For another example, some interrupt tasks (such as network interrupt processing tasks) have higher requirements for time delay. In addition, real-time scheduling tasks, instant analysis tasks, and instant query tasks can all be used as examples of the first type of tasks. It should be noted that this embodiment does not limit the first type of tasks, and allows flexible setting according to application scenarios.
在本实施例中,接收待处理任务,判断待处理任务的类型;并在判断出待处理任务属于第一类任务的情况下,将待处理任务分配到功耗管理机制处于禁用状态的处理器核上,由功耗管理机制处于禁用状态的处理器核负责执行待处理任务。由于功耗管理机制处于禁用状态的处理器核不会进入空闲状态,会运行在设定的工作频率下,由这类处理器核执行待处理任务,不会因 功耗管理机制而产生延迟,可及时对待处理任务进行处理,可保证待处理任务不受功耗管理机制的影响,提高待处理任务的执行效率,保证待处理任务的性能。In this embodiment, the task to be processed is received, and the type of the task to be processed is determined; and when it is determined that the task to be processed belongs to the first type of task, the task to be processed is assigned to the processor whose power management mechanism is disabled On the core, the processor core whose power management mechanism is disabled is responsible for executing tasks to be processed. Because the processor cores with the power management mechanism in the disabled state will not enter the idle state, they will run at the set operating frequency, and such processor cores will perform pending tasks without delay due to the power management mechanism. The task to be processed can be processed in time, which can ensure that the task to be processed is not affected by the power management mechanism, improve the execution efficiency of the task to be processed, and ensure the performance of the task to be processed.
在本申请上述或下述实施例中,并不限定将待处理任务分配到功耗管理机制处于禁用状态的处理器核上的分配方式。下面对分配方式进行举例说明:In the foregoing or following embodiments of the present application, the allocation method for allocating to-be-processed tasks to processor cores whose power management mechanism is in a disabled state is not limited. The following is an example of the allocation method:
例如,在一种实施方式中,可以将功耗管理机制处于禁用状态的各处理器核的利用率进行比较,从中选择利用率低于设定利用率阈值或者从中选择利用率最低的处理器核,将待处理任务分配给所选择的处理器核。其中,处理器核利用率较低,说明处理器核相对轻松或性能较优,由功耗管理机制处于禁用状态的处理器核中相对轻松或性能较优的处理器核执行待处理任务,在保证任务性能的情况下,有利于进一步提高待处理任务的执行效率。For example, in an embodiment, the utilization rate of each processor core whose power management mechanism is disabled may be compared, and the utilization rate may be selected from the set utilization threshold value or the processor core with the lowest utilization rate may be selected. , The task to be processed is assigned to the selected processor core. Among them, the low utilization rate of the processor core indicates that the processor core is relatively easy or has better performance. Among the processor cores with the power management mechanism in the disabled state, the processor core that is relatively easy or has the better performance performs the task to be processed. In the case of ensuring task performance, it is beneficial to further improve the execution efficiency of the task to be processed.
又例如,在一种实施方式中,可以将功耗管理机制处于禁用状态的各处理器核的负载量进行比较,从中选择负载量低于设定负载量阈值或从中选择负载量最低的处理器核,将待处理任务分配给所选择的处理器核。其中,处理器核的负载量相对较低,说明处理器核相对轻松,计算资源充足,由功耗管理机制处于禁用状态的处理器核中相对轻松的处理器核执行待处理任务,在保证任务性能的情况下,有利于进一步提高待处理任务的执行效率。For another example, in an embodiment, the load of each processor core whose power management mechanism is disabled can be compared, and the load is lower than the set load threshold, or the processor with the lowest load can be selected from it. Core, the task to be processed is allocated to the selected processor core. Among them, the load of the processor core is relatively low, indicating that the processor core is relatively easy, and the computing resources are sufficient. The relatively easy processor core among the processor cores in the disabled state of the power management mechanism executes the tasks to be processed, and the task is guaranteed. In the case of performance, it is helpful to further improve the execution efficiency of the task to be processed.
其中,可以根据各处理器核的任务队列中正在排队的任务信息来确定各处理器核的负载量。例如,可以依据任务队列中正在排队的任务数量来确定各处理器核的负载量。一般来说,正在排队的任务数量越高,对应处理器核的负载量就越大。又例如,也可以依据任务队列中正在排队的任务优先级来确定各处理器核的负载量。一般来说,正在排队的任务优先级越高,对应处理器核的负载量就越大。又例如,也可以同时依据任务队列中正在排队的任务数量和优先级来确定各处理器核的负载量。一般来说,例如可以对正在排队的任务数量和优先级进行加权求和,得到对应处理器核的负载量;加权求和的结果越大,意味着处理器核的负载量越大。Among them, the load of each processor core can be determined according to the task information being queued in the task queue of each processor core. For example, the load of each processor core can be determined according to the number of tasks being queued in the task queue. Generally speaking, the higher the number of tasks being queued, the greater the load on the corresponding processor core. For another example, the load of each processor core can also be determined according to the priority of the task being queued in the task queue. Generally speaking, the higher the priority of the task being queued, the greater the load of the corresponding processor core. For another example, the load of each processor core can also be determined according to the number and priority of the tasks being queued in the task queue at the same time. Generally speaking, for example, you can perform a weighted summation on the number and priority of the tasks being queued to obtain the load of the corresponding processor core; the larger the result of the weighted summation, the greater the load of the processor core.
又例如,在一种实施方式中,功耗管理机制处于禁用状态的各处理器核 的工作频率不完全相同。基于此,可以将功耗管理机制处于禁用状态的各处理器核的工作频率进行比较,从中选择工作频率高于设定频率阈值或工作频率最高的处理器核,将待处理任务分配给所选择的处理器核。其中,处理器核的工作频率相对较高,说明处理器核的处理速度相对较快,由功耗管理机制处于禁用状态的处理器核中处理速度较快的处理器核执行待处理任务,在保证任务性能的情况下,有利于进一步提高待处理任务的执行效率。For another example, in an embodiment, the operating frequencies of the processor cores in the disabled state of the power management mechanism are not completely the same. Based on this, the operating frequency of each processor core whose power management mechanism is disabled can be compared, and the processor core with the operating frequency higher than the set frequency threshold or the highest operating frequency can be selected, and the tasks to be processed can be assigned to the selected Processor cores. Among them, the working frequency of the processor core is relatively high, indicating that the processing speed of the processor core is relatively fast, and the processor core with the faster processing speed among the processor cores in the disabled state of the power management mechanism executes the tasks to be processed. In the case of ensuring task performance, it is beneficial to further improve the execution efficiency of the task to be processed.
又例如,在一种实施方式中,可以采用哈希算法将待处理任务分配到某个功耗管理机制处于禁用状态的各处理器核上。For another example, in an implementation manner, a hash algorithm may be used to allocate tasks to be processed to each processor core whose power management mechanism is in a disabled state.
在此说明,在上述几种实施方式中,在将待处理任务分配给功耗管理机制处于禁用状态的处理器核的过程中,单独地依据处理器核的利用率、负载量或工作频率。当然,也可以同时结合处理器核的利用率、负载量和工作频率中任意两种或三种,来确定将待处理任务分配给哪个功耗管理机制处于禁用状态的处理器核。另外,除了上述三种信息之外,还可以考虑处理器核的其它指标或属性信息,例如还可以考虑处理器核的缓存大小、总线速度和/或工作电压等。It is explained here that in the above several implementation manners, the process of allocating tasks to be processed to the processor cores with the power management mechanism in the disabled state is solely based on the utilization, load, or operating frequency of the processor cores. Of course, it is also possible to simultaneously combine any two or three of the utilization, load, and operating frequency of the processor cores to determine which processor core with the power management mechanism disabled to allocate the task to be processed. In addition, in addition to the above three types of information, other indicators or attribute information of the processor core may also be considered. For example, the cache size, bus speed, and/or operating voltage of the processor core may also be considered.
图3为本申请实施例提供的另一种多核处理器调度方法的流程示意图。如图3所示,该方法包括:FIG. 3 is a schematic flowchart of another multi-core processor scheduling method provided by an embodiment of the application. As shown in Figure 3, the method includes:
301、接收待处理任务。301. Receive a task to be processed.
302、判断待处理任务是否属于第一类任务;若判断结果为是,意味着待处理任务属于第一类任务,则执行步骤303;若判断结果为否,意味着待处理任务属于第二类任务,则执行步骤304。302. Determine whether the task to be processed belongs to the first type of task; if the result of the judgment is yes, it means that the task to be processed belongs to the first type of task, then execute step 303; if the result of the judgment is no, it means that the task to be processed belongs to the second type of task Task, go to step 304.
303、在待处理任务属于第一类任务的情况下,将待处理任务分配到多核处理器中功耗管理机制处于禁用状态的处理器核上,由功耗管理机制处于禁用状态的处理器核执行待处理任务。303. In the case that the task to be processed belongs to the first type of task, the task to be processed is allocated to the processor core of the multi-core processor whose power management mechanism is in the disabled state, and the processor core of the power management mechanism is in the disabled state. Perform pending tasks.
304、在待处理任务属于第二类任务的情况下,将待处理任务分配到多核处理器中功耗管理机制处于启用状态的处理器核上,由功耗管理机制处于启用状态的处理器核执行待处理任务。304. In the case that the task to be processed belongs to the second type of task, the task to be processed is allocated to the processor core of the multi-core processor whose power management mechanism is enabled, and the processor core of the power management mechanism is enabled. Perform pending tasks.
在本实施例中,可结合多核处理器的应用场景,根据应用场景中各任务的性能要求,预先将各任务分类为第一类任务和第二类任务。其中,第二类任务是指除第一类任务之外的其它任务。关于第一类任务的描述可参见上文中的描述,在此不再赘述。In this embodiment, the application scenario of the multi-core processor may be combined, and each task may be pre-classified into the first type of task and the second type of task according to the performance requirements of each task in the application scenario. Among them, the second type of tasks refer to tasks other than the first type of tasks. For the description of the first type of task, please refer to the above description, which will not be repeated here.
进一步可选地,可维护任务的标识信息与任务类型之间的映射关系,可选地,该映射关系中包括第一类任务下各任务的标识信息,或者包括第二类任务下各任务的标识信息,或者同时包括第一类任务下各任务的标识信息和第二类任务下各任务的标识信息。Further optionally, the mapping relationship between the identification information of the task and the task type can be maintained. Optionally, the mapping relationship includes the identification information of each task under the first type of task, or includes the identification information of each task under the second type of task. The identification information, or the identification information of each task under the first type of task and the identification information of each task under the second type of task at the same time.
基于此,在接收到待处理任务之后,可以将待处理任务的标识信息在所维护的任务的标识信息与任务类型之间的映射关系中进行匹配,根据匹配结果得到待处理任务属于第一类任务或属于第二类任务的判断结果。Based on this, after receiving the task to be processed, the identification information of the task to be processed can be matched in the mapping relationship between the identification information of the task to be maintained and the task type. According to the matching result, it is obtained that the task to be processed belongs to the first category. Tasks or judgment results belonging to the second category of tasks.
若判断出待处理任务属于第一类任务,则可以将待处理任务分配到功耗管理机制处于禁用状态的处理器核上,由这些功耗管理机制处于禁用状态的处理器核负责执行待处理任务。借助于这些处理器核不会进入空闲状态的优势,可及时对待处理任务进行处理,有利于保证待处理任务的性能。If it is determined that the task to be processed belongs to the first type of task, the task to be processed can be allocated to the processor cores with the power management mechanism in the disabled state, and the processor cores with the power management mechanism in the disabled state are responsible for executing the tasks to be processed task. With the advantage that these processor cores will not enter the idle state, the tasks to be processed can be processed in time, which is beneficial to ensure the performance of the tasks to be processed.
若判断出待处理任务属于第二类任务,不属于第一类任务,则可以将待处理任务分配到功耗管理机制处于启用状态的处理器核上,由这些功耗管理机制处于启用状态的处理器核负责执行待处理任务。借助于这些处理器核上的功耗管理机制,在完成待处理任务的同时,有利于节约处理器核的功耗。If it is determined that the task to be processed belongs to the second type of task and not the first type of task, the task to be processed can be allocated to the processor cores with the power management mechanism in the enabled state. The processor core is responsible for executing pending tasks. With the help of the power consumption management mechanism on these processor cores, while completing the tasks to be processed, it is beneficial to save the power consumption of the processor cores.
在本申请上述或下述实施例中,也不限定将待处理任务分配到功耗管理机制处于启用状态的处理器核上的分配方式。将待处理任务分配到功耗管理机制处于启用状态的处理器核上的具体分配方式,与将待处理任务分配到功耗管理机制处于禁用状态的处理器核上的分配方式相类似,可参见上述实施方式,在此不再赘述。In the foregoing or following embodiments of the present application, the allocation method for allocating the tasks to be processed to the processor cores with the power management mechanism in the enabled state is not limited either. The specific allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the enabled state is similar to the allocation method of allocating to-be-processed tasks to the processor cores with the power management mechanism in the disabled state, see The foregoing implementation manners will not be repeated here.
在本申请一些可选实施例中,多核处理器包括多个处理器核,在多个处理器核中,有一部分处理器核上的功耗管理机制处于禁用状态,另一部分处 理器核上的功耗管理机制处于启用状态,从而形成异构多核处理器。在这些实施例中,功耗管理机制处于禁用状态的处理器核的数量可根据应用需求动态变化;相应地,功耗管理机制处于启用状态的处理器核的数量也会根据应用需求动态变化。基于此,本实施例的方法还包括:根据应用需求动态调整多个处理器核上的功耗管理机制的状态,以使功耗管理机制处于不同状态的处理器核均能满足应用需求。In some optional embodiments of the present application, the multi-core processor includes multiple processor cores. Among the multiple processor cores, the power management mechanism on some of the processor cores is disabled, and the power management mechanism on the other part of the processor cores is disabled. The power management mechanism is in an enabled state, thus forming a heterogeneous multi-core processor. In these embodiments, the number of processor cores with the power management mechanism in the disabled state can be dynamically changed according to application requirements; accordingly, the number of processor cores with the power management mechanism in the enabled state will also dynamically change according to the application requirements. Based on this, the method of this embodiment further includes: dynamically adjusting the states of the power management mechanisms on the multiple processor cores according to application requirements, so that the processor cores with different power management mechanisms in different states can meet the application requirements.
在本申请实施例中,并不限定根据应用需求动态调整多个处理器核上的功耗管理机制的状态的实施方式。下面举例说明:In the embodiments of the present application, the implementation manner of dynamically adjusting the states of the power consumption management mechanisms on multiple processor cores according to application requirements is not limited. The following example illustrates:
例如,在实施方式A中,可以监控功耗管理机制处于禁用状态的处理器核的整体处理能力,在功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求在功耗管理机制处于禁用状态的处理器核的整体处理能力不足的情况下,从功耗管理机制处于启用状态的处理器核中选择待禁用处理器核,并将待禁用处理器核上的功耗管理机制禁用。其中,待禁用处理器核的数量可以是一个,也可以是多个。这可以增加功耗管理机制处于禁用状态的处理器核的数量,增加功耗管理机制处于禁用状态的处理器核的整体处理能力,以便满足应用需求。For example, in Embodiment A, the overall processing capacity of the processor cores with the power management mechanism in the disabled state can be monitored, and the overall processing capabilities of the processor cores with the power management mechanism in the disabled state cannot meet the application requirements. When the overall processing capacity of the processor cores in the disabled state of the mechanism is insufficient, select the processor cores to be disabled from the processor cores with the power management mechanism in the enabled state, and set the power management mechanism on the processor cores to be disabled Disabled. Among them, the number of processor cores to be disabled may be one or more. This can increase the number of processor cores with the power management mechanism in the disabled state, and increase the overall processing capacity of the processor cores with the power management mechanism in the disabled state, so as to meet application requirements.
在本实施方式中,并不限定选择待禁用处理器核的方式,可以采用但不限于以下几种方式:In this embodiment, the method for selecting the processor core to be disabled is not limited, and the following methods can be used but not limited to:
方式A1:在方式A1中,可以从功耗管理机制处于启用状态的处理器核中,随机选择一个或多个处理器核作为待禁用处理器核。Method A1: In method A1, one or more processor cores can be randomly selected as the processor cores to be disabled from among the processor cores in which the power consumption management mechanism is in the enabled state.
方式A2:在方式A2中,可以将功耗管理机制处于启用状态的处理器核中的所有处理器核作为待禁用处理器核。Manner A2: In Manner A2, all processor cores among the processor cores whose power consumption management mechanism is in the enabled state may be used as processor cores to be disabled.
方式A3:在方式A3中,可依据应用需求对应的任务量,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为待禁用处理器核。Method A3: In method A3, one or more processor cores can be selected as the to-be-disabled processor cores from the processor cores in the enabled state of the power consumption management mechanism according to the amount of tasks corresponding to the application requirements.
方式A4:在方式A4中,多核处理器包括的各处理器核的处理能力不完全相同。基于此,可依据处理器核的处理能力,从功耗管理机制处于启用状 态的处理器核中,选择一个或多个处理器核作为待禁用处理器核。该方式A4适用于处理器核有区别的多核处理器。Method A4: In method A4, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, according to the processing capabilities of the processor cores, one or more processor cores can be selected as the processor cores to be disabled from the processor cores in which the power management mechanism is in the enabled state. This method A4 is suitable for multi-core processors with different processor cores.
又例如,在实施方式B中,可以监控功耗管理机制处于禁用状态的处理器核的整体处理能力,在功耗管理机制处于禁用状态的处理器核的整体处理能力满足应用需求且过剩的情况下,从功耗管理机制处于禁用状态的处理器核中选择待启用处理器核,并重新启用待启用处理器核上的功耗管理机制。待启用处理器核的数量可以是一个,也可以是多个。For another example, in Embodiment B, the overall processing capacity of the processor core with the power management mechanism in the disabled state can be monitored, and the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements and is in excess. Next, select the processor core to be enabled from the processor cores with the power management mechanism in the disabled state, and re-enable the power management mechanism on the processor core to be enabled. The number of processor cores to be activated can be one or more.
在本实施方式中,并不限定选择待启用处理器核的方式,可以采用但不限于以下几种方式:In this embodiment, the method for selecting the processor core to be activated is not limited, and the following methods can be adopted but not limited to:
方式B1:在方式B1中,可以从功耗管理机制处于禁用状态的处理器核中,随机选择一个或多个处理器核作为待启用处理器核。Manner B1: In Manner B1, one or more processor cores can be randomly selected as the processor cores to be enabled from the processor cores in which the power management mechanism is in a disabled state.
方式B2:在方式B2中,可依据应用需求对应的任务量,从功耗管理机制处于禁用状态的处理器核中,选择一个或多个处理器核作为待启用处理器核。Method B2: In method B2, one or more processor cores can be selected as the to-be-enabled processor cores from the processor cores whose power consumption management mechanism is in the disabled state according to the amount of tasks corresponding to the application requirements.
方式B3:在方式B3中,多核处理器包括的各处理器核的处理能力不完全相同。基于此,可依据处理器核的处理能力,从功耗管理机制处于禁用状态的处理器核中,选择一个或多个处理器核作为待启用处理器核。该方式B3适用于处理器核有区别的多核处理器。Manner B3: In Manner B3, the processing capabilities of the processor cores included in the multi-core processor are not completely the same. Based on this, one or more processor cores can be selected as the processor cores to be enabled from among the processor cores whose power management mechanism is in a disabled state according to the processing capabilities of the processor cores. This method B3 is suitable for multi-core processors with different processor cores.
关于方式A1-A4以及B1-B3的详细的描述可参见前述实施例,在此不再赘述。For detailed descriptions of the modes A1-A4 and B1-B3, please refer to the foregoing embodiment, which will not be repeated here.
在此说明,在上述实施方式A和B中,需要监控功耗管理机制处于禁用状态的处理器核的整体处理能力。其中,可以通过功耗管理机制处于禁用状态的各处理器核的各种指标或属性信息,来表征功耗管理机制处于禁用状态的处理器核的整体处理能力。It is explained here that in the foregoing implementations A and B, it is necessary to monitor the overall processing capabilities of the processor cores whose power management mechanism is in a disabled state. Among them, various indicators or attribute information of each processor core with the power management mechanism in the disabled state can be used to characterize the overall processing capability of the processor core with the power management mechanism in the disabled state.
可选地,可以监控功耗管理机制处于禁用状态的各个处理器核的利用率;根据功耗管理机制处于禁用状态的各个处理器核的利用率,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。Optionally, the utilization rate of each processor core whose power management mechanism is disabled can be monitored; according to the utilization rate of each processor core whose power management mechanism is disabled, determine the processor whose power management mechanism is disabled Whether the overall processing capacity of the core meets the application requirements.
可选地,可以监控功耗管理机制处于禁用状态的各个处理器核的负载量;根据功耗管理机制处于禁用状态的各个处理器核的负载量,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。Optionally, the load of each processor core with the power management mechanism in the disabled state can be monitored; according to the load of each processor core with the power management mechanism in the disabled state, determine the processor with the power management mechanism in the disabled state Whether the overall processing capacity of the core meets the application requirements.
可选地,可以同时监控功耗管理机制处于禁用状态的各个处理器核的利用率和负载量;根据功耗管理机制处于禁用状态的各个处理器核的利用率和负载量,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。Optionally, the utilization rate and load of each processor core whose power management mechanism is disabled can be monitored at the same time; power management can be determined according to the utilization and load of each processor core whose power management mechanism is disabled Whether the overall processing capacity of the processor core with the mechanism in the disabled state meets the application requirements.
在本申请方法实施例中,采用多核处理器,多核处理器包括多个处理器核,且至少一个处理器核上的功耗管理机制处于禁用状态;其中,处理器核支持功耗管理机制,有利于节约多核处理器的功耗;而禁用一些处理器核上的功耗管理机制,可在这些处理器核上执行一些对功耗管理机制比较敏感的任务,有利于保证这些任务的性能要求。In the method embodiment of the present application, a multi-core processor is used, and the multi-core processor includes multiple processor cores, and the power management mechanism on at least one processor core is in a disabled state; wherein the processor core supports the power management mechanism, Conducive to saving the power consumption of multi-core processors; and disabling the power management mechanism on some processor cores can perform some tasks sensitive to the power management mechanism on these processor cores, which is helpful to ensure the performance requirements of these tasks .
需要说明的是,上述实施例所提供方法的各步骤的执行主体均可以是同一设备,或者,该方法也由不同设备作为执行主体。比如,步骤201至步骤202的执行主体可以为设备A;又比如,步骤201的执行主体可以为设备A,步骤202的执行主体可以为设备B;等等。It should be noted that the execution subject of each step of the method provided in the foregoing embodiment may be the same device, or different devices may also be the execution subject of the method. For example, the execution subject of step 201 to step 202 may be device A; for another example, the execution subject of step 201 may be device A, and the execution subject of step 202 may be device B; and so on.
另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如201、202等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。In addition, in some of the processes described in the above embodiments and drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may be performed out of the order in which they appear in this document or performed in parallel. The sequence numbers of operations, such as 201, 202, etc., are only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions of "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit the "first" and "second" Are different types.
图4为本申请示例性实施例提供的一种计算机设备的结构示意图。如图4所示,该计算机设备包括:多核处理器41,多核处理器41包括多个处理器核401,其中,至少一个处理器核401上的功耗管理机制被禁用。Fig. 4 is a schematic structural diagram of a computer device provided by an exemplary embodiment of this application. As shown in FIG. 4, the computer device includes: a multi-core processor 41, and the multi-core processor 41 includes a plurality of processor cores 401, wherein the power management mechanism on at least one of the processor cores 401 is disabled.
本实施例并不限定功耗管理机制处于禁用状态的处理器核401的数量, 可以是一个,也可以是多个。在一可选实施例中,在同一时刻,由2N个(即偶数个)处理器核401上的功耗管理机制处于禁用状态;N是正整数。当然,在同一时刻,功耗管理机制处于禁用状态的处理器核401的数量也可以是奇数个,例如,1个、3个、5个等,对此不做限定。This embodiment does not limit the number of processor cores 401 whose power management mechanism is in a disabled state, and it may be one or more. In an optional embodiment, at the same time, the power consumption management mechanisms on 2N (ie, an even number) of processor cores 401 are in a disabled state; N is a positive integer. Of course, at the same moment, the number of processor cores 401 whose power management mechanism is in the disabled state may also be an odd number, for example, 1, 3, 5, etc., which is not limited.
进一步,如图4所示,该计算机设备还包括:存储器42,用于存储计算机程序,并可被配置为存储其它各种数据以支持在计算机设备上的操作。这些数据的示例包括用于在计算机设备上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。Further, as shown in FIG. 4, the computer device further includes: a memory 42 for storing computer programs, and can be configured to store various other data to support operations on the computer device. Examples of such data include instructions for any application or method operated on a computer device, contact data, phone book data, messages, pictures, videos, etc.
其中,存储器42中存储的计算机程序包括与功耗管理机制对应的程序,还包括:与任务调度有关的程序,以及与功耗管理机制的状态调整有关的程序。与任务调度有关的程序相当于前述实施例中的调度器,可简称为调度程序。与功耗管理机制的状态调整有关的程序相当于前述实施例中的管理器,可简称为管理程序。调度程序可以是操作系统级的程序,也可以是应用级别的程序。相应地,管理程序可以是操作系统级的程序,也可以是应用级别的程序。The computer program stored in the memory 42 includes a program corresponding to the power consumption management mechanism, and also includes: a program related to task scheduling and a program related to the state adjustment of the power consumption management mechanism. The program related to task scheduling is equivalent to the scheduler in the foregoing embodiment, and may be simply referred to as the scheduler. The program related to the state adjustment of the power consumption management mechanism is equivalent to the manager in the foregoing embodiment, and may be simply referred to as the management program. The scheduler can be an operating system level program or an application level program. Correspondingly, the management program can be an operating system level program or an application level program.
存储器42可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 42 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable and Programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
多核处理器41,与存储器42耦合,用于执行存储器42中的计算机程序(主要是指调度程序),以用于:接收待处理任务;在待处理任务属于第一类任务的情况下,将待处理任务分配到功耗管理机制处于禁用状态的处理器核上。需要说明的是,实际执行调度程序的可以是多核处理器41中的某个或某几个处理器核401。The multi-core processor 41 is coupled with the memory 42 and is used to execute the computer program (mainly referring to the scheduler) in the memory 42 for: receiving the task to be processed; in the case that the task to be processed belongs to the first type of task, the The tasks to be processed are allocated to the processor cores whose power management mechanism is disabled. It should be noted that the actual execution of the scheduler may be one or several processor cores 401 in the multi-core processor 41.
其中,第一类任务可以是一些对性能有一定要求,对功耗管理机制较为敏感的任务。例如,从性能要求的角度来看,第一类任务可以包括但不限于:对处理时延要求较高(例如要求时延小于设定的时延阈值)的任务,对实时 性要求较高(例如要求响应时间不能超过设定的响应时间阈值)的任务,等等。例如,一些控制类任务可能对实时性要求较高。又例如,一些中断类任务(例如网络中断处理任务)对时延要求较高。另外,实时调度类任务、即时分析类任务、即时查询类任务等都可作为第一类任务的示例。需要说明的是,本实施例并不对第一类任务进行限定,允许根据应用场景灵活设定。Among them, the first type of tasks can be tasks that have certain requirements on performance and are more sensitive to power management mechanisms. For example, from the perspective of performance requirements, the first type of tasks can include, but are not limited to: tasks that require high processing delay (for example, require a delay less than the set delay threshold), and have high real-time requirements ( For example, tasks that require response time not to exceed the set response time threshold), and so on. For example, some control tasks may have higher real-time requirements. For another example, some interrupt tasks (such as network interrupt processing tasks) have higher requirements for time delay. In addition, real-time scheduling tasks, instant analysis tasks, and instant query tasks can all be used as examples of the first type of tasks. It should be noted that this embodiment does not limit the first type of tasks, and allows flexible setting according to application scenarios.
在一可选实施例中,多核处理器41在将待处理任务分配到功耗管理机制处于禁用状态的处理器核上时,具体用于:将功耗管理机制处于禁用状态的各处理器核401的利用率进行比较,从中选择利用率低于设定利用率阈值或者从中选择利用率最低的处理器核401,将待处理任务分配给所选择的处理器核401。In an optional embodiment, when the multi-core processor 41 allocates tasks to be processed to the processor cores whose power management mechanism is in the disabled state, it is specifically used to: each processor core whose power management mechanism is in the disabled state The utilization rate of 401 is compared, the utilization rate is lower than the set utilization threshold value or the processor core 401 with the lowest utilization rate is selected from among them, and the task to be processed is allocated to the selected processor core 401.
在另一可选实施例中,多核处理器41在将待处理任务分配到功耗管理机制处于禁用状态的处理器核上时,具体用于:将功耗管理机制处于禁用状态的各处理器核401的负载量进行比较,从中选择负载量低于设定负载量阈值或从中选择负载量最低的处理器核401,将待处理任务分配给所选择的处理器核401。In another optional embodiment, when the multi-core processor 41 allocates tasks to be processed to the processor cores whose power management mechanism is disabled, it is specifically used to: each processor whose power management mechanism is disabled The load of the cores 401 is compared, and the load is lower than the set load threshold or the processor core 401 with the lowest load is selected, and the task to be processed is allocated to the selected processor core 401.
在又一可选实施例中,多核处理器41在将待处理任务分配到功耗管理机制处于禁用状态的处理器核上时,具体用于:将功耗管理机制处于禁用状态的各处理器核401的工作频率进行比较,从中选择工作频率高于设定频率阈值或工作频率最高的处理器核401,将待处理任务分配给所选择的处理器核401。In yet another optional embodiment, when the multi-core processor 41 allocates tasks to be processed to the processor cores whose power management mechanism is disabled, it is specifically used to: each processor whose power management mechanism is disabled The operating frequencies of the cores 401 are compared, and the processor core 401 whose operating frequency is higher than the set frequency threshold or the highest operating frequency is selected, and the tasks to be processed are allocated to the selected processor core 401.
在又一可选实施例中,多核处理器41在将待处理任务分配到功耗管理机制处于禁用状态的处理器核上时,具体用于:采用哈希算法将待处理任务分配到某个功耗管理机制处于禁用状态的各处理器核401上。In another alternative embodiment, when the multi-core processor 41 allocates the task to be processed to the processor core whose power management mechanism is disabled, it is specifically used to: use a hash algorithm to allocate the task to be processed to a certain processor core. The power consumption management mechanism is on each processor core 401 in a disabled state.
在一可选实施例中,多核处理器41还用于:在待处理任务属于第二类任务的情况下,将待处理任务分配到功耗管理机制处于启用状态的处理器核上。其中,第二类任务是指除第一类任务之外的其它任务。In an optional embodiment, the multi-core processor 41 is further configured to: if the task to be processed belongs to the second type of task, allocate the task to be processed to the processor cores whose power management mechanism is in the enabled state. Among them, the second type of tasks refer to tasks other than the first type of tasks.
在一些可选实施例中,在多个处理器核401中,有一部分处理器核401 上的功耗管理机制处于禁用状态,另一部分处理器核401上的功耗管理机制处于启用状态,从而形成异构多核处理器。在这些实施例中,功耗管理机制处于禁用状态的处理器核401的数量和功耗管理机制处于启用状态的处理器核401的数量是固定不变的。In some alternative embodiments, among the multiple processor cores 401, the power management mechanism on some of the processor cores 401 is disabled, and the power management mechanism on the other part of the processor cores 401 is enabled, so Form a heterogeneous multi-core processor. In these embodiments, the number of processor cores 401 with the power management mechanism in the disabled state and the number of processor cores 401 with the power management mechanism in the enabled state are fixed.
在另一些可选实施例中,在多个处理器核401中,有一部分处理器核401上的功耗管理机制处于禁用状态,另一部分处理器核401上的功耗管理机制处于启用状态,从而形成异构多核处理器。在这些实施例中,功耗管理机制处于禁用状态的处理器核401的数量可根据应用需求动态变化;相应地,功耗管理机制处于启用状态的处理器核401的数量也会根据应用需求动态变化。In other alternative embodiments, among the multiple processor cores 401, the power management mechanism on some of the processor cores 401 is disabled, and the power management mechanism on the other part of the processor cores 401 is enabled. Thus forming a heterogeneous multi-core processor. In these embodiments, the number of processor cores 401 with the power management mechanism in the disabled state can be dynamically changed according to application requirements; accordingly, the number of processor cores 401 with the power management mechanism in the enabled state will also be dynamically changed according to the application requirements. Variety.
基于上述,多核处理器41还用于执行存储器42中的计算机程序(主要是指管理程序),以用于:根据应用需求动态调整多个处理器核401上的功耗管理机制的状态。需要说明的是,实际执行管理程序的可以是多核处理器41中的某个或某几个处理器核401。Based on the foregoing, the multi-core processor 41 is also used to execute a computer program (mainly refers to a management program) in the memory 42 to dynamically adjust the state of the power consumption management mechanism on the multiple processor cores 401 according to application requirements. It should be noted that the actual execution of the hypervisor may be one or several processor cores 401 in the multi-core processor 41.
进一步,多核处理器41在动态调整多个处理器核401上的功耗管理机制的状态时,具体用于:在功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求的情况下,从功耗管理机制处于启用状态的处理器核中选择待禁用处理器核,并将所述待禁用处理器核上的功耗管理机制禁用。Further, when the multi-core processor 41 dynamically adjusts the state of the power management mechanism on the multiple processor cores 401, it is specifically used for: when the overall processing capacity of the processor core whose power management mechanism is disabled cannot meet application requirements In this case, the processor core to be disabled is selected from the processor cores in which the power consumption management mechanism is in the enabled state, and the power consumption management mechanism on the processor core to be disabled is disabled.
进一步,多核处理器41在动态调整多个处理器核401上的功耗管理机制的状态时,具体用于:在功耗管理机制处于禁用状态的处理器核的整体处理能力满足应用需求且过剩的情况下,从功耗管理机制处于禁用状态的处理器核中选择待启用处理器核,并重新启用所述待启用处理器核上的功耗管理机制。Further, when the multi-core processor 41 dynamically adjusts the state of the power management mechanism on the multiple processor cores 401, it is specifically used to: when the power management mechanism is disabled, the overall processing capacity of the processor core meets application requirements and is in excess In the case of, select the processor core to be enabled from the processor cores whose power management mechanism is in a disabled state, and re-enable the power consumption management mechanism on the processor core to be enabled.
进一步,多核处理器41还用于:监控功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载;根据功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。Further, the multi-core processor 41 is also used to: monitor the utilization and/or load of each processor core in the disabled state of the power management mechanism; according to the utilization and/or the utilization of each processor core in the disabled state of the power management mechanism Load, to determine whether the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements.
可选地,多核处理器41在选择待禁用处理器核时,具体用于:从功耗管 理机制处于启用状态的处理器核中,随机选择一个或多个处理器核作为待禁用处理器核;或者,将功耗管理机制处于启用状态的处理器核中的所有处理器核作为待禁用处理器核;或者,依据应用需求对应的任务量,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为待禁用处理器核;或者,依据处理器核的处理能力,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为待禁用处理器核。Optionally, when the multi-core processor 41 selects the processor cores to be disabled, it is specifically used to: randomly select one or more processor cores as the processor cores to be disabled from the processor cores whose power management mechanism is in the enabled state ; Or, use all the processor cores in the processor cores with the power management mechanism in the enabled state as the processor cores to be disabled; or, according to the task volume corresponding to the application requirements, from the processor cores with the power management mechanism in the enabled state Select one or more processor cores as the processor cores to be disabled; or, according to the processing capabilities of the processor cores, select one or more processor cores from the processor cores in which the power management mechanism is enabled. The processor core is to be disabled.
可选地,多核处理器41在选择待启用处理器核时,具体用于:从功耗管理机制处于禁用状态的处理器核中,随机选择一个或多个处理器核作为待启用处理器核;或者,依据应用需求对应的任务量,从功耗管理机制处于禁用状态的处理器核中,选择一个或多个处理器核作为待启用处理器核;或者,依据处理器核的处理能力,从功耗管理机制处于禁用状态的处理器核中,选择一个或多个处理器核作为待启用处理器核。Optionally, when the multi-core processor 41 selects the processor cores to be enabled, it is specifically used to: randomly select one or more processor cores as the processor cores to be enabled from the processor cores whose power management mechanism is in a disabled state ; Or, according to the task volume corresponding to the application requirements, select one or more processor cores from the processor cores in the disabled state of the power management mechanism as the processor cores to be enabled; or, according to the processing capabilities of the processor cores, From the processor cores in which the power management mechanism is in the disabled state, one or more processor cores are selected as the processor cores to be enabled.
关于本实施例中各操作的详细描述,可参见前述多核处理器实施例和方法实施例中的描述,在此不再赘述。For a detailed description of each operation in this embodiment, please refer to the description in the foregoing multi-core processor embodiment and method embodiment, which will not be repeated here.
进一步,如图4所示,该计算机设备还包括:通信组件43、显示器44、电源组件45、音频组件46等其它组件。图4中仅示意性给出部分组件,并不意味着计算机设备只包括图4所示组件。另外,图4中虚线框内的组件为可选组件,而非必选组件,具体可视计算机设备的产品形态而定。本实施例的计算机设备可以实现为台式电脑、笔记本电脑、智能手机或IOT设备等终端设备,也可以是常规服务器、云服务器或服务器阵列等服务端设备,还可以实现为网络接口卡、网络路由器、网关等网络设备。若本实施例的计算机设备实现为台式电脑、笔记本电脑、智能手机等终端设备,可以包含图4中虚线框内的组件;若本实施例的计算机设备实现为常规服务器、云服务器或服务器阵列等服务端设备,或者实现为网络接口卡、网络路由器、网关等网络设备,则可以不包含图4中虚线框内的组件。Further, as shown in FIG. 4, the computer device further includes: a communication component 43, a display 44, a power supply component 45, an audio component 46 and other components. Only some of the components are schematically shown in FIG. 4, which does not mean that the computer device only includes the components shown in FIG. 4. In addition, the components in the dashed box in FIG. 4 are optional components, not mandatory components, and the specifics may depend on the product form of the computer equipment. The computer device in this embodiment can be implemented as a terminal device such as a desktop computer, a notebook computer, a smart phone, or an IOT device, or a server device such as a conventional server, a cloud server, or a server array, and can also be implemented as a network interface card or a network router , Gateways and other network equipment. If the computer device of this embodiment is implemented as a terminal device such as a desktop computer, a notebook computer, a smart phone, etc., it may include the components in the dashed box in FIG. 4; if the computer device of this embodiment is implemented as a conventional server, a cloud server, or a server array, etc. The server device, or implemented as a network device such as a network interface card, a network router, or a gateway, may not include the components in the dashed box in FIG. 4.
本实施例提供的计算机设备,采用多核处理器,多核处理器包括多个处理器核,且至少一个处理器核上的功耗管理机制处于禁用状态,该多核处理 器中的处理器核支持功耗管理机制,有利于节约多核处理器的功耗;而通过禁用一些处理器核上的功耗管理机制,可在这些处理器核上执行一些对功耗管理机制比较敏感的任务,有利于保证这些任务的性能要求。由此可见,本实施例提供的计算机设备,可在降低整体功耗的情况下,尽量减少性能上的损失,保证任务的执行效率。The computer device provided in this embodiment adopts a multi-core processor. The multi-core processor includes multiple processor cores, and the power consumption management mechanism on at least one processor core is disabled. The processor cores in the multi-core processor support functions. The power consumption management mechanism is conducive to saving the power consumption of multi-core processors; and by disabling the power management mechanism on some processor cores, some tasks that are sensitive to the power management mechanism can be performed on these processor cores, which is conducive to ensuring The performance requirements of these tasks. It can be seen that the computer device provided in this embodiment can reduce performance loss as much as possible while reducing overall power consumption, and ensure task execution efficiency.
相应地,本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,计算机程序被处理器执行时,致使处理器实现上述方法实施例中的各步骤。需要说明的是,本实施例的计算机程序可以是系统级程序,也可以是应用级程序,还可以同时系统级程序和应用级程序。Correspondingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor causes the processor to implement the steps in the foregoing method embodiments. It should be noted that the computer program in this embodiment may be a system-level program, an application-level program, or both a system-level program and an application-level program.
例如,本实施例的计算机程序包括与功耗管理机制对应的程序,还包括:与任务调度有关的程序,以及与功耗管理机制的状态调整有关的程序。与任务调度有关的程序相当于前述实施例中的调度器,可简称为调度程序。与功耗管理机制的状态调整有关的程序相当于前述实施例中的管理器,可简称为管理程序。调度程序可以是操作系统级的程序,也可以是应用级别的程序。相应地,管理程序可以是操作系统级的程序,也可以是应用级别的程序。For example, the computer program in this embodiment includes a program corresponding to the power consumption management mechanism, and also includes: a program related to task scheduling and a program related to the state adjustment of the power consumption management mechanism. The program related to task scheduling is equivalent to the scheduler in the foregoing embodiment, and may be simply referred to as the scheduler. The program related to the state adjustment of the power consumption management mechanism is equivalent to the manager in the foregoing embodiment, and may be simply referred to as the management program. The scheduler can be an operating system level program or an application level program. Correspondingly, the management program can be an operating system level program or an application level program.
上述图4中的通信组件被配置为便于通信组件所在设备和其他设备之间有线或无线方式的通信。通信组件所在设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件还可以包括近场通信(NFC)模块,射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术等。The above-mentioned communication component in FIG. 4 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination of them. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may further include a near field communication (NFC) module, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology Wait.
上述图4中的显示器包括屏幕,其屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。The above-mentioned display in FIG. 4 includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
上述图4中的电源组件,为电源组件所在设备的各种组件提供电力。电源组件可以包括电源管理系统,一个或多个电源,及其他与为电源组件所在设备生成、管理和分配电力相关联的组件。The power supply components in Figure 4 above provide power for various components of the equipment where the power supply components are located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.
上述图4中的音频组件,可被配置为输出和/或输入音频信号。例如,音频组件包括一个麦克风(MIC),当音频组件所在设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器或经由通信组件发送。在一些实施例中,音频组件还包括一个扬声器,用于输出音频信号。The audio component in FIG. 4 may be configured to output and/or input audio signals. For example, the audio component includes a microphone (MIC). When the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的 处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or they also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The foregoing descriptions are only examples of the present application, and are not used to limit the present application. For those skilled in the art, this application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the scope of the claims of this application.
Claims (27)
- 一种多核处理器,其特征在于,包括:多个处理器核;其中,至少一个处理器核上的功耗管理机制处于禁用状态。A multi-core processor is characterized by comprising: a plurality of processor cores; wherein the power consumption management mechanism on at least one of the processor cores is in a disabled state.
- 根据权利要求1所述的多核处理器,其特征在于,2N个处理器核上的功耗管理机制处于禁用状态;N是正整数。The multi-core processor according to claim 1, wherein the power consumption management mechanism on the 2N processor cores is in a disabled state; N is a positive integer.
- 根据权利要求1所述的多核处理器,其特征在于,所述多个处理器核上运行有调度器;The multi-core processor according to claim 1, wherein a scheduler runs on the multiple processor cores;所述调度器,用于接收待处理任务,并在所述待处理任务属于第一类任务的情况下,将所述待处理任务分配到功耗管理机制处于禁用状态的处理器核上。The scheduler is configured to receive the to-be-processed task, and when the to-be-processed task belongs to the first type of task, allocate the to-be-processed task to the processor core whose power consumption management mechanism is in a disabled state.
- 根据权利要求3所述的多核处理器,其特征在于,所述调度器还用于:The multi-core processor according to claim 3, wherein the scheduler is further configured to:在所述待处理任务属于第二类任务的情况下,将所述待处理任务分配到功耗管理机制处于启用状态的处理器核上。In the case that the task to be processed belongs to the second type of task, the task to be processed is allocated to the processor cores whose power consumption management mechanism is in an enabled state.
- 根据权利要求1所述的多核处理器,其特征在于,所述多个处理器核上运行有管理器;The multi-core processor according to claim 1, wherein a manager runs on the plurality of processor cores;所述管理器,用于根据应用需求动态调整所述多个处理器核上的功耗管理机制的状态。The manager is configured to dynamically adjust the state of the power consumption management mechanism on the multiple processor cores according to application requirements.
- 根据权利要求5所述的多核处理器,其特征在于,所述管理器具体用于:The multi-core processor according to claim 5, wherein the manager is specifically configured to:在功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求的情况下,从功耗管理机制处于启用状态的处理器核中选择待禁用处理器核,并将所述待禁用处理器核上的功耗管理机制禁用。When the overall processing capacity of the processor core with the power management mechanism in the disabled state cannot meet the application requirements, select the processor core to be disabled from the processor cores with the power management mechanism in the enabled state, and set the processor core to be disabled. The power management mechanism on the processor core is disabled.
- 根据权利要求6所述的多核处理器,其特征在于,所述管理器在选择所述待禁用处理器时,具体用于:The multi-core processor according to claim 6, wherein when the manager selects the processor to be disabled, it is specifically configured to:从功耗管理机制处于启用状态的处理器核中,随机选择一个或多个处理器核作为所述待禁用处理器核;或者Randomly select one or more processor cores as the processor cores to be disabled from the processor cores whose power management mechanism is in the enabled state; or将功耗管理机制处于启用状态的处理器核中的所有处理器核作为所述待禁用处理器核;或者Use all the processor cores in the processor cores with the power management mechanism in the enabled state as the processor cores to be disabled; or依据应用需求对应的任务量,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为所述待禁用处理器核;或者According to the task volume corresponding to the application requirements, select one or more processor cores as the to-be-disabled processor cores from the processor cores whose power management mechanism is in the enabled state; or依据处理器核的处理能力,从功耗管理机制处于启用状态的处理器核中,选择一个或多个处理器核作为所述待禁用处理器核。According to the processing capabilities of the processor cores, one or more processor cores are selected as the processor cores to be disabled from the processor cores in which the power management mechanism is in the enabled state.
- 根据权利要求7所述的多核处理器,其特征在于,所述多个处理器核包括第一类处理器核和第二类处理器核;所述第一类处理器核的处理能力强于所述第二类处理器核的处理能力。The multi-core processor according to claim 7, wherein the plurality of processor cores comprise a first type of processor core and a second type of processor core; the processing capability of the first type of processor core is stronger than The processing capability of the second type of processor core.
- 根据权利要求7所述的多核处理器,其特征在于,所述管理器在依据处理器核的处理能力选择所述待禁用处理器核时,具体用于:The multi-core processor according to claim 7, wherein the manager is specifically configured to: when selecting the processor core to be disabled according to the processing capability of the processor core:若存在功耗管理机制处于启用状态的第二类处理器核,从功耗管理机制处于启用状态的第二类处理器核中选择所述待禁用处理器核;If there is a second type of processor core with a power management mechanism in an enabled state, select the to-be-disabled processor core from the second type of processor core with a power management mechanism in the enabled state;若不存在功耗管理机制处于启用状态的第二类处理器核,从功耗管理机制处于启用状态的第一类处理器核中选择所述待禁用处理器核。If there is no second-type processor core with the power management mechanism in the enabled state, select the to-be-disabled processor core from the first-type processor cores with the power management mechanism in the enabled state.
- 根据权利要求7所述的多核处理器,其特征在于,所述管理器在依据处理器核的处理能力选择所述待禁用处理器时,具体用于:The multi-core processor according to claim 7, wherein the manager is specifically configured to: when selecting the processor to be disabled according to the processing capability of the processor core:在应用需求对应的任务量大于或等于设定的任务量阈值的情况下,从功耗管理机制处于启用状态的第一类处理器核中选择所述待禁用处理器核;In the case that the task amount corresponding to the application requirement is greater than or equal to the set task amount threshold, select the processor core to be disabled from the first type of processor cores whose power management mechanism is in an enabled state;在应用需求对应的任务量小于设定的任务量阈值的情况下,从功耗管理机制处于启用状态的第二类处理器核中选择所述待禁用处理器核。In the case that the task amount corresponding to the application requirement is less than the set task amount threshold, the processor core to be disabled is selected from the second type of processor cores in which the power consumption management mechanism is in the enabled state.
- 根据权利要求5所述的多核处理器,其特征在于,所述管理器还用于:The multi-core processor according to claim 5, wherein the manager is further configured to:监控功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载量;Monitor the utilization and/or load of each processor core whose power management mechanism is disabled;根据功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载量,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。According to the utilization rate and/or load of each processor core with the power management mechanism in the disabled state, it is determined whether the overall processing capability of the processor core with the power management mechanism in the disabled state meets the application requirements.
- 根据权利要求5所述的多核处理器,其特征在于,所述管理器还用于:The multi-core processor according to claim 5, wherein the manager is further configured to:在功耗管理机制处于禁用状态的处理器核的整体处理能力满足应用需求且过剩的情况下,从功耗管理机制处于禁用状态的处理器核中选择待启用处理器核,并重新启用所述待启用处理器核上的功耗管理机制。When the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements and is surplus, select the processor core to be enabled from the processor cores with the power management mechanism in the disabled state, and re-enable the The power management mechanism on the processor core is to be enabled.
- 根据权利要求10所述的多核处理器,其特征在于,所述多核处理器为ARM处理器或X86处理器。The multi-core processor according to claim 10, wherein the multi-core processor is an ARM processor or an X86 processor.
- 一种多核处理器调度方法,其特征在于,包括:A scheduling method for a multi-core processor, which is characterized in that it comprises:接收待处理任务;Receive pending tasks;在所述待处理任务属于第一类任务的情况下,将所述待处理任务分配到所述多核处理器中功耗管理机制处于禁用状态的处理器核上;In the case that the task to be processed belongs to the first type of task, allocating the task to be processed to the processor core of the multi-core processor whose power consumption management mechanism is in a disabled state;其中,所述多核处理器包括多个处理器核,其中,至少一个处理器核上的功耗管理机制处于禁用状态。Wherein, the multi-core processor includes a plurality of processor cores, wherein a power consumption management mechanism on at least one processor core is in a disabled state.
- 根据权利要求14所述的方法,其特征在于,还包括:The method according to claim 14, further comprising:在所述待处理任务属于第二类任务的情况下,将所述待处理任务分配到所述多核处理器中功耗管理机制处于启用状态的处理器核上。In the case that the task to be processed belongs to the second type of task, the task to be processed is allocated to the processor core of the multi-core processor whose power consumption management mechanism is in the enabled state.
- 根据权利要求14所述的方法,其特征在于,还包括:The method according to claim 14, further comprising:在功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求的情况下,从功耗管理机制处于启用状态的处理器核中选择待禁用处理器核,并将所述待禁用处理器核上的功耗管理机制禁用。When the overall processing capacity of the processor core with the power management mechanism in the disabled state cannot meet the application requirements, select the processor core to be disabled from the processor cores with the power management mechanism in the enabled state, and set the processor core to be disabled. The power management mechanism on the processor core is disabled.
- 根据权利要求16所述的方法,其特征在于,还包括:The method according to claim 16, further comprising:监控功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载;Monitor the utilization and/or load of each processor core whose power management mechanism is disabled;根据功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。According to the utilization rate and/or load of each processor core with the power management mechanism in the disabled state, it is determined whether the overall processing capability of the processor core with the power management mechanism in the disabled state meets application requirements.
- 根据权利要求16所述的方法,其特征在于,还包括:The method according to claim 16, further comprising:在功耗管理机制处于禁用状态的处理器核的整体处理能力满足应用需求 且过剩的情况下,从功耗管理机制处于禁用状态的处理器核中选择待启用处理器核,并重新启用所述待启用处理器核上的功耗管理机制。When the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements and is surplus, select the processor core to be enabled from the processor cores with the power management mechanism in the disabled state, and re-enable the The power management mechanism on the processor core is to be enabled.
- 一种计算机设备,其特征在于,包括:多核处理器:所述多核处理器包括多个处理器核,其中,至少一个处理器核上的功耗管理机制被禁用。A computer device is characterized by comprising: a multi-core processor: the multi-core processor includes a plurality of processor cores, wherein the power consumption management mechanism on at least one of the processor cores is disabled.
- 根据权利要求19所述的计算机设备,其特征在于,还包括:The computer device according to claim 19, further comprising:存储器,用于存储计算机程序;Memory, used to store computer programs;所述多核处理器,与所述存储器耦合,用于执行所述计算机程序,以用于:The multi-core processor is coupled with the memory, and is configured to execute the computer program for:接收待处理任务;在所述待处理任务属于第一类任务的情况下,将所述待处理任务分配到功耗管理机制处于禁用状态的处理器核上。Receiving the task to be processed; in the case that the task to be processed belongs to the first type of task, the task to be processed is allocated to the processor core whose power consumption management mechanism is in a disabled state.
- 根据权利要求20所述的计算机设备,其特征在于,所述多核处理器还用于:The computer device according to claim 20, wherein the multi-core processor is further configured to:在所述待处理任务属于第二类任务的情况下,将所述待处理任务分配到功耗管理机制处于启用状态的处理器核上。In the case that the task to be processed belongs to the second type of task, the task to be processed is allocated to the processor cores whose power consumption management mechanism is in an enabled state.
- 根据权利要求20所述的计算机设备,其特征在于,所述多核处理器还用于:根据应用需求动态调整所述多个处理器核上的功耗管理机制的状态。22. The computer device of claim 20, wherein the multi-core processor is further configured to dynamically adjust the state of the power consumption management mechanism on the multiple processor cores according to application requirements.
- 根据权利要求22所述的计算机设备,其特征在于,所述多核处理器具体用于:The computer device according to claim 22, wherein the multi-core processor is specifically configured to:在功耗管理机制处于禁用状态的处理器核的整体处理能力无法满足应用需求的情况下,从功耗管理机制处于启用状态的处理器核中选择待禁用处理器核,并将所述待禁用处理器核上的功耗管理机制禁用。When the overall processing capacity of the processor core with the power management mechanism in the disabled state cannot meet the application requirements, select the processor core to be disabled from the processor cores with the power management mechanism in the enabled state, and set the processor core to be disabled. The power management mechanism on the processor core is disabled.
- 根据权利要求22所述的计算机设备,其特征在于,所述多核处理器具体用于:The computer device according to claim 22, wherein the multi-core processor is specifically configured to:在功耗管理机制处于禁用状态的处理器核的整体处理能力满足应用需求且过剩的情况下,从功耗管理机制处于禁用状态的处理器核中选择待启用处理器核,并重新启用所述待启用处理器核上的功耗管理机制。When the overall processing capacity of the processor core with the power management mechanism in the disabled state meets the application requirements and is surplus, select the processor core to be enabled from the processor cores with the power management mechanism in the disabled state, and re-enable the The power management mechanism on the processor core is to be enabled.
- 根据权利要求23或24所述的计算机设备,其特征在于,所述多核 处理器还用于:The computer device according to claim 23 or 24, wherein the multi-core processor is further configured to:监控功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载;Monitor the utilization and/or load of each processor core whose power management mechanism is disabled;根据功耗管理机制处于禁用状态的各个处理器核的利用率和/或负载,确定功耗管理机制处于禁用状态的处理器核的整体处理能力是否满足应用需求。According to the utilization rate and/or load of each processor core with the power management mechanism in the disabled state, it is determined whether the overall processing capability of the processor core with the power management mechanism in the disabled state meets application requirements.
- 一种存储有计算机程序的计算机可读存储介质,其特征在于,当所述计算机程序被处理器执行时,致使所述处理器实现权利要求14-18任一项所述方法中的步骤。A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to implement the steps in the method of any one of claims 14-18.
- 根据权利要求26所述的存储介质,其特征在于,所述计算机程序为系统级程序;或者,所述计算机程序为应用级程序;或者,所述计算机程序包括系统级程序和应用级程序。The storage medium according to claim 26, wherein the computer program is a system-level program; or, the computer program is an application-level program; or, the computer program includes a system-level program and an application-level program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/114383 WO2021081813A1 (en) | 2019-10-30 | 2019-10-30 | Multi-core processor and scheduling method therefor, device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/114383 WO2021081813A1 (en) | 2019-10-30 | 2019-10-30 | Multi-core processor and scheduling method therefor, device, and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021081813A1 true WO2021081813A1 (en) | 2021-05-06 |
Family
ID=75715688
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/114383 WO2021081813A1 (en) | 2019-10-30 | 2019-10-30 | Multi-core processor and scheduling method therefor, device, and storage medium |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2021081813A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117112486A (en) * | 2023-08-09 | 2023-11-24 | 协创芯片(上海)有限公司 | Soc chip with low power consumption |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103229123A (en) * | 2010-11-25 | 2013-07-31 | 飞思卡尔半导体公司 | Method and apparatus for managing power in a multi-ore processor |
WO2013162589A1 (en) * | 2012-04-27 | 2013-10-31 | Intel Corporation | Migrating tasks between asymmetric computing elements of a multi-core processor |
US20140181538A1 (en) * | 2012-12-21 | 2014-06-26 | Jeremy J. Shrall | Controlling Configurable Peak Performance Limits Of A Processor |
CN104011704A (en) * | 2011-12-22 | 2014-08-27 | 英特尔公司 | Asymmetric performance multicore architecture with same instruction set architecture (ISA) |
CN107918557A (en) * | 2016-10-05 | 2018-04-17 | 联发科技股份有限公司 | A kind of apparatus and method and multiple nucleus system for running multiple nucleus system |
-
2019
- 2019-10-30 WO PCT/CN2019/114383 patent/WO2021081813A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103229123A (en) * | 2010-11-25 | 2013-07-31 | 飞思卡尔半导体公司 | Method and apparatus for managing power in a multi-ore processor |
CN104011704A (en) * | 2011-12-22 | 2014-08-27 | 英特尔公司 | Asymmetric performance multicore architecture with same instruction set architecture (ISA) |
WO2013162589A1 (en) * | 2012-04-27 | 2013-10-31 | Intel Corporation | Migrating tasks between asymmetric computing elements of a multi-core processor |
US20140181538A1 (en) * | 2012-12-21 | 2014-06-26 | Jeremy J. Shrall | Controlling Configurable Peak Performance Limits Of A Processor |
CN107918557A (en) * | 2016-10-05 | 2018-04-17 | 联发科技股份有限公司 | A kind of apparatus and method and multiple nucleus system for running multiple nucleus system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117112486A (en) * | 2023-08-09 | 2023-11-24 | 协创芯片(上海)有限公司 | Soc chip with low power consumption |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10509677B2 (en) | Granular quality of service for computing resources | |
WO2021008543A1 (en) | Resource scheduling method and electronic device | |
US9292068B2 (en) | Controlling a turbo mode frequency of a processor | |
US9378536B2 (en) | CPU/GPU DCVS co-optimization for reducing power consumption in graphics frame processing | |
US9697124B2 (en) | Systems and methods for providing dynamic cache extension in a multi-cluster heterogeneous processor architecture | |
US20150242243A1 (en) | Processor power optimization with response time assurance | |
US9411649B2 (en) | Resource allocation method | |
US9465622B2 (en) | Application defined computing component configuration | |
CN101403982A (en) | Task distribution method, system and equipment for multi-core processor | |
US10503238B2 (en) | Thread importance based processor core parking and frequency selection | |
US20170212581A1 (en) | Systems and methods for providing power efficiency via memory latency control | |
US20120297216A1 (en) | Dynamically selecting active polling or timed waits | |
US11010094B2 (en) | Task management method and host for electronic storage device | |
US10089266B2 (en) | Power saving feature for storage subsystems | |
US11113216B2 (en) | Dispatching interrupts in a multi-processor system based on power and performance factors | |
US10037225B2 (en) | Method and system for scheduling computing | |
US20160034310A1 (en) | Job assignment in a multi-core processor | |
WO2024088268A1 (en) | Rdma event management methods, and device and storage medium | |
US20190391940A1 (en) | Technologies for interrupt disassociated queuing for multi-queue i/o devices | |
WO2024119988A1 (en) | Process scheduling method and apparatus in multi-cpu environment, electronic device, and medium | |
WO2023221846A1 (en) | Computing cluster and data acquisition method and device thereof, and storage medium | |
CN110795323A (en) | Load statistical method, device, storage medium and electronic equipment | |
WO2021081813A1 (en) | Multi-core processor and scheduling method therefor, device, and storage medium | |
US20210294641A1 (en) | Dynamic interrupt steering and processor unit idle state demotion | |
US20210182194A1 (en) | Processor unit resource exhaustion detection and remediation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19950661 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19950661 Country of ref document: EP Kind code of ref document: A1 |