WO2021078144A1 - 能耗管理的方法和设备 - Google Patents

能耗管理的方法和设备 Download PDF

Info

Publication number
WO2021078144A1
WO2021078144A1 PCT/CN2020/122459 CN2020122459W WO2021078144A1 WO 2021078144 A1 WO2021078144 A1 WO 2021078144A1 CN 2020122459 W CN2020122459 W CN 2020122459W WO 2021078144 A1 WO2021078144 A1 WO 2021078144A1
Authority
WO
WIPO (PCT)
Prior art keywords
imu
cpu
firmware
frequency
energy consumption
Prior art date
Application number
PCT/CN2020/122459
Other languages
English (en)
French (fr)
Inventor
倪彬彬
宋东匡
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20878976.8A priority Critical patent/EP4033332A4/en
Publication of WO2021078144A1 publication Critical patent/WO2021078144A1/zh
Priority to US17/727,686 priority patent/US20220244772A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/324Power saving characterised by the action undertaken by lowering clock frequency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/20Cooling means
    • G06F1/206Cooling means comprising thermal management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3243Power saving in microcontroller unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3296Power saving characterised by the action undertaken by lowering the supply or operating voltage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Definitions

  • This application relates to the technical field of energy consumption management, and in particular to a method and equipment for energy consumption management.
  • servers are widely used in enterprises. Compared with general terminal-side computer equipment, the performance of the server is more stable. The management and maintenance cost of the server is also relatively high. The cost of the power provided to the server and the cooling of the server account for a large part of the management and maintenance cost of the server. Therefore, in order to reduce the cost of power and cooling of the server, it is necessary to carry out effective energy management of the server to control its power consumption and heat production.
  • OS operating system
  • PM operating system power management
  • IMU intelligent management unit
  • the IMU firmware After the IMU firmware receives the frequency and voltage regulation request sent by the OS, it obtains the voltage regulation value and the frequency regulation value, and according to the voltage regulation value and the frequency regulation value pair The frequency and voltage of the CPU are adjusted, and after the adjustment is completed, the adjustment complete message is fed back to the OS.
  • OS PM is initiated by the OS and needs to be notified to the IMU firmware first, and then the IMU firmware performs frequency and voltage regulation. This adjustment process is cumbersome and has a large time delay.
  • the embodiments of the present application provide a method and equipment for energy consumption management, which can solve the problem of cumbersome adjustment process in related energy consumption management.
  • the technical solution is as follows:
  • a method for energy consumption management for the energy consumption management of an electronic device.
  • the electronic device includes a central processing unit (CPU) and a memory; the memory stores startup firmware, an operating system OS, and intelligent management.
  • a plurality of program instructions corresponding to the unit IMU firmware respectively, and the plurality of program instructions are used to be read and executed by the CPU to realize the functions of the startup firmware, the OS, and the IMU firmware, wherein the function
  • the method of consumption management is executed by the IMU firmware and includes:
  • the smart management unit energy management IMU PM execution notification is determined by the startup firmware before the OS runs and after it is determined that the IMU firmware executes the energy management PM Sent, the startup firmware is also used to prevent the OS from executing the operating system energy consumption management OS PM before the OS runs;
  • the IMU firmware After determining that the IMU firmware executes PM on the CPU according to the IMU PM execution notification, obtain the current performance parameters of the CPU, where the performance parameters include one of the power consumption, temperature, and usage rate of the CPU or Multiple; Based on the performance parameters, the CPU is energy-consumption management.
  • the IMU PM execution notification is used to notify the IMU to perform energy consumption management.
  • the IMU PM execution notification is sent by the startup firmware.
  • the sending timing can be sent after the OS is prevented from executing the OS PM before the OS is running, and the IMU firmware can obtain the IMU PM execution notification after the OS is prevented from executing the OS PM.
  • the IMU firmware receives the IMU PM execution command, it turns on the IMU PM.
  • the IMU firmware can periodically obtain the real-time performance parameters of the CPU, such as power consumption, temperature, and utilization. Then, according to the obtained performance parameters, the frequency and voltage of the CPU are adjusted to achieve the purpose of energy consumption management. In the above process, the acquisition of performance parameters and the adjustment of the frequency and voltage of the CPU are directly implemented by the IMU firmware, without interacting with the OS, reducing the adjustment delay of the CPU.
  • the IMU PM execution notification is an IMU PM execution instruction
  • the obtaining the IMU PM execution notification includes:
  • the PM setting option can be provided to the user through the startup setting interface, where the startup setting interface can be a UEFI setup interface or a BIOS interface.
  • the display screen of the electronic device can display a startup setting interface, and the user can select IMU PM in the PM setting options on the startup setting interface.
  • the data of the PM setting configuration item in the startup firmware startup configuration item is the data used to instruct the IMU to perform PM.
  • the startup firmware reads the data of the PM setting in the startup configuration item, it sends an IMU PM execution command to the IMU firmware. By directly sending the IMU PM execution command, the IMU firmware can be notified to execute the IMU PM in a more timely manner.
  • the IMU PM execution notification is the first preset data in a preset storage address
  • the obtaining the IMU PM execution notification includes:
  • the startup firmware writes the first preset data in the preset storage address.
  • the process for the IMU firmware to obtain the IMU PM execution notification is: the IMU firmware obtains the first preset data by polling the preset storage address.
  • the preset storage address is a storage address preset by a technician for storing PM execution notifications
  • the first preset data may be a binary number "1".
  • the startup firmware is used to prevent the OS from executing the operating system energy consumption management OS PM by the following method before the OS runs:
  • the state table is a performance support state PSS table or a continuous performance control CPC table.
  • the ACPI table may include one of the PSS table and the CPC table, and both the PSS table and the CPC table can provide the OS with adjustable frequency values supported by the CPU.
  • the PSS table provides multiple different levels of frequency adjustable values supported by the CPU.
  • the adjustable frequency of P0 level is 2001MHZ
  • the adjustable frequency of P2 level is 1900MHZ
  • the CPC table provides The upper and lower limits of the adjustable frequency supported by the CPU.
  • the OS can adjust the frequency of the CPU according to the adjustable frequency values supported by the CPU provided in the two tables.
  • the startup firmware can initialize the ACPI table without initializing the performance state table therein, and the OS cannot perform frequency modulation on the CPU. Through this solution, the OS can be prevented from executing OS PM more directly, and the processing efficiency is higher.
  • the startup firmware is used to prevent the OS from executing the operating system energy consumption management OS PM by the following method before the OS runs:
  • the second ACPI table includes a performance state table, and the frequency adjustable value in the performance state table included in the second ACPI table It is the same preset value, or the header of the performance state table included in the second ACPI table is a value with an undefined range, so as to prevent the OS from executing OS PM.
  • the startup firmware can initialize the adjustable frequency value in the performance state table to the same preset value.
  • the adjustable frequency values of each level can be initialized to the same preset value.
  • the adjustable frequency values of each level are initialized to the frequency adjustable values of P0.
  • the adjustable frequency values of each level can also be initialized to any same preset value, such as 0MHZ.
  • the upper limit and lower limit of the adjustable frequency value of the CPU can be initialized to the same preset value, for example, the upper limit of the adjustable frequency value is initialized to the lower limit of the adjustable frequency value, or, The lower limit of the adjustable frequency value can also be initialized to the upper limit of the adjustable frequency value, or, the lower limit and the upper limit of the adjustable frequency value can also be adjusted to any same preset value, such as 0MHZ. It is also possible to initialize the header of the performance status table to a value with an undefined range, so that the OS cannot find the frequency adjustable value through the header. With this solution, it is possible to prevent the OS from executing OS PM without modifying the structure of the ACPI table.
  • the method further includes: when the startup firmware is before the OS runs and after it is determined that PM is executed by the OS, the startup firmware performs the following operations:
  • the IMU firmware also performs the following operations:
  • the user in the PM setting option of the startup setting interface described above, the user can also select OS PM.
  • the data of the PM setting configuration item in the startup firmware startup configuration item is the data used to instruct the IMU to turn off the PM, and can also be understood as the data used to instruct the OS to execute the PM.
  • the startup firmware reads the data of the PM setting in the startup configuration item, it sends an IMU PM shutdown command to the IMU firmware.
  • the IMU firmware closes the IMU PM after receiving the IMU PM shutdown command.
  • the startup firmware when the startup firmware initializes the ACPI table, it can initialize the performance status table normally, that is, initialize the frequency adjustable value in the performance status table to the preset frequency adjustable value supported by the CPU, so that the OS can pass Load the ACPI table to determine the adjustable value of the CPU frequency, and then execute OS PM.
  • the method further includes: when the startup firmware is before the OS runs and after it is determined that PM is executed by the OS, the startup firmware performs the following operations:
  • the IMU firmware also performs the following operations:
  • the second preset data is obtained, and the IMU PM is turned off.
  • the foregoing processing of the startup firmware sending the IMU PM shutdown notification may be: the startup firmware writes the second preset data in the preset storage address.
  • the processing for the IMU firmware to obtain the IMU PM shutdown notification is: the IMU firmware obtains the second preset data by polling the preset storage address.
  • the preset storage address is a storage address preset by a technician for storing PM execution notifications
  • the second preset data may be a binary number "0".
  • the startup firmware when the startup firmware initializes the ACPI table, it can initialize the performance status table normally, that is, initialize the frequency adjustable value in the performance status table to the preset frequency adjustable value supported by the CPU, so that the OS can pass Load the ACPI table to determine the adjustable value of the CPU frequency, and then execute OS PM.
  • the startup firmware is basic input output system BIOS firmware or unified extensible firmware interface UEFI firmware.
  • the startup firmware can be BIOS firmware or UEFI firmware, and the startup firmware in different electronic devices may also be different.
  • the performance parameter includes the power consumption of the CPU, and before the acquisition of the current performance parameter of the CPU, the IMU firmware performs the following operations:
  • the performing energy consumption management on the CPU based on the performance parameter includes:
  • the frequency and voltage of the CPU are increased, where the preset multiple is greater than 0 and less than 1.
  • the user can choose whether to adjust the frequency and voltage of the CPU according to the power consumption of the CPU.
  • the user can input a code for limiting CPU power consumption to the out-of-band management system, and the out-of-band management system can send a power consumption limit command to the IMU firmware, where the power consumption limit command can carry a power consumption threshold.
  • the IMU obtains the current power consumption of the CPU in real time. If the current power consumption of the CPU obtained above is greater than the power consumption threshold sent by the out-of-band management system, the frequency and voltage of the CPU are reduced. In addition, the power and voltage of the IO interface of the CPU can be reduced at the same time.
  • the frequency of the CPU has been adjusted to the lowest adjustable value, some unused ports of each core in the CPU can be closed. If the power consumption of the CPU is less than a preset multiple of the power consumption threshold, the frequency and voltage of the CPU are increased, where the preset multiple is greater than 0 and less than 1, such as 0.95. In addition, the power and voltage of the IO interface of the CPU can be increased at the same time.
  • the performance parameter includes the temperature of the CPU
  • the energy consumption management of the CPU based on the performance parameter includes:
  • the frequency and voltage of the CPU are increased, where the third temperature threshold is less than the second temperature threshold.
  • a temperature sensor may be installed on the CPU, and the temperature sensor monitors the temperature of the CPU in real time.
  • the IMU firmware may periodically obtain the current temperature of the CPU from the temperature sensor, for example, the cycle may be 0.5 seconds.
  • a temperature sensor can periodically monitor the temperature of the CPU. When the temperature reaches the temperature control threshold, the temperature sensor will send the current temperature of the CPU to the IMU firmware. If the acquired current temperature of the CPU is greater than the first temperature threshold, a high temperature warning message is sent to the out-of-band management system. After receiving the high temperature alarm message, the out-of-band management system performs power-off protection for the CPU to prevent damage to the CPU due to excessive temperature.
  • the frequency and voltage of the CPU are reduced. In addition, you can also reduce the power and voltage of the IO interface of the CPU, increase the fan speed, and improve heat dissipation. If the temperature cannot be effectively reduced, you can also adjust the power domain status of each core in the CPU to remove some of the The power domain of the cores is adjusted to the off state, that is, these cores are shut down so that they no longer run and generate heat. If the temperature of the CPU is less than the third temperature threshold, the frequency and voltage of the CPU can be increased, where the third temperature threshold is less than the second temperature threshold. In addition, if the power supply of some cores in the CPU is adjusted to the off state in order to cool down, the power domain of these cores can be adjusted to the on state at this time, that is, the cores are turned on again.
  • the performance parameter includes a usage rate of the CPU
  • the energy consumption management of the CPU based on the performance parameter includes:
  • the frequency and voltage of the CPU are reduced.
  • a performance monitor unit may be installed on each core of the CPU, and the PMU is used to count the number of clocks of the core where it is in a non-idle state. For each statistical period, the PMU counts the number of clocks in the non-idle state of its core during the statistical period, and sends it to the IMU firmware.
  • the IMU firmware can divide the number of clocks in the non-idle state by the total number of clocks in the statistical period to obtain the utilization rate of the corresponding core in the statistical period.
  • the sum of the utilization rates of all cores in the clock domain, and then dividing by the number of cores in the clock domain, is the average utilization rate of the cores in the clock domain.
  • the utilization rate of the CPU is the average utilization rate of the cores in the clock domain.
  • multiple clock domains can also be set, for example, each core corresponds to a clock domain, or every several cores corresponds to a clock domain. In this case, the usage rate of the CPU can use these clocks.
  • the average utilization rate of cores in the domain is collectively represented.
  • the average utilization rate of the cores in each clock domain is obtained as described above, if the average utilization rate is greater than the first utilization rate threshold, the frequency and voltage of the cores in the clock domain can be increased. If the average usage rate is less than the second usage rate threshold, reduce the frequency and voltage of the cores in the clock domain, where the first usage rate threshold is less than the second usage rate threshold.
  • the performing energy consumption management on the CPU based on the performance parameter includes:
  • the configuration adjustment strategy Determining the configuration adjustment strategy corresponding to the target service type based on the pre-stored correspondence between the service type and the configuration adjustment strategy, where the configuration adjustment strategy includes at least the frequency to be used and the voltage to be used of the CPU;
  • the frequency and voltage of the CPU are adjusted to the frequency to be used and the voltage to be used, respectively.
  • the IMU firmware can input the periodically acquired CPU performance parameters and CPU voltage and frequency into the pre-trained feature extraction model and classifier model to obtain the corresponding target service type. Then, the corresponding relationship between the business classification and the configuration adjustment strategy is queried, and the configuration adjustment strategy corresponding to the target business type is obtained.
  • the configuration adjustment strategy includes the CPU to-be-used frequency and the to-be-used voltage. Then, the frequency of the CPU can be adjusted to the frequency to be used, and the voltage of the CPU can be adjusted to the voltage to be used. Through this scheme, the frequency and voltage adjustment of the CPU is more flexible.
  • a method for energy consumption management for the energy consumption management of an electronic device.
  • the electronic device includes a central processing unit (CPU) and a memory; the memory stores startup firmware, an operating system OS, and intelligent management.
  • a plurality of program instructions corresponding to the unit IMU firmware, and the plurality of program instructions are used to be read and executed by the CPU to realize the functions of the firmware, the OS, and the IMU firmware, wherein the energy consumption
  • the management method is executed by the IMU firmware and includes:
  • the user can enable the IMU PM through the out-of-band management system of the server, so that the IMU firmware is responsible for the PM.
  • the out-of-band management system may be a baseboard management controller (BMC).
  • BMC baseboard management controller
  • the user can enter the code to enable IMU PM into the out-of-band management system, and the out-of-band management system will send the first notification message to the IMU firmware through the intelligent platform management interface (IPMI), so that the IMU firmware will receive the After the first notification message, execute IMU PM.
  • IPMI intelligent platform management interface
  • the IMU firmware can interact with the OS so that the OS is no longer responsible for energy management.
  • the IMU firmware can periodically obtain the real-time performance parameters of the CPU, such as power consumption, temperature, and utilization. Then, according to the obtained performance parameters, the frequency and voltage of the CPU are adjusted to achieve the purpose of energy consumption management.
  • OS PM can be switched to IMU PM during OS operation, making the energy consumption management of electronic devices more flexible.
  • IMU The firmware is implemented directly without interacting with the OS, which reduces the adjustment delay of the CPU.
  • the interacting with the OS according to the first notification message so that the OS is no longer responsible for energy consumption management includes:
  • the first energy consumption management request may be a request for the OS to instruct the IMU to perform frequency modulation on the CPU.
  • the IMU firmware receives the first energy management request, it does not execute the frequency modulation operation corresponding to the first energy management request, but executes its own IMU PM.
  • the IMU firmware will not perform frequency modulation according to the first energy management request, after receiving the first energy management request, it can return a preset message to the OS.
  • the preset message may be a notification of successful execution. The message is to deceive the OS and make the OS think that it is in charge of the PM, but the IMU firmware is actually responsible. With this solution, there is no need to modify the ACPI table, which can make the OS PM switch to the IMU PM more efficient.
  • the interacting with the OS according to the first notification message includes:
  • a fourth ACPI table update message is sent to the OS, where the fourth ACPI table update message is used to instruct the OS to obtain the fourth updated ACPI table, so that the OS is based on the fourth updated ACPI table Close OS PM.
  • the ACPI table in order to prevent the OS from executing OS PM, can be obtained in the memory, the ACPI table can be updated, and then stored in the original storage address, and then the ACPI table update can be sent to the OS A message to instruct the OS to obtain and parse the ACPI table in memory, so that the OS cannot perform energy management based on the ACPI table.
  • the updating the fourth ACPI table includes:
  • the IMU firmware can obtain the ACPI table (the aforementioned fourth ACPI table) from the memory, remove the performance state table therein, and then store it in the original storage address. In this way, after the OS obtains the ACPI table, it cannot parse the performance state table, and thus cannot execute OS PM.
  • the ACPI table the aforementioned fourth ACPI table
  • the IMU firmware adjusts the frequency adjustable value in the performance state table in the ACPI table to the same preset value.
  • the performance status table is a PSS table
  • the adjustable frequency values of each level can be adjusted to the same preset value.
  • the adjustable frequency values of each level can be adjusted to the frequency adjustable value of P0.
  • the adjustable frequency value of each level can be adjusted to any same preset value, such as 0MHZ.
  • the upper and lower limits of the CPU frequency adjustable value can be adjusted to the same preset value, for example, the upper limit of the frequency adjustable value is adjusted to the lower limit of the frequency adjustable value, or, The lower limit of the adjustable frequency value can be adjusted to the upper limit of the adjustable frequency value, or the lower limit and the upper limit of the adjustable frequency value can be adjusted to any same preset value, such as 0MHZ.
  • the IMU firmware may modify the header of the performance status table in the ACPI table to a value with an undefined range, so that the OS cannot find the frequency adjustable value through the header.
  • the IMU firmware also performs the following operations:
  • the user can input the code for enabling the IMU PM into the out-of-band management system, and the out-of-band management system will send a second notification message to the IMU firmware through IPMI. If the current PM is OS PM, the second notification message may not be processed. If the current PM is IMU PM, after receiving the second notification message, the IMU PM needs to be turned off and the OS is responsible for the PM, which means it is turned on OS PM.
  • the interacting with the OS according to the second notification message so that the OS is responsible for energy consumption management includes:
  • the interacting with the OS according to the second notification message so that the OS is responsible for energy consumption management includes:
  • the IMU firmware can enable the OS to enable the OS PM by updating the ACPI table.
  • the updating the fifth ACPI table includes:
  • the fifth ACPI table does not include a performance status table, add a performance status table to the fifth ACPI table;
  • the frequency adjustable value in the performance state table included in the fifth ACPI table is adjusted to a preset frequency adjustable value supported by the CPU.
  • the IMU firmware updates the ACPI table through the following operations. If the ACPI table was updated to remove the performance status table when the OS was not responsible for PM before, then the ACPI table (the fifth ACPI table above) can be obtained in the memory here, and normal The performance status table. If the update of the ACPI table was to modify the frequency adjustable value in the ACPI table when the OS was not responsible for PM before, but the performance state table was not removed, then the frequency adjustable value in the performance state table can be changed here Adjust to the adjustable value of the preset frequency supported by the CPU.
  • the header of the performance status table can be adjusted to the normal frequency adjustable.
  • the header of the value After the ACPI table is updated, it is stored in the original storage address.
  • the performance parameters include the power consumption of the CPU, and before the acquisition of the current performance parameters of the CPU, the program instructions corresponding to the IMU firmware are also read by the CPU and executed as follows operating:
  • the performing energy consumption management on the CPU based on the performance parameter includes:
  • the frequency and voltage of the CPU are increased, where the preset multiple is greater than 0 and less than 1.
  • the user can choose whether to adjust the frequency and voltage of the CPU according to the power consumption of the CPU.
  • the user can input a code for limiting CPU power consumption to the out-of-band management system, and the out-of-band management system can send a power consumption limit command to the IMU firmware according to the code, where the power consumption limit command can carry a power consumption threshold.
  • the IMU obtains the current power consumption of the CPU in real time. If the current power consumption of the CPU obtained above is greater than the power consumption threshold sent by the out-of-band management system, the frequency and voltage of the CPU are reduced. In addition, the power and voltage of the IO interface of the CPU can be reduced at the same time.
  • the frequency of the CPU has been adjusted to the lowest adjustable value, some unused ports of each core in the CPU can be closed. If the power consumption of the CPU is less than a preset multiple of the power consumption threshold, the frequency and voltage of the CPU are increased, where the preset multiple is greater than 0 and less than 1, such as 0.95. In addition, the power and voltage of the IO interface of the CPU can be increased at the same time.
  • the performance parameter includes the temperature of the CPU
  • the energy consumption management of the CPU based on the performance parameter includes:
  • the frequency and voltage of the CPU are increased, where the third temperature threshold is less than the second temperature threshold.
  • a temperature sensor may be installed on the CPU, and the temperature sensor monitors the temperature of the CPU in real time.
  • the IMU firmware may periodically obtain the current temperature of the CPU from the temperature sensor, for example, the cycle may be 0.5 seconds.
  • a temperature sensor can periodically monitor the temperature of the CPU. When the temperature reaches the temperature control threshold, the temperature sensor will send the current temperature of the CPU to the IMU firmware. If the obtained current temperature of the CPU is greater than the first temperature threshold, a high temperature warning message is sent to the out-of-band management system. After receiving the high temperature alarm message, the out-of-band management system performs power-off protection for the CPU to prevent damage to the CPU due to excessive temperature.
  • the frequency and voltage of the CPU are reduced. In addition, you can also reduce the power and voltage of the IO interface of the CPU, increase the fan speed, and improve heat dissipation. If the temperature cannot be effectively reduced, you can also adjust the power domain status of each core in the CPU to remove some of the The power domain of the cores is adjusted to the off state, that is, these cores are shut down so that they no longer run and generate heat. If the temperature of the CPU is less than the third temperature threshold, the frequency and voltage of the CPU can be increased, where the third temperature threshold is less than the second temperature threshold. In addition, if the power supply of some cores in the CPU is adjusted to the off state in order to cool down, the power domain of these cores can be adjusted to the on state at this time, that is, the cores are turned on again.
  • the performance parameter includes a usage rate of the CPU
  • the energy consumption management of the CPU based on the performance parameter includes:
  • the frequency and voltage of the CPU are reduced.
  • a performance monitor unit may be installed on each core of the CPU, and the PMU is used to count the number of clocks of the core where it is in a non-idle state. For each statistical period, the PMU counts the number of clocks in the non-idle state of its core during the statistical period, and sends it to the IMU firmware.
  • the IMU firmware can divide the number of clocks in the non-idle state by the total number of clocks in the statistical period to obtain the utilization rate of the corresponding core in the statistical period.
  • the sum of the utilization rates of all cores in the clock domain, and then dividing by the number of cores in the clock domain, is the average utilization rate of the cores in the clock domain.
  • the utilization rate of the CPU is the average utilization rate of the cores in the clock domain.
  • multiple clock domains can also be set, for example, each core corresponds to a clock domain, or every several cores corresponds to a clock domain. In this case, the usage rate of the CPU can use these clocks.
  • the average utilization rate of cores in the domain is collectively represented.
  • the average utilization rate of the cores in each clock domain is obtained as described above, if the average utilization rate is greater than the first utilization rate threshold, the frequency and voltage of the cores in the clock domain can be increased. If the average usage rate is less than the second usage rate threshold, reduce the frequency and voltage of the cores in the clock domain, where the first usage rate threshold is less than the second usage rate threshold.
  • the performing energy consumption management on the CPU based on the performance parameter includes:
  • the configuration adjustment strategy Determining the configuration adjustment strategy corresponding to the target service type based on the pre-stored correspondence between the service type and the configuration adjustment strategy, where the configuration adjustment strategy includes at least the frequency to be used and the voltage to be used of the CPU;
  • the frequency and voltage of the CPU are adjusted to the frequency to be used and the voltage to be used, respectively.
  • the IMU firmware can input the periodically acquired CPU performance parameters and CPU voltage and frequency into the pre-trained feature extraction model and classifier model to obtain the corresponding target service type. Then, the corresponding relationship between the business classification and the configuration adjustment strategy is queried, and the configuration adjustment strategy corresponding to the target service type is obtained.
  • the configuration adjustment strategy includes the CPU to-be-used frequency and the to-be-used voltage. Then, the frequency of the CPU can be adjusted to the frequency to be used, and the voltage of the CPU can be adjusted to the voltage to be used. Through this scheme, the frequency and voltage adjustment of the CPU is more flexible.
  • a device for energy consumption management includes a CPU, a memory, and a plurality of program instructions corresponding to startup firmware, operating system OS, and intelligent management unit IMU firmware are stored in the memory.
  • a plurality of program instructions are used to be read and executed by the CPU to realize the functions of the startup firmware, the OS, and the IMU firmware;
  • the IMU firmware is used to execute the method for energy consumption management according to any one of claims 1-9 or 10-18.
  • the CPU includes an IMU core and a service processing AP core, where the AP and the IMU processor are isolated by a system isolation wall SIW;
  • the functions of the IMU firmware are processed by the IMU core.
  • the IMU firmware can obtain the IMU PM execution notification to enable the IMU PM.
  • the IMU firmware can obtain the IMU PM execution notification to enable the IMU PM.
  • FIG. 1 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a CPU provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a method for energy consumption management provided by an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a method for energy consumption management provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an out-of-band management system provided by an embodiment of the present application.
  • Fig. 6 is a device for energy consumption management provided by an embodiment of the present application.
  • the embodiment of the present application provides a method for energy consumption management, which can be used for the energy consumption management of electronic equipment.
  • the electronic equipment may include a CPU and a memory, and the memory may store multiple program instructions corresponding to firmware and OS respectively.
  • a plurality of program instructions are read and executed by the CPU to implement the functions of the firmware and the OS, where the firmware may include startup firmware and IMU firmware, and the energy consumption management method provided in the embodiments of the present application may be implemented by IMU firmware.
  • the above-mentioned electronic device may be a server, a computer, etc., and the embodiment of the present application takes the electronic device as a server as an example for description.
  • the firmware may include startup firmware and IMU firmware.
  • the startup firmware is such as: unified extensible firmware interface (UEFI) firmware , Basic Input Output System (BIOS) firmware, the figure shows UEFI firmware.
  • UEFI firmware can be used to create advanced configuration and power interface (ACPI) tables when the OS starts to enable the OS to start normally.
  • IMU firmware can be used to implement the energy consumption management methods provided in this application. CPU performance parameters, adjust the frequency and voltage of the CPU, in order to achieve the purpose of server energy consumption management.
  • the CPU may include multiple independent cores (cores), such as an application processor (AP) core used for service processing, and a processor core used to implement the energy consumption management method provided in the embodiments of the present application.
  • cores such as an application processor (AP) core used for service processing, and a processor core used to implement the energy consumption management method provided in the embodiments of the present application.
  • AP application processor
  • IMU core a processor core used to implement the energy consumption management method provided in the embodiments of the present application.
  • the aforementioned UEFI firmware and OS can run on the AP core, and the IMU firmware can run on the IMU core.
  • the IMU firmware may run on the AP core, and the method for energy consumption management provided in the embodiments of the present application may also be implemented.
  • FIG. 2 For a schematic diagram of the structure of the CPU including the AP core and the IMU core, refer to FIG. 2. As shown in Figure 2, there are multiple AP cores on the left and IMU cores on the right. High-speed interconnection between AP cores and IMU cores is possible. In addition, since the independent IMU core in the CPU is used to run the IMU firmware to realize energy consumption management, the data on the IMU core is relatively important. In order to ensure the data security of the IMU core, it can be passed through the system isolation wall.
  • SIW system isolation wall
  • the processing flow of the method may include the following steps:
  • Step 301 Before the operating system OS runs, obtain an intelligent management unit power management (IMU PM) execution notice, where the IMU PM execution notice is determined by the startup firmware before the OS runs, and the IMU executes the PM After being sent, the startup firmware is also used to prevent the OS from performing operating system power management (OS PM) before the OS runs.
  • IMU PM intelligent management unit power management
  • the IMU PM execution notification is used to notify the IMU firmware to execute IMU PM.
  • the firmware before the OS runs, the firmware is started to determine that power management (power management, PM) is executed by the IMU firmware, and then an IMU PM execution notification can be sent.
  • the IMU firmware can start the IMU PM by obtaining the IMU PM execution notification.
  • the OS can be prevented from executing the OS PM.
  • the startup firmware can determine that the PM is executed by the IMU firmware in the following way.
  • the startup setting interface can be a UEFI setup interface or a BIOS interface.
  • the display screen outside the server can display a startup setting interface.
  • the user can select IMU PM in the PM setting options on the startup setting interface.
  • the data of the PM setting configuration item in the startup firmware startup configuration item is the data used to instruct the IMU to perform PM.
  • the startup firmware reads the data of the PM setting in the startup configuration item, it sends an IMU PM execution notification.
  • IMU PM execution notice can take many forms, and several of them are listed below for explanation.
  • IMU PM execution notice is an IMU PM execution instruction.
  • the foregoing processing of the startup firmware sending an IMU PM execution notification may be: the startup firmware sends an IMU PM execution instruction to the IMU firmware.
  • the processing for the IMU firmware to obtain the IMU PM execution notification is: the IMU firmware receives the IMU PM execution instruction sent by the startup firmware.
  • Form 2 The IMU PM execution notification is the first preset data in the preset storage address.
  • the startup firmware writes the first preset data in the preset storage address.
  • the process for the IMU firmware to obtain the IMU PM execution notification is: the IMU firmware obtains the first preset data by polling the preset storage address.
  • the preset storage address is a storage address preset by a technician for storing PM execution notifications
  • the first preset data may be a binary number "1".
  • Method 1 Start the firmware to create the first advanced configuration and power interface ACPI table, and report the first ACPI table to the OS.
  • the first ACPI table does not include the performance status table to prevent the OS from executing OS PM.
  • the performance status table is Performance support status PSS table or continuous performance control CPC table.
  • the ACPI table can include one of the PSS table and the CPC table. Both the PSS table and the CPC table can provide the OS with adjustable frequency values supported by the CPU. The difference is ,
  • the PSS table provides a number of different levels of frequency adjustable values supported by the CPU. For example, the adjustable frequency of P0 level is 2001MHZ, the adjustable frequency of P2 level is 1900MHZ, etc., and the CPU support is provided in the CPC table. The upper and lower limits of the frequency adjustable value.
  • the OS can adjust the frequency of the CPU according to the adjustable frequency values supported by the CPU provided in the two tables.
  • the startup firmware when the startup firmware initializes the ACPI table (that is, the above-mentioned first ACPI table), the performance state table therein may not be initialized, and the OS cannot perform frequency modulation on the CPU.
  • Method 2 Create a second ACPI table, and report the second ACPI table to the OS, where the second ACPI table includes a performance status table, and the frequency adjustable values in the performance status table included in the second ACPI table are the same
  • the preset value, or the header of the performance state table included in the second ACPI table is a value with an undefined range, so as to prevent the OS from executing OS PM.
  • the startup firmware when the startup firmware initializes the ACPI table (that is, the above-mentioned second ACPI table), it can initialize the performance state table therein, but initialize the frequency adjustable value in the performance state table to the same preset value.
  • the performance status table is a PSS table
  • the adjustable frequency values of each level can be initialized to the same preset value.
  • the adjustable frequency values of each level are initialized to the frequency adjustable values of P0.
  • the adjustable frequency values of each level can also be initialized to any same preset value, such as 0MHZ.
  • the upper limit and lower limit of the adjustable frequency value of the CPU can be initialized to the same preset value, for example, the upper limit of the adjustable frequency value is initialized to the lower limit of the adjustable frequency value, or, The lower limit of the adjustable frequency value can also be initialized to the upper limit of the adjustable frequency value, or, the lower limit and the upper limit of the adjustable frequency value can also be adjusted to any same preset value, such as 0MHZ. It is also possible to initialize the header of the performance status table to a value with an undefined range, so that the OS cannot find the frequency adjustable value through the header.
  • the operation performed by the startup firmware can be as follows: create a third ACPI table, and send the third ACPI table to the OS, where the first The third ACPI includes a performance status table, and the frequency adjustable value in the performance status table included in the third ACPI table is adjusted to the preset frequency adjustable value supported by the CPU, so that the OS executes OS PM; sends IMU PM shutdown notification.
  • the IMU firmware can also perform the following operations: get the IMU PM close notification, and close the IMU PM.
  • the user can select OS PM. Then, the data of the PM setting configuration item in the startup firmware startup configuration item is the data used to instruct the IMU to turn off the PM, and can also be understood as the data used to instruct the OS to execute the PM.
  • the startup firmware reads the data of the PM setting in the startup configuration item, it sends an IMU PM shutdown notification.
  • IMU PM shutdown notification can take many forms, and several of them are listed below for explanation.
  • IMU PM shutdown notification is an IMU PM shutdown instruction.
  • the foregoing processing of the startup firmware sending the IMU PM shutdown notification may be: the startup firmware sends an IMU PM shutdown instruction to the IMU firmware.
  • the processing for the IMU firmware to obtain the IMU PM shutdown notification is: the IMU firmware receives the IMU PM shutdown instruction sent by the startup firmware.
  • Form 2 The IMU PM execution notification is the second preset data in the preset storage address.
  • the foregoing processing of the startup firmware sending the IMU PM shutdown notification may be: the startup firmware writes the second preset data in the preset storage address.
  • the processing for the IMU firmware to obtain the IMU PM shutdown notification is: the IMU firmware obtains the second preset data by polling the preset storage address.
  • the preset storage address is a storage address preset by a technician for storing PM execution notifications
  • the second preset data may be a binary number "0".
  • the startup firmware When the startup firmware initializes the ACPI table (that is, the third ACPI table mentioned above), it can initialize the performance status table normally, that is, initialize the frequency adjustable value in the performance status table to the preset frequency adjustable value supported by the CPU. , So that the OS can determine the adjustable value of the CPU frequency by loading the ACPI table, and then execute the OS PM.
  • Step 302 After determining that the IMU firmware performs energy consumption management on the CPU according to the IMU PM execution notice, obtain the current performance parameters of the central processing unit CPU, where the performance parameters include one of the power consumption, temperature, and usage rate of the CPU or Many kinds.
  • the IMU firmware can obtain the performance parameters of the CPU, such as power consumption, temperature, and utilization rate.
  • the IMU firmware can periodically obtain the power consumption of the CPU, for example, the cycle can be 0.5 seconds. Or, after the IMU PM is turned on, the IMU may not obtain the power consumption of the CPU immediately, but it is up to the user to decide whether to adjust the frequency and voltage of the CPU according to the power consumption of the CPU. Only when the user needs to adjust the CPU according to the power consumption of the CPU When frequency and voltage are adjusted, the IMU firmware will periodically obtain the power consumption of the CPU. When the user needs to adjust the frequency and voltage of the CPU according to the power consumption of the CPU, the user can input the code to limit the CPU power consumption into the out-of-band management system, and the out-of-band management system can send the power consumption limit instruction to the IMU firmware. Among them, The power consumption limit instruction may carry a power consumption threshold. After receiving the consumption limit instruction, the IMU obtains the current power consumption of the CPU in real time.
  • a temperature sensor can be installed on the CPU.
  • the temperature sensor monitors the temperature of the CPU in real time.
  • the IMU firmware can periodically obtain the current temperature of the CPU from the temperature sensor. For example, the cycle can be 0.5 seconds.
  • a temperature sensor can periodically monitor the temperature of the CPU. When the temperature reaches the temperature control threshold, the temperature sensor will send the current temperature of the CPU to the IMU firmware.
  • a performance monitor unit may be installed on each core of the CPU, and the PMU is used to count the number of clocks in the non-idle state of the core where it is located. For each statistical period, the PMU counts the number of clocks in the non-idle state of its core during the statistical period, and sends it to the IMU firmware.
  • the IMU firmware can divide the number of clocks in the non-idle state by the total number of clocks in the statistical period to obtain the utilization rate of the corresponding core in the statistical period. For a clock domain, the sum of the utilization rates of all cores in the clock domain, and then dividing by the number of cores in the clock domain, is the average utilization rate of the cores in the clock domain.
  • the utilization rate of the CPU is the average utilization rate of the cores in the clock domain.
  • multiple clock domains can also be set, for example, each core corresponds to a clock domain, or every several cores corresponds to a clock domain. In this case, the usage rate of the CPU can use these clocks.
  • the average utilization rate of cores in the domain is collectively represented.
  • Step 303 Perform energy consumption management on the CPU based on the performance parameters.
  • the IMU firmware can adjust the frequency and voltage of the CPU according to the different performance parameters obtained.
  • the following describes how to adjust the frequency and voltage of the CPU according to the acquired performance parameters.
  • the frequency of the CPU is reduced, and the voltage of the CPU can also be reduced while reducing the frequency.
  • the power and voltage of the IO interface of the CPU can be reduced at the same time. If the frequency of the CPU has been adjusted to the lowest adjustable value, some unused ports of each core in the CPU can be closed. If the power consumption of the CPU is less than a preset multiple of the power consumption threshold, the frequency and voltage of the CPU are increased, where the preset multiple is greater than 0 and less than 1, such as 0.95. In addition, the power and voltage of the IO interface of the CPU can be increased at the same time.
  • a high temperature warning message is sent to the out-of-band management system.
  • the out-of-band management system performs power-off protection for the CPU to prevent damage to the CPU due to excessive temperature. If the temperature of the CPU is less than the first temperature threshold and greater than the second temperature threshold, the frequency of the CPU is reduced, and the voltage of the CPU can also be reduced while reducing the frequency. In addition, you can also reduce the power and voltage of the IO interface of the CPU, increase the fan speed, and improve heat dissipation.
  • the temperature cannot be effectively reduced you can also adjust the power domain status of each core in the CPU to remove some of the The power domain of the cores is adjusted to the off state, that is, these cores are shut down so that they no longer run and generate heat. If the temperature of the CPU is less than the third temperature threshold, the frequency of the CPU can be increased, and the voltage of the CPU can also be increased while the frequency is increased, where the third temperature threshold is less than the second temperature threshold. In addition, if the power supply of some cores in the CPU is adjusted to the off state in order to cool down, the power domain of these cores can be adjusted to the on state at this time, that is, the cores are turned on again.
  • the average utilization rate of the cores in each clock domain is obtained as described above, if the average utilization rate is greater than the first utilization threshold, the frequency of the cores in the clock domain can be increased, and the voltage can also be increased while increasing the frequency. If the average usage rate is less than the second usage rate threshold, the frequency of the cores in the clock domain is reduced, and the voltage of the cores in the clock domain can be lowered.
  • the first usage rate threshold is smaller than the second usage rate threshold.
  • the above-mentioned increase or decrease of the frequency of the CPU can be adjusted by adjusting the phase locked loop (PLL) of the clock domain corresponding to each core in the CPU.
  • PLL phase locked loop
  • Mode 1 Fast rise and slow fall mode, that is, quickly increase the frequency and slowly decrease the frequency. This mode can ensure the performance of the CPU.
  • Mode 2 Slow-up and fast-down mode, that is, slowly increase the frequency and quickly reduce the frequency. This mode can effectively save CPU power consumption.
  • the processing can be as follows: input the performance parameters and the current frequency and voltage of the CPU to the advance
  • the feature data to be classified is obtained.
  • the configuration adjustment strategy includes at least the frequency to be used and the voltage to be used of the CPU. Adjust the frequency and voltage of the CPU to the frequency to be used and the voltage to be used respectively.
  • the feature extraction model can be a long short-term memory (LSTM) autoencoder model, a recurrent neural network (recurrent neural network, RNN) model, etc.
  • the classifier model can be K nearest neighbor (k-nearest neighbor).
  • KNN K nearest neighbor classification model
  • MLP multi-layer perception
  • the technical personnel can establish the feature extraction model and the classifier model in advance, and train the feature extraction model and the classifier model.
  • the two models can be trained at the same time.
  • Technicians can collect CPU running performance parameters and CPU voltage and frequency in a large number of servers as input samples, that is, each set of input samples includes at least CPU running performance parameters and CPU voltage and frequency.
  • the input samples can be manually classified into business, for example, they can be divided into 10 business types.
  • the business type corresponding to each set of input samples is the output sample. In this way, the output samples corresponding to each set of input sample cores can form a set of training samples.
  • the feature extraction model and classifier model training are trained, and the parameters of the feature extraction model and the classifier model are constantly adjusted to make their accuracy higher.
  • the trained feature extraction model and classification can be obtained ⁇ model.
  • technicians can score the energy efficiency of the CPU runtime performance parameters and CPU voltage and frequency corresponding to the service type, and use the voltage and frequency of the CPU in the group with the highest energy efficiency score as the service type The corresponding configuration adjustment strategy.
  • each service type and the corresponding configuration adjustment strategy are correspondingly stored. In this way, the configuration adjustment strategy can consider the frequency and voltage to be used of the CPU under the corresponding service type.
  • the IMU firmware can input the periodically acquired CPU performance parameters and CPU voltage and frequency into the pre-trained feature extraction model and classifier model to obtain the corresponding target service type. Then, the corresponding relationship between the business classification and the configuration adjustment strategy is queried, and the configuration adjustment strategy corresponding to the target business type is obtained.
  • the configuration adjustment strategy includes the CPU to-be-used frequency and the to-be-used voltage. Then, the frequency of the CPU can be adjusted to the frequency to be used, and the voltage of the CPU can be adjusted to the voltage to be used.
  • the IMU firmware can obtain the IMU PM execution notification to enable the IMU PM.
  • the purpose of energy consumption management is achieved. In this process, there is no need for the OS to obtain performance parameters, and then notify the IMU firmware to adjust the frequency and voltage of the CPU, which reduces the interaction process and makes the frequency and voltage adjustment more efficient.
  • the processing flow of the method may include the following steps:
  • Step 401 During the operation of the OS, receive a first notification message sent by the out-of-band management system for notifying the IMU firmware to execute IMU PM.
  • the out-of-band management system may be a baseboard management controller (BMC).
  • BMC baseboard management controller
  • the out-of-band management system can be another CPU in the server—CPU1; as shown in 5b in Fig. 5, the out-of-band management system can also be a processor core in the CPU.
  • the user can enter the code to enable IMU PM into the out-of-band management system, and the out-of-band management system will send the first notification message to the IMU firmware through the intelligent platform management interface (IPMI), so that the IMU firmware will receive the After the first notification message, execute IMU PM.
  • IPMI intelligent platform management interface
  • Step 402 Interact with the OS according to the first notification message, so that the OS is no longer responsible for energy consumption management.
  • the IMU firmware interacts with the OS, so that the OS is no longer responsible for energy consumption management.
  • the OS is no longer responsible for energy consumption management.
  • Manner 1 If the first energy consumption management request sent by the OS is received, the energy consumption management is not executed according to the first energy consumption management request, and a preset message is returned to the OS, so that the OS is no longer responsible for the energy consumption management.
  • the first energy consumption management request may be a request by the OS to instruct the IMU to perform frequency modulation on the CPU.
  • the IMU firmware After the IMU firmware receives the first energy consumption management request, it does not execute the frequency modulation operation corresponding to the first energy consumption management request, but executes its own IMU PM.
  • the IMU firmware will not perform frequency modulation according to the first energy management request, after receiving the first energy management request, it can return a preset message to the OS.
  • the preset message may be a notification of successful execution. The message is to deceive the OS and make the OS think that it is in charge of the PM, but the IMU firmware is actually responsible.
  • Method 2 Obtain the fourth advanced configuration and power interface ACPI table, update the fourth ACPI table to obtain the fourth updated ACPI table; send a fourth ACPI table update message to the OS, where the fourth ACPI table update message is used to indicate The OS obtains the fourth updated ACPI table, so that the OS closes the OS PM based on the fourth updated ACPI table.
  • the ACPI table can be updated, so that the OS cannot perform energy management according to the ACPI table.
  • the IMU firmware updates the ACPI table, there are multiple methods, which are listed below for description.
  • Method 1 Remove the performance state table included in the fourth ACPI table, where the performance state table is a PSS table or a CPC table.
  • the IMU firmware can obtain the ACPI table (that is, the aforementioned fourth ACPI table) from the memory, remove the performance state table in it, and store it in the original storage address. In this way, after the OS obtains the ACPI table, it cannot parse the performance state table, and thus cannot execute OS PM.
  • the ACPI table that is, the aforementioned fourth ACPI table
  • Method 2 Adjust the frequency adjustable value in the performance state table included in the fourth ACPI table to the same preset value.
  • the adjustable frequency value in the performance status table is adjusted to the same preset value.
  • the adjustable frequency values of each level can be adjusted to the same preset value.
  • the adjustable frequency values of each level can be adjusted to the frequency adjustable value of P0.
  • the adjustable frequency value of each level can be adjusted to any same preset value, such as 0MHZ.
  • the upper and lower limits of the CPU frequency adjustable value can be adjusted to the same preset value, for example, the upper limit of the frequency adjustable value is adjusted to the lower limit of the frequency adjustable value, or, The lower limit of the adjustable frequency value can be adjusted to the upper limit of the adjustable frequency value, or the lower limit and the upper limit of the adjustable frequency value can be adjusted to any same preset value, such as 0MHZ.
  • Method 3 Modify the header of the performance status table included in the fourth ACPI table to a value whose range is not defined.
  • the header of the performance status table can also be modified to a value with an undefined range, so that the OS cannot find the frequency adjustable value through the header.
  • the OS PM can also be selected through the out-of-band management system.
  • IMU PM can perform the following operations: During the operation of the operating system OS, receive the second notification message sent by the out-of-band management system to notify the IMU firmware to start the OS PM; if the current OS is responsible for energy consumption management, it will no longer Process the second notification message; if the current OS is not responsible for energy consumption management, interact with the OS according to the second notification message, so that the OS is responsible for energy consumption management.
  • the user can input the code to enable the IMU PM into the out-of-band management system, and the out-of-band management system will send a second notification message to the IMU firmware through IPMI. If the current PM is OS PM, the second notification message may not be processed. If the current PM is IMU PM, after receiving the second notification message, the IMU PM needs to be turned off and the OS is responsible for the PM, which means it is turned on OS PM.
  • the way of interacting with the OS according to the second notification message is different so that the OS is responsible for energy consumption management.
  • the IMU firmware after receiving the second notification message, executes the second energy consumption management request after receiving the second energy consumption management request sent by the OS.
  • the IMU firmware after receiving the second notification message, the IMU firmware here obtains the fifth ACPI table, updates the fifth ACPI table, and obtains the fifth updated ACPI table; sends the fifth ACPI table update message to the OS, where The fifth ACPI table update message is used to instruct the OS to obtain the fifth updated ACPI table, so that the OS can start the OS PM according to the fifth updated ACPI table.
  • the method of updating the ACPI table can be as follows.
  • the fifth ACPI table does not include the performance status table, add the performance status table to the fifth ACPI table; if the fifth ACPI table includes the performance status table, then change the frequency in the performance status table included in the fifth ACPI table
  • the adjustable value is adjusted to the preset frequency adjustable value supported by the CPU.
  • the ACPI table (that is, the fifth ACPI table mentioned above) can be obtained in the memory here, And add the normal performance status table in it. If the update of the ACPI table was to modify the frequency adjustable value in the ACPI table when the OS was not responsible for PM before, but the performance state table was not removed, then the frequency adjustable value in the performance state table can be changed here Adjust to the adjustable value of the preset frequency supported by the CPU. If the update of the ACPI table is to modify the header when the OS is not responsible for PM before, but the performance status table is not removed, then the header of the performance status table can be adjusted to the normal frequency adjustable. The header of the value. After the ACPI table is updated, it is stored in the original storage address.
  • the IMU firmware When the IMU firmware confirms that the Mailbox between it and the OS is empty, it writes the ACPI table update message to the Mailbox, and generates a message interrupt (Notify Interrupt) to feed back to the OS.
  • the OS receives Notify Interrupt, or polls Notify Interrupt, it processes the ACPI table update message in the Mailbox, generates a doorbell (Doorbell) interrupt to the IMU firmware, and clears Notify Interrupt.
  • the IMU firmware After the IMU firmware receives the Doorbell interrupt returned by the OS, it confirms the Doorbell interrupt of the OS and clears the Doorbell interrupt.
  • the embodiment of the present application also provides a data structure of the communication message sent between the IUM firmware and the OS.
  • the communication message can be the above-mentioned ACPI table update message.
  • the data structure is shown in Table 1 below.
  • Step 403 After determining that the IMU firmware performs energy consumption management on the CPU according to the above-mentioned first characteristic message, obtain the current performance parameters of the central processing unit CPU, where the performance parameters include one of the power consumption, temperature, and usage rate of the CPU Or multiple.
  • the IMU firmware can obtain the performance parameters of the CPU, such as power consumption, temperature, and utilization rate.
  • the IMU firmware can periodically obtain the power consumption of the CPU, for example, the cycle can be 0.5 seconds. Or, after the IMU PM is turned on, the IMU may not obtain the power consumption of the CPU immediately, but it is up to the user to decide whether to adjust the frequency and voltage of the CPU according to the power consumption of the CPU. Only when the user needs to adjust the CPU according to the power consumption of the CPU When frequency and voltage are adjusted, the IMU firmware will periodically obtain the power consumption of the CPU. When the user needs to adjust the frequency and voltage of the CPU according to the power consumption of the CPU, the user can input the code to limit the CPU power consumption into the out-of-band management system, and the out-of-band management system can send the power consumption limit instruction to the IMU firmware. Among them, The power consumption limit instruction may carry a power consumption threshold. After receiving the consumption limit instruction, the IMU obtains the current power consumption of the CPU in real time.
  • a temperature sensor can be installed on the CPU.
  • the temperature sensor monitors the temperature of the CPU in real time.
  • the IMU firmware can periodically obtain the current temperature of the CPU from the temperature sensor. For example, the cycle can be 0.5 seconds.
  • a temperature sensor can periodically monitor the temperature of the CPU. When the temperature reaches the temperature control threshold, the temperature sensor will send the current temperature of the CPU to the IMU firmware.
  • a performance monitor unit may be installed on each core of the CPU, and the PMU is used to count the number of clocks in the non-idle state of the core where it is located. For each statistical period, the PMU counts the number of clocks in the non-idle state of its core during the statistical period, and sends it to the IMU firmware.
  • the IMU firmware can divide the number of clocks in the non-idle state by the total number of clocks in the statistical period to obtain the utilization rate of the corresponding core in the statistical period. For a clock domain, the sum of the utilization rates of all cores in the clock domain, and then dividing by the number of cores in the clock domain, is the average utilization rate of the cores in the clock domain.
  • the utilization rate of the CPU is the average utilization rate of the cores in the clock domain.
  • multiple clock domains can also be set, for example, each core corresponds to a clock domain, or every several cores corresponds to a clock domain. In this case, the usage rate of the CPU can use these clocks.
  • the average utilization rate of cores in the domain is collectively represented.
  • Step 404 Perform energy consumption management on the CPU based on the performance parameters.
  • the IMU firmware can adjust the frequency and voltage of the CPU according to the different performance parameters obtained.
  • the following describes how to adjust the frequency and voltage of the CPU according to the acquired performance parameters.
  • the frequency of the CPU is reduced, and the voltage of the CPU can also be reduced while reducing the frequency.
  • the power and voltage of the IO interface of the CPU can be reduced at the same time. If the frequency of the CPU has been adjusted to the lowest adjustable value, some unused ports of each core in the CPU can be closed. If the power consumption of the CPU is less than a preset multiple of the power consumption threshold, the frequency and voltage of the CPU are increased, where the preset multiple is greater than 0 and less than 1, such as 0.95. In addition, the power and voltage of the IO interface of the CPU can be increased at the same time.
  • a high temperature warning message is sent to the out-of-band management system.
  • the out-of-band management system performs power-off protection for the CPU to prevent damage to the CPU due to excessive temperature. If the temperature of the CPU is less than the first temperature threshold and greater than the second temperature threshold, the frequency of the CPU is reduced, and the voltage of the CPU can also be reduced while reducing the frequency. In addition, you can also reduce the power and voltage of the IO interface of the CPU, increase the fan speed, and improve heat dissipation.
  • the temperature cannot be effectively reduced you can also adjust the power domain status of each core in the CPU to remove some of the The power domain of the cores is adjusted to the off state, that is, these cores are shut down so that they no longer run and generate heat. If the temperature of the CPU is less than the third temperature threshold, the frequency of the CPU can be increased, and the voltage of the CPU can also be increased while the frequency is increased, where the third temperature threshold is less than the second temperature threshold. In addition, if the power supply of some cores in the CPU is adjusted to the off state in order to cool down, the power domain of these cores can be adjusted to the on state at this time, that is, the cores are turned on again.
  • the average utilization rate of the cores in each clock domain is obtained as described above, if the average utilization rate is greater than the first utilization threshold, the frequency of the cores in the clock domain can be increased, and the voltage can also be increased while increasing the frequency. If the average usage rate is less than the second usage rate threshold, the frequency of the cores in the clock domain is reduced, and the voltage of the cores in the clock domain can be lowered.
  • the first usage rate threshold is smaller than the second usage rate threshold.
  • the above-mentioned increase or decrease of the frequency of the CPU can be adjusted by adjusting the phase locked loop (PLL) of the clock domain corresponding to each core in the CPU.
  • PLL phase locked loop
  • Mode 1 Fast rise and slow fall mode, that is, quickly increase the frequency and slowly decrease the frequency. This mode can ensure the performance of the CPU.
  • Mode 2 Slow-up and fast-down mode, that is, slowly increase the frequency and quickly reduce the frequency. This mode can effectively save CPU power consumption.
  • the processing can be as follows: input the performance parameters and the current frequency and voltage of the CPU to the advance
  • the feature data to be classified is obtained.
  • the configuration adjustment strategy includes at least the frequency to be used and the voltage to be used of the CPU. Adjust the frequency and voltage of the CPU to the frequency to be used and the voltage to be used respectively.
  • the feature extraction model can be a long short-term memory (LSTM) autoencoder model, a recurrent neural network (recurrent neural network, RNN) model, etc.
  • the classifier model can be K nearest neighbor (k-nearest neighbor).
  • KNN K nearest neighbor classification model
  • MLP multi-layer perception
  • the technical personnel can establish the feature extraction model and the classifier model in advance, and train the feature extraction model and the classifier model.
  • the two models can be trained at the same time.
  • Technicians can collect CPU running performance parameters and CPU voltage and frequency in a large number of servers as input samples, that is, each set of input samples includes at least CPU running performance parameters and CPU voltage and frequency.
  • the input samples can be manually classified into business, for example, they can be classified into 10 business types.
  • the business type corresponding to each set of input samples is the output sample. In this way, the output samples corresponding to each set of input sample cores can form a set of training samples.
  • the feature extraction model and classifier model training are trained, and the parameters of the feature extraction model and the classifier model are constantly adjusted to make their accuracy higher.
  • the trained feature extraction model and classification can be obtained ⁇ model.
  • technicians can perform energy efficiency scores on the CPU operating performance parameters and CPU voltage and frequency corresponding to the service type, and use the voltage and frequency of the CPU in the group with the highest energy efficiency score as the service type The corresponding configuration adjustment strategy.
  • each service type and the corresponding configuration adjustment strategy are correspondingly stored. In this way, the configuration adjustment strategy can consider the CPU's to-be-used frequency and to-be-used voltage under the corresponding service type.
  • the IMU firmware can input the periodically acquired CPU performance parameters and CPU voltage and frequency into the pre-trained feature extraction model and classifier model to obtain the corresponding target service type. Then, the corresponding relationship between the business classification and the configuration adjustment strategy is queried, and the configuration adjustment strategy corresponding to the target business type is obtained.
  • the configuration adjustment strategy includes the CPU to-be-used frequency and the to-be-used voltage. Then, the frequency of the CPU can be adjusted to the frequency to be used, and the voltage of the CPU can be adjusted to the voltage to be used.
  • the IMU firmware can obtain the IMU PM execution notification to enable the IMU PM.
  • the purpose of energy consumption management is achieved. In this process, there is no need for the OS to obtain performance parameters, and then notify the IMU firmware to adjust the frequency and voltage of the CPU, which reduces the interaction process and makes the frequency and voltage adjustment more efficient.
  • the embodiment of the present application also provides a device for energy consumption management.
  • the device may include a CPU 610 and a memory 620.
  • the memory 620 stores startup firmware, multiple programs corresponding to the OS and IMU firmware. Instructions, multiple program instructions are used to be read by the CPU and executed to realize the functions of the startup firmware, OS, and IMU firmware.
  • the IMU firmware can be used to perform energy management methods.
  • the CPU 610 may be the CPU in Figure 2. It can be seen that the CPU includes an IMU core and an AP core. In order to ensure data security in the IMU core, it can pass between the IMU core and the AP core. System isolation wall SIW isolation. The functions of the above-mentioned IMU firmware can be realized by the IMU core processing.

Abstract

一种能耗管理的方法和设备,应用于电子设备的能耗管理,该方法可以由IMU固件执行,包括如下处理:在OS运行之前,获取IMU PM执行通知,其中,IMU PM执行通知是由启动固件在OS运行之前、确定由IMU固件执行能耗管理PM后发送的,启动固件还用于在OS运行之前阻止OS执行操作系统能耗管理OS PM(301);在根据IMU PM执行通知确定由IMU固件对CPU执行PM后,获取CPU当前的性能参数,其中,性能参数包括所述CPU的功耗、温度和使用率中的一种或多种(302);基于性能参数,对CPU进行能耗管理(303)。采用该方法进行能耗管理,可以减少OS与IMU固件之间的交互流程,从而使能耗管理更加高效。

Description

能耗管理的方法和设备
本申请要求于2019年10月22日提交的申请号为201911007882.3、发明名称为“能耗管理的方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及能耗管理技术领域,特别涉及一种能耗管理的方法和设备。
背景技术
服务器作为一种可提供数据计算、数据存储、数据管理等多种服务的设备,在企业中被广泛应用。相比与一般的终端侧计算机设备,服务器的性能更加稳定服务器的管理维护成本也相对较高,对服务器提供的电力及对服务器的冷却的成本,占了服务器的管理维护成本的很大部分。因此,为了降低服务器的电力及冷却的成本,就要对服务器进行有效的能耗管理,以控制其耗电及产热。
目前,较为常用的服务器能耗管理方法为操作系统(operation system,OS)电源管理(power management,PM),可简称为OS PM,通常OS PM也可以称为操作系统能耗管理。OS PM的流程如下:OS实时监控中央处理器(central processing unit,CPU)的使用率,根据使用率以及预先配置的调频调压策略,确定出调压值和调频值。然后,向智能管理单元(intelligent management unit,IMU)固件发送调频调压请求,IMU固件接收到OS发送的调频调压请求后,获取调压值和调频值,并根据调压值和调频值对CPU的频率和电压进行调节,在调节完成后,向OS反馈调节完成消息。
在实现本申请的过程中,发明人发现相关技术至少存在以下问题:
OS PM是由OS发起的,需要先通知到IMU固件,再由IMU固件执行调频调压。这一调节过程较为繁琐,存在较大时延。
发明内容
本申请实施例提供了一种能耗管理的方法和设备,能够解决相关的能耗管理中的调节过程繁琐的问题。所述技术方案如下:
第一方面,提供了一种能耗管理的方法,用于电子设备的能耗管理,所述电子设备包括中央处理器CPU,存储器;所述存储器中存储有启动固件,操作系统OS以及智能管理单元IMU固件分别对应的多个程序指令,所述多个程序指令用于被所述CPU读取并执行以实现所述启动固件、所述OS以及所述IMU固件的功能,其中,所述能耗管理的方法由所述IMU固件执行,包括:
在操作系统OS运行之前,获取智能管理单元能耗管理IMU PM执行通知,其中,所述IMU PM执行通知是由启动固件在所述OS运行之前、确定由所述IMU固件执行能耗管理PM后发送的,所述启动固件还用于在所述OS运行之前阻止所述OS执行操作系统能耗管理OS PM;
在根据所述IMU PM执行通知确定由IMU固件对CPU执行PM后,获取所述CPU当前的性能参数,其中,所述性能参数包括所述CPU的功耗、温度和使用率中的一种或多种;基于所述性能参数,对所述CPU进行能耗管理。
本申请实施例所示的方案中,IMU PM执行通知是用于通知IMU执行能耗管理的。该IMU PM执行通知由启动固件发送。发送时机可以为OS运行之前,阻止OS执行OS PM之后发送的,则IMU固件可以在OS被阻止执行OS PM之后,获取到IMU PM执行通知。IMU固件在接收到IMU PM执行指令之后,开启IMU PM。IMU固件可以周期性获取CPU实时的性能参数,如功耗、温度和使用率等。然后,再根据获取到的性能参数,对CPU的频率和电压进行调节,以达到能耗管理的目的。在上述过程中,性能参数的获取,以及CPU的频率和电压的调节均有IMU固件直接实现,无需与OS进行交互,减少了CPU的调节时延。
在一种可能的实现方式中,所述IMU PM执行通知为IMU PM执行指令,所述获取IMU PM的执行通知包括:
接收所述启动固件发送的所述IMU PM执行指令。
本申请实施例所示的方案中,在OS运行之前,可以通过启动设置界面给用户提供PM设置选项,其中,启动设置界面可以为UEFI setup界面或者BIOS界面。电子设备上电,在启动固件启动时,电子设备的显示屏可以显示有启动设置界面,用户可以在该启动设置界面上的PM设置选项中,选择IMU PM。则在启动固件启动配置项中的PM设置这一配置项的数据为用于指示IMU进行PM的数据。启动固件读取启动配置项中的PM设置这一配置项的数据时,则向IMU固件发送IMU PM执行指令。通过直接发送IMU PM执行指令的方式,可以更加及时的通知IMU固件执行IMU PM。
在一种可能的实现方式中,所述IMU PM执行通知为在预设存储地址中的第一预设数据,所述获取IMU PM的执行通知包括:
通过轮询所述预设存储地址,获取所述第一预设数据。
本申请实施例所示的方案中,启动固件在预设存储地址中写入第一预设数据。相应的,IMU固件获取IMU PM执行通知的处理为:IMU固件通过轮询所述预设存储地址,获取所述第一预设数据。其中,预设存储地址为技术人员预先设置的用于存储PM执行通知的存储地址,第一预设数据可以为二进制数“1”。
在一种可能的实现方式中,所述启动固件用于通过如下方法在所述OS运行之前阻止所述OS执行操作系统能耗管理OS PM:
创建第一高级配置和电源接口ACPI表,并将所述第一ACPI表上报至OS,其中,所述第一ACPI表中不包括性能状态表,以阻止所述OS执行OS PM,所述性能状态表为性能支持状态PSS表或连续性能控制CPC表。
本申请实施例所示的方案中,根据不同的ACPI规范,ACPI表中可以包括有PSS表和CPC表中的一种,PSS表和CPC表均可以给OS提供CPU支持的频率可调值,不同的是,PSS表中提供了CPU支持的多个不同等级的频率可调值,如P0级的频率可调值为2001MHZ,P2级的频率可调值为1900MHZ等,而CPC表中提供了CPU支持的频率可调值的上限和下限。OS可以根据这两种表中提供的CPU支持的频率可调值对CPU的频率进行调整。则,启动固件可以在初始化ACPI表时,不初始化其中的性能状态表,则OS无法对CPU进行调频。通过此方案,可以更为直接的阻止OS执行OS PM,处理效率更高。
在一种可能的实现方式中,所述启动固件用于通过如下方法在所述OS运行之前阻止所述OS执行操作系统能耗管理OS PM:
创建第二ACPI表,并将所述第二ACPI表上报至OS,其中,所述第二ACPI表中包括性能状态表,所述第二ACPI表中包括的性能状态表中的频率可调值为相同的预设数值,或者,所述第二ACPI表中包括的性能状态表的表头为范围未定义的值,以阻止所述OS执行OS PM。
本申请实施例所示的方案中,启动固件可以将性能状态表中的频率可调值初始化为相同的预设数值。对于不同种的性能状态表可以有如下情况。对于性能状态表为PSS表的情况,可以将其中各等级的频率可调值均初始化为相同的预设数值,如,将各等级的频率可调值均初始化为P0级的频率可调值,或者,还可以将各等级的频率可调值均初始化为任意相同的预设数值,如0MHZ。对于性能状态表为CPC表的情况,可以将CPU的频率可调值的上限和下限初始化为相同的预设数值,如,将频率可调值的上限初始化为频率可调值的下限,或者,还可以将频率可调值的下限初始化为频率可调值的上限,又或者,还可以将频率可调值的下限和上限调整为任意相同的预设数值,如0MHZ。还可以,将性能状态表的表头初始化为范围未定义的值,以使OS无法通过表头找到频率可调值。通过此方案,可以无需对ACPI表的结构修改,即可达到阻止OS执行OS PM的目的。
在一种可能的实现方式中,所述方法还包括:当所述启动固件在所述OS运行之前、确定由所述OS执行PM后时,所述启动固件执行如下操作:
创建第三ACPI表,向所述OS发送所述第三ACPI表,其中,所述第三ACPI中包括性能状态表,所述第三ACPI表中包括的性能状态表中的频率可调值为所述CPU支持的预设频率可调值,以使所述OS执行OS PM;
向所述IMU固件发送IMU PM关闭指令;
所述IMU固件还执行如下操作:
接收所述启动固件发送的所述IMU PM关闭指令,关闭IMU PM。
本申请实施例所示的方案中,在上述启动设置界面的PM设置选项中,用户还可以选择OS PM。则在启动固件启动配置项中的PM设置这一配置项的数据为用于指示IMU关闭PM的数据,也可以理解为用于指示OS执行PM的数据。启动固件读取启动配置项中的PM设置这一配置项的数据时,则向IMU固件发送IMU PM关闭指令。IMU固件在接收到IMU PM关闭指令后,关闭IMU PM。另外,启动固件在初始化ACPI表时,可以正常初始化其中的性能状态表,即,将其中的性能状态表中的频率可调值初始化为CPU支持的预设频率可调值,以使OS可以通过加载ACPI表,来确定CPU的频率可调值,进而执行OS PM。
在一种可能的实现方式中,所述方法还包括:当所述启动固件在所述OS运行之前、确定由所述OS执行PM后时,所述启动固件执行如下操作:
创建第三ACPI表,向所述OS发送所述第三ACPI表;
在预设存储地址中写入第二预设数据;
所述IMU固件还执行如下操作:
通过轮询所述预设存储地址,获取所述第二预设数据,关闭IMU PM。
本申请实施例所示的方案中,上述启动固件发送IMU PM关闭通知的处理可以为:启动固件在预设存储地址中写入第二预设数据。相应的,IMU固件获取IMU PM关闭通知的处理 为:IMU固件通过轮询预设存储地址,获取第二预设数据。其中,预设存储地址为技术人员预先设置的用于存储PM执行通知的存储地址,第二预设数据可以为二进制数“0”。另外,启动固件在初始化ACPI表时,可以正常初始化其中的性能状态表,即,将其中的性能状态表中的频率可调值初始化为CPU支持的预设频率可调值,以使OS可以通过加载ACPI表,来确定CPU的频率可调值,进而执行OS PM。
在一种可能的实现方式中,所述启动固件为基本输入输出系统BIOS固件或者统一的可扩展固件接口UEFI固件。
本申请实施例所示的方案中,启动固件可以我BIOS固件或者UEFI固件,不同的电子设备中的启动固件也可能不同。
在一种可能的实现方式中,所述性能参数包括所述CPU的功耗,在所述获取CPU当前的性能参数之前,所述IMU固件执行如下操作:
接收所述带外管理系统发送功耗限制指令,其中,所述功耗限制指令中携带有功耗阈值;
所述基于所述性能参数,对所述CPU进行能耗管理,包括:
如果所述性能参数中的所述CPU的功耗大于所述功耗阈值,则降低所述CPU的频率和电压;
如果所述CPU的功耗小于所述功耗阈值的预设倍数,则提升所述CPU的频率和电压,其中,所述预设倍数大于0小于1。
本申请实施例所示的方案中,用户可以选择是否需要根据CPU的功耗,对CPU的频率和电压进行调节。用户可以向带外管理系统输入对限制CPU功耗的代码,带外管理系统则可以向IMU固件发送功耗限制指令,其中,该功耗限制指令中可以携带有功耗阈值。IMU接收到该耗限制指令后,实时获取CPU的当前功耗。如果上述获取到的CPU当前的功耗大于带外管理系统发送来的功耗阈值,则降低CPU的频率和电压。另外,还可以同时降低CPU的IO接口的功率和电压,如果CPU的频率已经调节到最低可调整值,则可以将CPU中各核的一些没有使用的端口关闭。如果CPU的功耗小于功耗阈值的预设倍数,则提升CPU的频率和电压,其中,预设倍数大于0小于1,如0.95。另外,还可以同时提升CPU的IO接口的功率和电压。通过本方案,可以根据用户需求确定是否要根据功耗,来调节频率和电压,这样,可以满足不同用户的不同的需求。
在一种可能的实现方式中,所述性能参数包括所述CPU的温度,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
如果所述CPU的温度大于第一温度阈值,则向所述带外管理系统发送高温告警消息,所述高温告警消息用于指示所述带外管理系统对CPU进行下电保护;
如果所述CPU的温度小于所述第一温度阈值,大于第二温度阈值,则降低所述CPU的频率和电压;
如果所述CPU的温度小于第三温度阈值,则提升所述CPU的频率和电压,其中,所述第三温度阈值小于所述第二温度阈值。
本申请实施例所示的方案中,在CPU上可以安装有温度传感器,温度传感器实时监测CPU的温度,IMU固件可以周期性从温度传感器获取到CPU当前的温度,例如,周期可以为0.5秒。或者,可以由温度传感器周期性监测CPU的温度,当温度达到温控阈值后,温度传感器才会向IMU固件发送CPU当前的温度。如果上述获取到的CPU当前的温度大于第一 温度阈值,则向带外管理系统发送高温告警消息。带外管理系统接收到高温告警消息后,对CPU进行下电保护,以防止温度过高使CPU受损。如果CPU的温度小于第一温度阈值,大于第二温度阈值,则降低CPU的频率和电压。另外,还可以同时降低CPU的IO接口的功率和电压,增大风扇转速,提升散热,如果仍无法使温度有效的降低,还可以调整CPU中各核的电源域状态,将一些处于空闲状态的核的电源域调整为关闭状态,即将这些核关闭,使其不再运行产热。如果CPU的温度小于第三温度阈值,则可以提升CPU的频率和电压,其中,第三温度阈值小于第二温度阈值。另外,如果在之前为了降温,将CPU中的一些核的电源调整为关闭状态,则此时可以再将这些核的电源域调整为开启状态,即将这些核重新开启。
在一种可能的实现方式中,所述性能参数包括所述CPU的使用率,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
如果所述CPU的使用率大于第一使用率阈值,则提升所述CPU的频率和电压;
如果所述CPU的使用率小于第二使用率阈值,则降低所述CPU的频率和电压。
本申请实施例所示的方案中,在CPU的每个核上都可以安装有性能监测单元(performance monitor unit,PMU),PMU用于统计其所在的核处于非空闲状态的时钟数。对于每个统计周期,由PMU统计在该统计周期内其所在的核处于非空闲状态下的时钟数,并发送给IMU固件。IMU固件可以使用非空闲状态下的时钟数除以该统计周期的总时钟数,得到相应的核在该统计周期内的使用率。对于一个时钟域来说,在该时钟域内的所有核的使用率相加,再除以该时钟域内的核的数目,即为该时钟域内的核的平均使用率。对于一个CPU来说,可以只设置有一个时钟域,即所有核处于相同的时钟域内,这种情况下,CPU的使用率即为该时钟域内的核的平均使用率。当然,对于一个CPU来说,也可以设置有多个时钟域,例如,每个核对应一个时钟域,或者每几个核对应一个时钟域,这种情况下,CPU的使用率可以用这些时钟域内的核的平均使用率共同表示。在上述获取到每个时钟域内的核的平均使用率后,如果该平均使用率大于第一使用率阈值,则可以提升该时钟域内的核的频率和电压。如果该平均使用率小于第二使用率阈值,则降低该时钟域内的核的频率和电压,其中,第一使用率阈值小于第二使用率阈值。
在一种可能的实现方式中,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
将所述性能参数与所述CPU当前的频率和电压输入到预先训练的特征提取模型中,得到待分类特征数据;
将所述待分类特征数据输入到预先训练的分类器模型中,得到目标业务类型;
基于预先存储的业务类型和配置调整策略之间的对应关系,确定所述目标业务类型对应的配置调整策略,其中,所述配置调节策略中至少包括所述CPU的待使用频率和待使用电压;
将所述CPU的频率和电压,分别调节为所述待使用频率和所述待使用电压。
本申请实施例所示的方案中,为了能根据CPU的所有性能参数,来综合决定如何对CPU的频率和电压进行调节。IMU固件可以将周期性获取到的CPU的性能参数和CPU的电压、频率,输入到预先训练的特征提取模型和分类器模型中,得到对应的目标业务类型。然后,查询业务分类和配置调整策略之间的对应关系,得到目标业务类型对应的配置调整策略。在该配置调整策略中包括有CPU待使用频率和待使用电压。再然后,可以将CPU的频率调节为该待使用频率,将CPU的电压调节为待使用电压。通过本方案,使得CPU的频率和电压调节更加灵活。
第二方面,提供了一种能耗管理的方法,用于电子设备的能耗管理,所述电子设备包括中央处理器CPU,存储器;所述存储器中存储有启动固件,操作系统OS以及智能管理单元IMU固件分别对应的多个程序指令,所述多个程序指令用于被所述CPU读取并执行以实现所述固件、所述OS以及所述IMU固件的功能,其中,所述能耗管理方法由所述IMU固件执行,包括:
在所述OS运行过程中,接收带外管理系统发送的用于通知所述IMU固件执行IMU PM的第一通知消息;
根据所述第一通知消息与所述OS进行交互,使得所述OS不再负责能耗管理;
获取所述CPU当前的性能参数,其中,所述性能参数包括所述CPU的功耗、温度和使用率中的一种或多种;
基于所述性能参数,对所述CPU进行能耗管理。
本申请实施例所示的方案中,如果服务器的OS运行过程中,执行PM的是OS,则用户可以通过服务器的带外管理系统开启IMU PM,使IMU固件负责PM。其中,带外管理系统可以为基板控制管理器(baseboard management controller,BMC)。用户可以向带外管理系统输入开启IMU PM的代码,带外管理系统则会通过智能平台管理接口(intelligent platform management interface,IPMI)向IMU固件发送第一通知消息,以使IMU固件在接收到该第一通知消息后,执行IMU PM。IMU固件可以通过和OS进行交互,使OS不再负责能耗管理。在IMU PM开启后,IMU固件可以周期性获取CPU实时的性能参数,如功耗、温度和使用率等。然后,再根据获取到的性能参数,对CPU的频率和电压进行调节,以达到能耗管理的目的。通过本方案,可以在OS运行过程中,将OS PM切换为IMU PM,使得电子设备的能耗管理更加灵活,另外,通过本方案性能参数的获取,以及CPU的频率和电压的调节均有IMU固件直接实现,无需与OS进行交互,减少了CPU的调节时延。
在一种可能的实现方式中,所述根据所述第一通知消息与所述OS进行交互,使得所述OS不再负责能耗管理,包括:
如果接收到所述OS发送的第一能耗管理请求,则不根据所述第一能耗管理请求执行能耗管理,并向所述OS返回预设消息,使得所述OS不再负责所述能耗管理。
本申请实施例所示的方案中,第一能耗管理请求可以为OS指示IMU对CPU进行调频的请求。在本方案中,IMU固件在接收到第一能耗管理请求后,并不会执行该第一能耗管理请求对应的调频操作,而是执行自己的IMU PM。另外,虽然IMU固件不会根据该第一能耗管理请求进行调频,但是,在接收到该第一能耗管理请求后,可以向OS返回预设消息,该预设消息可以为执行成功的通知消息,以欺骗OS,使OS以为自己在负责PM,而实际是由IMU固件负责。通过此方案,无需对ACPI表进行修改,可以使OS PM切换到IMU PM的效率更高。
在一种可能的实现方式中,所述根据所述第一通知消息与所述OS进行交互,包括:
在接收到所述第一通知消息后,获取第四高级配置和电源接口ACPI表,对所述第四ACPI表进行更新,得到第四更新ACPI表;
向所述OS发送第四ACPI表更新消息,其中,所述第四ACPI表更新消息用于指示所述OS获取所述第四更新ACPI表,以使所述OS基于所述第四更新ACPI表关闭OS PM。
本申请实施例所示的方案中,为了使OS不再执行OS PM,可以在内存中获取到ACPI 表,并对ACPI表进行更新,再存储在原存储地址,然后,可以向OS发送ACPI表更新消息,以指示OS在内存中获取并解析ACPI表,使得OS无法根据ACPI表执行能耗管理。
在一种可能的实现方式中,所述对所述第四ACPI表进行更新,包括:
将所述第四ACPI表中包括的性能状态表移除,其中,所述性能状态表为PSS表或CPC表;
或者,将所述第四ACPI表中包括的性能状态表中的频率可调值调整为相同的预设数值;
或者,将所述第四ACPI表中包括的性能状态表的表头修改为范围未定义的值。
本申请实施例所示的方案中,IMU固件可以从内存中获取到ACPI表(上述第四ACPI表),并将其中的性能状态表移除,再将存储在原存储地址。这样,OS在获取到该ACPI表后,则无法解析到性能状态表,从而无法执行OS PM。
或者,IMU固件将该ACPI表中的性能状态表中的频率可调值调整为相同的预设数值,对于不同种的性能状态表,可以有如下情况。对于性能状态表为PSS表的情况,可以将其中各等级的频率可调值均调整为相同的预设数值,如,将各等级的频率可调值均调整为P0级的频率可调值,或者,还可以将各等级的频率可调值均调整为任意相同的预设数值,如0MHZ。对于性能状态表为CPC表的情况,可以将CPU的频率可调值的上限和下限调整为相同的预设数值,如,将频率可调值的上限调整为频率可调值的下限,或者,可以将频率可调值的下限调整为频率可调值的上限,又或者,可以将频率可调值的下限和上限调整为任意相同的预设数值,如0MHZ。
又或者,IMU固件可以将该ACPI表中的性能状态表的表头修改为范围未定义的值,以使OS无法通过表头找到频率可调值。
在一种可能的实现方式中,所述IMU固件还执行如下操作:
在操作系统OS运行过程中,接收所述带外管理系统发送的用于通知所述IMU固件开启OS PM的第二通知消息;
如果当前所述OS负责能耗管理,则不再对所述第二通知消息进行处理;
如果当前所述OS不负责能耗管理,则根据所述第二通知消息与所述OS进行交互,使得所述OS负责能耗管理。
本申请实施例所示的方案中,用户可以向带外管理系统输入开启IMU PM的代码,带外管理系统则会通过IPMI向IMU固件发送第二通知消息。如果当前的PM为OS PM则可以不对该第二通知消息进行处理,如果当前的PM为IMU PM,则在接收到该第二通知消息后,需要关闭IMU PM,并使OS负责PM,即开启OS PM。
在一种可能的实现方式中,所述根据所述第二通知消息与所述OS进行交互,使得所述OS负责能耗管理,包括:
在接收到所述OS发送的第二能耗管理请求后,执行所述第二能耗管理请求。
在一种可能的实现方式中,所述根据所述第二通知消息与所述OS进行交互,使得所述OS负责能耗管理,包括:
获取第五ACPI表,对所述第五ACPI表进行更新,得到第五更新ACPI表;
向所述OS发送第五ACPI表更新消息,其中,所述第五ACPI表更新消息用于指示所述OS获取所述第五更新ACPI表,以使所述OS根据所述第五更新ACPI表开启操作系统能耗管理OS PM。
本申请实施例所示的方案中,IMU固件可以通过更新ACPI表的方式,使OS开启OS PM。
在一种可能的实现方式中,所述对所述第五ACPI表进行更新,包括:
如果所述第五ACPI表中不包括性能状态表,则在所述第五ACPI表中添加性能状态表;
如果所述第五ACPI表中包括有性能状态表,则将所述第五ACPI表中包括的性能状态表中的频率可调值调整为所述CPU支持的预设频率可调值。
本申请实施例所示的方案中,为了使OS开启OS PM,IMU固件通过如下操作更新ACPI表。如果在之前使OS不负责PM时,对ACPI表进行的更新是将其中的性能状态表移除,则此处可以在内存中获取到ACPI表(上述第五ACPI表),并在其中添加正常的性能状态表。如果在之前使OS不负责PM时,对ACPI表进行的更新是对其中的频率可调值进行修改,而并未移除性能状态表,则此处可以将性能状态表中的频率可调值调整为CPU支持的预设频率可调值。如果在之前使OS不负责PM时,对ACPI表进行的更新是对表头进行修改,而并未移除性能状态表,则此处可以将性能状态表的表头调整为正常的频率可调值的表头。对ACPI表进行更新后,将其存储于原存储地址。
在一种可能的实现方式中,所述性能参数包括所述CPU的功耗,在所述获取CPU当前的性能参数之前,所述IMU固件对应的程序指令还被所述CPU读取并执行如下操作:
接收所述带外管理系统发送功耗限制指令,其中,所述功耗限制指令中携带有功耗阈值;
所述基于所述性能参数,对所述CPU进行能耗管理,包括:
如果所述性能参数中的所述CPU的功耗大于所述功耗阈值,则降低所述CPU的频率和电压;
如果所述CPU的功耗小于所述功耗阈值的预设倍数,则提升所述CPU的频率和电压,其中,所述预设倍数大于0小于1。
本申请实施例所示的方案中,用户可以选择是否需要根据CPU的功耗,对CPU的频率和电压进行调节。用户可以向带外管理系统输入对限制CPU功耗的代码,带外管理系统则可以根据该代码向IMU固件发送功耗限制指令,其中,该功耗限制指令中可以携带有功耗阈值。IMU接收到该耗限制指令后,实时获取CPU的当前功耗。如果上述获取到的CPU当前的功耗大于带外管理系统发送来的功耗阈值,则降低CPU的频率和电压。另外,还可以同时降低CPU的IO接口的功率和电压,如果CPU的频率已经调节到最低可调整值,则可以将CPU中各核的一些没有使用的端口关闭。如果CPU的功耗小于功耗阈值的预设倍数,则提升CPU的频率和电压,其中,预设倍数大于0小于1,如0.95。另外,还可以同时提升CPU的IO接口的功率和电压。通过本方案,可以根据用户需求确定是否要根据功耗,来调节频率和电压,这样,可以满足不同用户的不同的需求。
在一种可能的实现方式中,所述性能参数包括所述CPU的温度,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
如果所述CPU的温度大于第一温度阈值,则向所述带外管理系统发送高温告警消息,所述高温告警消息用于指示所述带外管理系统对CPU进行下电保护;
如果所述CPU的温度小于所述第一温度阈值,大于第二温度阈值,则降低所述CPU的频率和电压;
如果所述CPU的温度小于第三温度阈值,则提升所述CPU的频率和电压,其中,所述第三温度阈值小于所述第二温度阈值。
本申请实施例所示的方案中,在CPU上可以安装有温度传感器,温度传感器实时监测CPU的温度,IMU固件可以周期性从温度传感器获取到CPU当前的温度,例如,周期可以为0.5秒。或者,可以由温度传感器周期性监测CPU的温度,当温度达到温控阈值后,温度传感器才会向IMU固件发送CPU当前的温度。如果上述获取到的CPU当前的温度大于第一温度阈值,则向带外管理系统发送高温告警消息。带外管理系统接收到高温告警消息后,对CPU进行下电保护,以防止温度过高使CPU受损。如果CPU的温度小于第一温度阈值,大于第二温度阈值,则降低CPU的频率和电压。另外,还可以同时降低CPU的IO接口的功率和电压,增大风扇转速,提升散热,如果仍无法使温度有效的降低,还可以调整CPU中各核的电源域状态,将一些处于空闲状态的核的电源域调整为关闭状态,即将这些核关闭,使其不再运行产热。如果CPU的温度小于第三温度阈值,则可以提升CPU的频率和电压,其中,第三温度阈值小于第二温度阈值。另外,如果在之前为了降温,将CPU中的一些核的电源调整为关闭状态,则此时可以再将这些核的电源域调整为开启状态,即将这些核重新开启。
在一种可能的实现方式中,所述性能参数包括所述CPU的使用率,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
如果所述CPU的使用率大于第一使用率阈值,则提升所述CPU的频率和电压;
如果所述CPU的使用率小于第二使用率阈值,则降低所述CPU的频率和电压。
本申请实施例所示的方案中,在CPU的每个核上都可以安装有性能监测单元(performance monitor unit,PMU),PMU用于统计其所在的核处于非空闲状态的时钟数。对于每个统计周期,由PMU统计在该统计周期内其所在的核处于非空闲状态下的时钟数,并发送给IMU固件。IMU固件可以使用非空闲状态下的时钟数除以该统计周期的总时钟数,得到相应的核在该统计周期内的使用率。对于一个时钟域来说,在该时钟域内的所有核的使用率相加,再除以该时钟域内的核的数目,即为该时钟域内的核的平均使用率。对于一个CPU来说,可以只设置有一个时钟域,即所有核处于相同的时钟域内,这种情况下,CPU的使用率即为该时钟域内的核的平均使用率。当然,对于一个CPU来说,也可以设置有多个时钟域,例如,每个核对应一个时钟域,或者每几个核对应一个时钟域,这种情况下,CPU的使用率可以用这些时钟域内的核的平均使用率共同表示。在上述获取到每个时钟域内的核的平均使用率后,如果该平均使用率大于第一使用率阈值,则可以提升该时钟域内的核的频率和电压。如果该平均使用率小于第二使用率阈值,则降低该时钟域内的核的频率和电压,其中,第一使用率阈值小于第二使用率阈值。
在一种可能的实现方式中,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
将所述性能参数与所述CPU当前的频率和电压输入到预先训练的特征提取模型中,得到待分类特征数据;
将所述待分类特征数据输入到预先训练的分类器模型中,得到目标业务类型;
基于预先存储的业务类型和配置调整策略之间的对应关系,确定所述目标业务类型对应的配置调整策略,其中,所述配置调节策略中至少包括所述CPU的待使用频率和待使用电压;
将所述CPU的频率和电压,分别调节为所述待使用频率和所述待使用电压。
本申请实施例所示的方案中,为了能根据CPU的所有性能参数,来综合决定如何对CPU的频率和电压进行调节。IMU固件可以将周期性获取到的CPU的性能参数和CPU的电压、频率,输入到预先训练的特征提取模型和分类器模型中,得到对应的目标业务类型。然后, 查询业务分类和配置调整策略之间的对应关系,得到目标业务类型对应的配置调整策略。在该配置调整策略中包括有CPU待使用频率和待使用电压。再然后,可以将CPU的频率调节为该待使用频率,将CPU的电压调节为待使用电压。通过本方案,使得CPU的频率和电压调节更加灵活。
第三方面,提供了一种能耗管理的设备,所述设备包括CPU,存储器,所述存储器中存储有启动固件,操作系统OS以及智能管理单元IMU固件分别对应的多个程序指令,所述多个程序指令用于被所述CPU读取并执行以实现所述启动固件、所述OS以及所述IMU固件的功能;
其中,所述IMU固件,用于执行权利要求1-9或10-18中任一项所述的能耗管理的方法。
在一种可能的实现方式中,所述CPU包括IMU核以及业务处理AP核,其中,所述AP与所述IMU处理器通过系统隔离墙SIW隔离;
所述IMU固件的功能由所述IMU核处理。
本申请实施例提供的技术方案带来的有益效果是:
IMU固件可以获取IMU PM执行通知,以开启IMU PM。通过直接获取CPU当前的性能参数,并根据获取到的性能参数对CPU的频率和电压进行调节,达到能耗管理的目的。在这一过程中无需OS获取性能参数,再通知IMU固件进行CPU的频率和电压的调节,减少了交互过程,使得频率和电压的调节更加高效。
附图说明
图1是本申请实施例提供的一种服务器的结构示意图;
图2是本申请实施例提供的一种CPU的结构示意图;
图3是本申请实施例提供的一种能耗管理的方法的流程示意图;
图4是本申请实施例提供的一种能耗管理的方法的流程示意图;
图5是本申请实施例提供的一种带外管理系统的结构示意图;
图6是本申请实施例提供的一种能耗管理的设备。
具体实施方式
本申请实施例提供了一种能耗管理的方法,该方法可以用于电子设备的能耗管理,电子设备可以包括有CPU和存储器,存储器中可以存储有固件和OS分别对应的多个程序指令,多个程序指令被CPU读取并执行以实现固件和OS的功能,其中,固件可以包括启动固件和IMU固件,本申请实施例中提供的能耗管理方法可以由IMU固件执行实现。
上述电子设备可以为服务器、计算机等,本申请实施例以电子设备为服务器为例进行说明。如图1所示的服务器的结构示意图中,可以包括有OS、固件和CPU,固件可以包括有启动固件和IMU固件,启动固件如:统一的可扩展固件接口(unified extensible firmware interface,UEFI)固件、基本输入输出系统(Basic Input Output System,BIOS)固件,图中示出的为UEFI固件。UEFI固件可以用于在OS启动时,建立高级配置和电源接口(advanced configuration and power interface,ACPI)表以使OS可以正常启动,IMU固件可以用于实现本申请提供的能耗管理方法,通过获取CPU的性能参数,调节CPU的频率和电压,以达到对服务器能耗管理的目的。CPU可以包括有多个独立的核(core),如用于业务处理的业务处 理器(application processor,AP)核,以及用于实现本申请实施例提供的能耗管理方法的处理器核,在本申请实施例中称为IMU核。上述UEFI固件以及OS可以运行在AP核上,IMU固件可以运行在IMU核上。当然,对于CPU来说,也可以仅包括有AP核,相应的,IMU固件可以运行在AP核上,同样也可以实现本申请实施例提供的能耗管理的方法。
对于包括有AP核和IMU核的CPU的结构示意图可以参见图2。如图2所示,左侧为多个AP核,右侧为IMU核,AP核和IMU核之间可以进行高速互联。另外,由于在CPU中独立出的IMU核用于运行IMU固件以实现能耗管理,那么,在IMU核上的数据也就相对比较重要,为了保证IMU核的数据安全,可以在通过系统隔离墙(system isolation wall,SIW)将AP核和IMU核进行隔离,实现AP核和IMU核之间的单向访问,即IMU核可以访问AP核中的数据,但是AP核不能访问IMU核中的数据。需要说明的是,IMU固件的名称并不仅限定为IMU,在其他应用中,也可以被命名为其他的名称。
下面对本申请实施例提供的一种能耗管理的方法的处理流程进行说明。
如图3所示,该方法的处理流程可以包括如下的步骤:
步骤301、在操作系统OS运行之前,获取智能管理单元能耗管理(intelligent management unit power management,IMU PM)执行通知,其中,IMU PM执行通知是由启动固件在OS运行之前、确定由IMU执行PM后发送的,启动固件还用于在OS运行之前阻止OS执行操作系统能耗管理(operating system power management,OS PM)。
其中,IMU PM执行通知是用于通知IMU固件执行IMU PM的。
在实施中,在OS运行之前,启动固件确定能耗管理(power management,PM)由IMU固件执行,则可以发送IMU PM执行通知。IMU固件可以通过获取IMU PM执行通知,来开启IMU PM。为了避免和OS所执行的OS PM相冲突,启动固件发送IMU PM执行通知之前,可以先阻止OS执行OS PM。
在OS运行之前,启动固件可以通过如下方式确定PM由IMU固件执行。
在OS运行之前,可以通过启动设置界面给用户提供PM设置选项,其中,启动设置界面可以为UEFI setup界面或者BIOS界面。服务器上电,在启动固件启动时,服务器外的显示屏可以显示有启动设置界面,用户可以在该启动设置界面上的PM设置选项中,选择IMU PM。则在启动固件启动配置项中的PM设置这一配置项的数据为用于指示IMU进行PM的数据。启动固件读取启动配置项中的PM设置这一配置项的数据时,则发送IMU PM执行通知。
对于上述IMU PM执行通知可以由多种形式,以下列举其中几种进行说明。
形式一、IMU PM执行通知为IMU PM执行指令。
则上述启动固件发送IMU PM执行通知的处理可以为:启动固件向IMU固件发送IMU PM执行指令。相应的,IMU固件获取IMU PM执行通知的处理为:IMU固件接收该启动固件发送的IMU PM执行指令。
形式二、IMU PM执行通知为在预设存储地址中的第一预设数据。
则上述启动固件发送IMU PM执行通知的处理可以为:启动固件在预设存储地址中写入第一预设数据。相应的,IMU固件获取IMU PM执行通知的处理为:IMU固件通过轮询所述预设存储地址,获取所述第一预设数据。其中,预设存储地址为技术人员预先设置的用于存储PM执行通知的存储地址,第一预设数据可以为二进制数“1”。
另外,上述启动固件阻止OS执行OS PM的方式可以有多种,以下列举其中几种进行说明。
方式一、启动固件创建第一高级配置和电源接口ACPI表,并将第一ACPI表上报至OS,其中,第一ACPI表中不包括性能状态表,以阻止OS执行OS PM,性能状态表为性能支持状态PSS表或连续性能控制CPC表。
此处需要说明的是,根据不同的ACPI规范,ACPI表中可以包括有PSS表和CPC表中的一种,PSS表和CPC表均可以给OS提供CPU支持的频率可调值,不同的是,PSS表中提供了CPU支持的多个不同等级的频率可调值,如P0级的频率可调值为2001MHZ,P2级的频率可调值为1900MHZ等,而CPC表中提供了CPU支持的频率可调值的上限和下限。OS可以根据这两种表中提供的CPU支持的频率可调值对CPU的频率进行调整。
在实施中,启动固件在初始化ACPI表(即上述第一ACPI表)时,可以不初始化其中的性能状态表,则OS无法对CPU进行调频。
方式二、创建第二ACPI表,并将第二ACPI表上报至OS,其中,第二ACPI表中包括性能状态表,第二ACPI表中包括的性能状态表中的频率可调值为相同的预设数值,或者,第二ACPI表中包括的性能状态表的表头为范围未定义的值,以阻止所述OS执行OS PM。
在实施中,启动固件在初始化ACPI表(即上述第二ACPI表)时,可以初始化其中的性能状态表,不过将性能状态表中的频率可调值初始化为相同的预设数值。对于不同种的性能状态表可以有如下情况。对于性能状态表为PSS表的情况,可以将其中各等级的频率可调值均初始化为相同的预设数值,如,将各等级的频率可调值均初始化为P0级的频率可调值,或者,还可以将各等级的频率可调值均初始化为任意相同的预设数值,如0MHZ。对于性能状态表为CPC表的情况,可以将CPU的频率可调值的上限和下限初始化为相同的预设数值,如,将频率可调值的上限初始化为频率可调值的下限,或者,还可以将频率可调值的下限初始化为频率可调值的上限,又或者,还可以将频率可调值的下限和上限调整为任意相同的预设数值,如0MHZ。还可以,将性能状态表的表头初始化为范围未定义的值,以使OS无法通过表头找到频率可调值。
在一种可能的实现方式中,在OS运行之前,还可以选择由OS执行PM,相应的,启动固件执行的操作可以如下:创建第三ACPI表,向OS发送第三ACPI表,其中,第三ACPI中包括性能状态表,第三ACPI表中包括的性能状态表中的频率可调值调整为CPU支持的预设频率可调值,以使OS执行OS PM;发送IMU PM关闭通知。相应的,IMU固件还可以执行如下操作:获取IMU PM关闭通知,关闭IMU PM。
在实施中,在上述启动设置界面的PM设置选项中,用户可以选择OS PM。则在启动固件启动配置项中的PM设置这一配置项的数据为用于指示IMU关闭PM的数据,也可以理解为用于指示OS执行PM的数据。启动固件读取启动配置项中的PM设置这一配置项的数据时,则发送IMU PM关闭通知。
对于上述IMU PM关闭通知可以有多种形式,以下列举其中几种进行说明。
形式一、IMU PM关闭通知为IMU PM关闭指令。
上述启动固件发送IMU PM关闭通知的处理可以为:启动固件向IMU固件发送IMU PM关闭指令。相应的,IMU固件获取IMU PM关闭通知的处理为:IMU固件接收该启动固件发送的IMU PM关闭指令。
形式二、IMU PM执行通知为在预设存储地址中的第二预设数据。
上述启动固件发送IMU PM关闭通知的处理可以为:启动固件在预设存储地址中写入第二预设数据。相应的,IMU固件获取IMU PM关闭通知的处理为:IMU固件通过轮询预设存储地址,获取第二预设数据。其中,预设存储地址为技术人员预先设置的用于存储PM执行通知的存储地址,第二预设数据可以为二进制数“0”。
启动固件在初始化ACPI表(即上述第三ACPI表)时,可以正常初始化其中的性能状态表,即,将其中的性能状态表中的频率可调值初始化为CPU支持的预设频率可调值,以使OS可以通过加载ACPI表,来确定CPU的频率可调值,进而执行OS PM。
步骤302、在根据IMU PM执行通知确定由IMU固件对CPU进行能耗管理后,获取中央处理器CPU当前的性能参数,其中,性能参数包括CPU的功耗、温度和使用率中的一种或多种。
在实施中,IMU固件可以获取CPU的性能参数,如功耗、温度和使用率等。
对于CPU的功耗的获取。
IMU PM开启后,IMU固件可以周期性获取CPU的功耗,例如周期可以为0.5秒。或者,IMU PM开启后,IMU可以不立即获取CPU的功耗,而是由用户自己决定是否需要根据CPU的功耗对CPU进行调频、调压,只有在用户需要根据CPU的功耗对CPU进行调频、调压时,IMU固件才会周期性获取CPU的功耗。在用户需要根据CPU的功耗对CPU进行调频、调压时,用户可以向带外管理系统输入对限制CPU功耗的代码,带外管理系统则可以向IMU固件发送功耗限制指令,其中,该功耗限制指令中可以携带有功耗阈值。IMU接收到该耗限制指令后,实时获取CPU的当前功耗。
对于CPU的温度的获取。
在CPU上可以安装有温度传感器,温度传感器实时监测CPU的温度,IMU固件可以周期性从温度传感器获取到CPU当前的温度,例如,周期可以为0.5秒。或者,可以由温度传感器周期性监测CPU的温度,当温度达到温控阈值后,温度传感器才会向IMU固件发送CPU当前的温度。
对于CPU的使用率的获取。
在CPU的每个核上都可以安装有性能监测单元(performance monitor unit,PMU),PMU用于统计其所在的核处于非空闲状态的时钟数。对于每个统计周期,由PMU统计在该统计周期内其所在的核处于非空闲状态下的时钟数,并发送给IMU固件。IMU固件可以使用非空闲状态下的时钟数除以该统计周期的总时钟数,得到相应的核在该统计周期内的使用率。对于一个时钟域来说,在该时钟域内的所有核的使用率相加,再除以该时钟域内的核的数目,即为该时钟域内的核的平均使用率。对于一个CPU来说,可以只设置有一个时钟域,即所有核处于相同的时钟域内,这种情况下,CPU的使用率即为该时钟域内的核的平均使用率。当然,对于一个CPU来说,也可以设置有多个时钟域,例如,每个核对应一个时钟域,或者每几个核对应一个时钟域,这种情况下,CPU的使用率可以用这些时钟域内的核的平均使用率共同表示。
步骤303、基于性能参数,对CPU进行能耗管理。
在实施中,IMU固件可以根据获取到的不同性能参数,来调节CPU的频率和电压。下面对根据获取到的每种性能参数,调节CPU的频率和电压分别进行说明。
根据CPU的功耗进行调节。
如果上述获取到的CPU当前的功耗大于带外管理系统发送来的功耗阈值,则降低CPU的频率,还可以在降低频率的同时降低CPU的电压。另外,还可以同时降低CPU的IO接口的功率和电压,如果CPU的频率已经调节到最低可调整值,则可以将CPU中各核的一些没有使用的端口关闭。如果CPU的功耗小于功耗阈值的预设倍数,则提升CPU的频率和电压,其中,预设倍数大于0小于1,如0.95。另外,还可以同时提升CPU的IO接口的功率和电压。
根据CPU的温度进行调节。
如果上述获取到的CPU当前的温度大于第一温度阈值,则向带外管理系统发送高温告警消息。带外管理系统接收到高温告警消息后,对CPU进行下电保护,以防止温度过高使CPU受损。如果CPU的温度小于第一温度阈值,大于第二温度阈值,则降低CPU的频率,还可以在降低频率的同时降低CPU的电压。另外,还可以同时降低CPU的IO接口的功率和电压,增大风扇转速,提升散热,如果仍无法使温度有效的降低,还可以调整CPU中各核的电源域状态,将一些处于空闲状态的核的电源域调整为关闭状态,即将这些核关闭,使其不再运行产热。如果CPU的温度小于第三温度阈值,则可以提升CPU的频率,还可以在提升频率的同时提升CPU的电压,其中,第三温度阈值小于第二温度阈值。另外,如果在之前为了降温,将CPU中的一些核的电源调整为关闭状态,则此时可以再将这些核的电源域调整为开启状态,即将这些核重新开启。
根据CPU的使用率进行调节。
在上述获取到每个时钟域内的核的平均使用率后,如果该平均使用率大于第一使用率阈值,则可以提升该时钟域内的核的频率,还可以在提升频率的同时提升其电压。如果该平均使用率小于第二使用率阈值,则降低该时钟域内的核的频率,还可以在降低频率的同时降低其电压,其中,第一使用率阈值小于第二使用率阈值。
此处需要说明的是,上述提升或者降低CPU的频率,均可以通过调整CPU内各核对应的时钟域的锁相环电路(phase locked loop,PLL)来进行调节。在通过PLL来调节CPU的频率时,可以有以下几种模式。
模式一、快升慢降模式,即迅速提升频率,缓慢减低频率,这种模式可以保证CPU的性能。
模式二、慢升快降模式,即缓慢提升频率,快速减低频率,这种模式下可以有效节省CPU功耗。
在一种可能的实现方式中,可以基于CPU的所有性能参数,来综合决定如何对CPU的频率和电压进行调节,相应的,处理可以如下:将性能参数与CPU当前的频率和电压输入到预先训练的特征提取模型中,得到待分类特征数据。将待分类特征数据输入到预先训练的分类器模型中,得到CPU当前的业务分类;基于预先存储的业务分类和配置调整策略之间的对应关系,确定CPU当前的业务分类对应的配置调整策略,其中,配置调节策略中至少包括CPU的待使用频率和待使用电压。将CPU的频率和电压,分别调节为待使用频率和待使用电压。
其中,特征提取模型可以为长短期记忆(long short-term memory,LSTM)自编码器模型、循环神经网络(recurrent neural network,RNN)模型等,分类器模型可以为K最邻近(k-nearest  neighbor,KNN)分类模型、多层感知器(multi-layer perception,MLP)分类模型等。
在实施中,技术人员可以预先建立特征提取模型和分类器模型,并对特征提取模型和分类器模型训练。在训练特征提取模型和分类器模型训练时,可以对两个模型同时训练。技术人员可以采集大量服务器中CPU运行时的性能参数和CPU的电压、频率,作为输入样本,即每组输入样本中至少包括有CPU运行时的性能参数和CPU的电压、频率。在获取到输入样本后,可以由人工对这些输入样本进行业务分类,例如,可以分为10个业务类型。每组输入样本对应的业务类型即为输出样本。这样每组输入样本核对应的输出样本,即可以组成一组训练样本。通过使用大量训练样本,对特征提取模型和分类器模型训练进行训练,不断调整特征提取模型和分类器模型的参数,以使其准确性更高,最后,可以得到训练后的特征提取模型和分类器模型。对于每个业务类型,技术人员可以对该业务类型对应的CPU运行时的性能参数和CPU的电压、频率,进行能效评分,将能效评分最高的一组中的CPU的电压、频率作为该业务类型对应的配置调整策略。然后,将每个业务类型与相应的配置调整策略的进行对应存储。这样,该配置调整策略即可以为CPU在相应的业务类型下的待使用频率和待使用电压。
IMU固件可以将周期性获取到的CPU的性能参数和CPU的电压、频率,输入到预先训练的特征提取模型和分类器模型中,得到对应的目标业务类型。然后,查询业务分类和配置调整策略之间的对应关系,得到目标业务类型对应的配置调整策略。在该配置调整策略中包括有CPU待使用频率和待使用电压。再然后,可以将CPU的频率调节为该待使用频率,将CPU的电压调节为待使用电压。
通过本申请实施例提供的能耗管理的方法,IMU固件可以获取IMU PM执行通知,以开启IMU PM。通过直接获取CPU当前的性能参数,并根据获取到的性能参数对CPU的频率和电压进行调节,达到能耗管理的目的。在这一过程中无需OS获取性能参数,再通知IMU固件进行CPU的频率和电压的调节,减少了交互过程,使得频率和电压的调节更加高效。
下面对本申请实施例提供的又一种能耗管理的方法的处理流程进行说明。
如图4所示,该方法的处理流程可以包括如下的步骤:
步骤401、在OS运行过程中,接收带外管理系统发送的用于通知所述IMU固件执行IMU PM的第一通知消息。
在实施中,如果服务器的OS运行过程中,执行PM的是OS,则用户可以通过服务器的带外管理系统开启IMU PM,使IMU固件负责PM。其中,带外管理系统可以为基板控制管理器(baseboard management controller,BMC)。如图5中的5a所示,带外管理系统可以是服务器中的另外一个CPU--CPU1;如图5中的5b所示,带外管理系统还可以是CPU中的一个处理器核。用户可以向带外管理系统输入开启IMU PM的代码,带外管理系统则会通过智能平台管理接口(intelligent platform management interface,IPMI)向IMU固件发送第一通知消息,以使IMU固件在接收到该第一通知消息后,执行IMU PM。
步骤402、根据第一通知消息与OS进行交互,使得OS不再负责能耗管理。
在实施中,IMU固件与OS进行交互,使得OS不再负责能耗管理,可以有多种实现方式,以下列举其中几种进行说明。
方式一、如果接收到OS发送的第一能耗管理请求,则不根据第一能耗管理请求执行能 耗管理,并向OS返回预设消息,使得OS不再负责所述能耗管理。
其中,第一能耗管理请求可以为OS指示IMU对CPU进行调频的请求。
在此种方式下,IMU固件在接收到第一能耗管理请求后,并不会执行该第一能耗管理请求对应的调频操作,而是执行自己的IMU PM。另外,虽然IMU固件不会根据该第一能耗管理请求进行调频,但是,在接收到该第一能耗管理请求后,可以向OS返回预设消息,该预设消息可以为执行成功的通知消息,以欺骗OS,使OS以为自己在负责PM,而实际是由IMU固件负责。
方式二、获取第四高级配置和电源接口ACPI表,对第四ACPI表进行更新,得到第四更新ACPI表;向OS发送第四ACPI表更新消息,其中,第四ACPI表更新消息用于指示OS获取第四更新ACPI表,以使OS基于第四更新ACPI表关闭OS PM。
在此种方式下,为了使OS不再执行OS PM,可以对ACPI表进行更新,使得OS无法根据ACPI表执行能耗管理。此处,IMU固件在更新ACPI表时,可以有多种方法,以下列举几种进行说明。
方法一、将上述第四ACPI表中包括的性能状态表移除,其中,性能状态表为PSS表或CPC表。
在实施中,IMU固件可以从内存中获取到ACPI表(即上述第四ACPI表),并将其中的性能状态表移除,再将存储在原存储地址。这样,OS在获取到该ACPI表后,则无法解析到性能状态表,从而无法执行OS PM。
方法二、将上述第四ACPI表中包括的性能状态表中的频率可调值调整为相同的预设数值。
在实施中,将性能状态表中的频率可调值调整为相同的预设数值,对于不同种的性能状态表,可以有如下情况。对于性能状态表为PSS表的情况,可以将其中各等级的频率可调值均调整为相同的预设数值,如,将各等级的频率可调值均调整为P0级的频率可调值,或者,还可以将各等级的频率可调值均调整为任意相同的预设数值,如0MHZ。对于性能状态表为CPC表的情况,可以将CPU的频率可调值的上限和下限调整为相同的预设数值,如,将频率可调值的上限调整为频率可调值的下限,或者,可以将频率可调值的下限调整为频率可调值的上限,又或者,可以将频率可调值的下限和上限调整为任意相同的预设数值,如0MHZ。
方法三、将上述第四ACPI表中包括的性能状态表的表头修改为范围未定义的值。
在实施中,还可以将性能状态表的表头修改为范围未定义的值,以使OS无法通过表头找到频率可调值。
在一种可能的实现方式中,在OS运行过程中,还可以通过带外管理系统选择OS PM。相应的,IMU PM可以执行如下操作:在操作系统OS运行过程中,接收带外管理系统发送的用于通知IMU固件开启OS PM的第二通知消息;如果当前OS负责能耗管理,则不再对第二通知消息进行处理;如果当前OS不负责能耗管理,则根据第二通知消息与OS进行交互,使得OS负责能耗管理。
在实施中,用户可以向带外管理系统输入开启IMU PM的代码,带外管理系统则会通过IPMI向IMU固件发送第二通知消息。如果当前的PM为OS PM则可以不对该第二通知消息进行处理,如果当前的PM为IMU PM,则在接收到该第二通知消息后,需要关闭IMU PM,并使OS负责PM,即开启OS PM。
针对上述使OS不负责PM的方式不同,此处根据第二通知消息与OS进行交互,使得OS负责能耗管理的方式也不相同。
针对上述方式一,此处IMU固件在接收到第二通知消息后,当接收到OS发送的第二能耗管理请求后,执行该第二能耗管理请求。
针对上述方式二,此处IMU固件在接收到第二通知消息后,获取第五ACPI表,对第五ACPI表进行更新,得到第五更新ACPI表;向OS发送第五ACPI表更新消息,其中,第五ACPI表更新消息用于指示OS获取第五更新ACPI表,以使OS可以根据第五更新ACPI表开启OS PM。此处,更新ACPI表的方法可以如下。
如果第五ACPI表中不包括性能状态表,则在五ACPI表中添加性能状态表;如果第五ACPI表中包括有性能状态表,则将第五ACPI表中包括的性能状态表中的频率可调值调整为CPU支持的预设频率可调值。
在实施中,如果在之前使OS不负责PM时,对ACPI表进行的更新是将其中的性能状态表移除,则此处可以在内存中获取到ACPI表(即上述第五ACPI表),并在其中添加正常的性能状态表。如果在之前使OS不负责PM时,对ACPI表进行的更新是对其中的频率可调值进行修改,而并未移除性能状态表,则此处可以将性能状态表中的频率可调值调整为CPU支持的预设频率可调值。如果在之前使OS不负责PM时,对ACPI表进行的更新是对表头进行修改,而并未移除性能状态表,则此处可以将性能状态表的表头调整为正常的频率可调值的表头。对ACPI表进行更新后,将其存储于原存储地址。
下面对上述IMU固件向OS发送ACPI表更新消息的过程进行如下说明。
IMU固件确认与OS之间的Mailbox(邮箱)为空时,写入ACPI表更新消息到Mailbox,同时产生消息中断(Notify Interrupt)反馈到OS。OS收到Notify Interrupt时,或者轮询到Notify Interrupt时,则会处理Mailbox中的ACPI表更新消息,并产生门铃(Doorbell)中断给IMU固件,并清除Notify Interrupt。IMU固件收到OS返回的Doorbell中断后,确认OS的Doorbell中断,并清除Doorbell中断。
另外,在本申请实施例中还提供了一种IUM固件和OS之间发送的通信消息的数据结构,该通信消息即可以为上述ACPI表更新消息,数据结构如下表1所示。
表1
Figure PCTCN2020122459-appb-000001
在上述数据结构中,Payload中所携带的数据可以如下表2所示。
表2
Bytes Name Description(描述)
1 PM 能耗管理策略
    0:Reserved
    1:OS PM
    2:IMU PM
     
下面对上述表2进行说明。Payload中的第一个Byte,Byte1处写入1,即代表PM为OS PM,写入2即PM代表PM为IMU PM。
步骤403、在根据上述第一特征消息确定由IMU固件对CPU进行能耗管理后,获取中央处理器CPU当前的性能参数,其中,性能参数包括CPU的功耗、温度和使用率中的一种或多种。
在实施中,IMU固件可以获取CPU的性能参数,如功耗、温度和使用率等。
对于CPU的功耗的获取。
IMU PM开启后,IMU固件可以周期性获取CPU的功耗,例如周期可以为0.5秒。或者,IMU PM开启后,IMU可以不立即获取CPU的功耗,而是由用户自己决定是否需要根据CPU的功耗对CPU进行调频、调压,只有在用户需要根据CPU的功耗对CPU进行调频、调压时,IMU固件才会周期性获取CPU的功耗。在用户需要根据CPU的功耗对CPU进行调频、调压时,用户可以向带外管理系统输入对限制CPU功耗的代码,带外管理系统则可以向IMU固件发送功耗限制指令,其中,该功耗限制指令中可以携带有功耗阈值。IMU接收到该耗限制指令后,实时获取CPU的当前功耗。
对于CPU的温度的获取。
在CPU上可以安装有温度传感器,温度传感器实时监测CPU的温度,IMU固件可以周期性从温度传感器获取到CPU当前的温度,例如,周期可以为0.5秒。或者,可以由温度传感器周期性监测CPU的温度,当温度达到温控阈值后,温度传感器才会向IMU固件发送CPU当前的温度。
对于CPU的使用率的获取。
在CPU的每个核上都可以安装有性能监测单元(performance monitor unit,PMU),PMU用于统计其所在的核处于非空闲状态的时钟数。对于每个统计周期,由PMU统计在该统计周期内其所在的核处于非空闲状态下的时钟数,并发送给IMU固件。IMU固件可以使用非空闲状态下的时钟数除以该统计周期的总时钟数,得到相应的核在该统计周期内的使用率。对于一个时钟域来说,在该时钟域内的所有核的使用率相加,再除以该时钟域内的核的数目,即为该时钟域内的核的平均使用率。对于一个CPU来说,可以只设置有一个时钟域,即所有核处于相同的时钟域内,这种情况下,CPU的使用率即为该时钟域内的核的平均使用率。当然,对于一个CPU来说,也可以设置有多个时钟域,例如,每个核对应一个时钟域,或者每几个核对应一个时钟域,这种情况下,CPU的使用率可以用这些时钟域内的核的平均使用率共同表示。
步骤404、基于性能参数,对CPU进行能耗管理。
在实施中,IMU固件可以根据获取到的不同性能参数,来调节CPU的频率和电压。下面对根据获取到的每种性能参数,调节CPU的频率和电压分别进行说明。
根据CPU的功耗进行调节。
如果上述获取到的CPU当前的功耗大于带外管理系统发送来的功耗阈值,则降低CPU的频率,还可以在降低频率的同时降低CPU的电压。另外,还可以同时降低CPU的IO接口的功率和电压,如果CPU的频率已经调节到最低可调整值,则可以将CPU中各核的一些没有使用的端口关闭。如果CPU的功耗小于功耗阈值的预设倍数,则提升CPU的频率和电压,其中,预设倍数大于0小于1,如0.95。另外,还可以同时提升CPU的IO接口的功率和电压。
根据CPU的温度进行调节。
如果上述获取到的CPU当前的温度大于第一温度阈值,则向带外管理系统发送高温告警消息。带外管理系统接收到高温告警消息后,对CPU进行下电保护,以防止温度过高使CPU受损。如果CPU的温度小于第一温度阈值,大于第二温度阈值,则降低CPU的频率,还可以在降低频率的同时降低CPU的电压。另外,还可以同时降低CPU的IO接口的功率和电压,增大风扇转速,提升散热,如果仍无法使温度有效的降低,还可以调整CPU中各核的电源域状态,将一些处于空闲状态的核的电源域调整为关闭状态,即将这些核关闭,使其不再运行产热。如果CPU的温度小于第三温度阈值,则可以提升CPU的频率,还可以在提升频率的同时提升CPU的电压,其中,第三温度阈值小于第二温度阈值。另外,如果在之前为了降温,将CPU中的一些核的电源调整为关闭状态,则此时可以再将这些核的电源域调整为开启状态,即将这些核重新开启。
根据CPU的使用率进行调节。
在上述获取到每个时钟域内的核的平均使用率后,如果该平均使用率大于第一使用率阈值,则可以提升该时钟域内的核的频率,还可以在提升频率的同时提升其电压。如果该平均使用率小于第二使用率阈值,则降低该时钟域内的核的频率,还可以在降低频率的同时降低其电压,其中,第一使用率阈值小于第二使用率阈值。
此处需要说明的是,上述提升或者降低CPU的频率,均可以通过调整CPU内各核对应的时钟域的锁相环电路(phase locked loop,PLL)来进行调节。在通过PLL来调节CPU的频率时,可以有以下几种模式。
模式一、快升慢降模式,即迅速提升频率,缓慢减低频率,这种模式可以保证CPU的性能。
模式二、慢升快降模式,即缓慢提升频率,快速减低频率,这种模式下可以有效节省CPU功耗。
在一种可能的实现方式中,可以基于CPU的所有性能参数,来综合决定如何对CPU的频率和电压进行调节,相应的,处理可以如下:将性能参数与CPU当前的频率和电压输入到预先训练的特征提取模型中,得到待分类特征数据。将待分类特征数据输入到预先训练的分类器模型中,得到CPU当前的业务分类;基于预先存储的业务分类和配置调整策略之间的对应关系,确定CPU当前的业务分类对应的配置调整策略,其中,配置调节策略中至少包括CPU的待使用频率和待使用电压。将CPU的频率和电压,分别调节为待使用频率和待使用电压。
其中,特征提取模型可以为长短期记忆(long short-term memory,LSTM)自编码器模型、循环神经网络(recurrent neural network,RNN)模型等,分类器模型可以为K最邻近(k-nearest neighbor,KNN)分类模型、多层感知器(multi-layer perception,MLP)分类模型等。
在实施中,技术人员可以预先建立特征提取模型和分类器模型,并对特征提取模型和分类器模型训练。在训练特征提取模型和分类器模型训练时,可以对两个模型同时训练。技术人员可以采集大量服务器中CPU运行时的性能参数和CPU的电压、频率,作为输入样本,即每组输入样本中至少包括有CPU运行时的性能参数和CPU的电压、频率。在获取到输入样本后,可以由人工对这些输入样本进行业务分类,例如,可以分为10个业务类型。每组输入样本对应的业务类型即为输出样本。这样每组输入样本核对应的输出样本,即可以组成一组训练样本。通过使用大量训练样本,对特征提取模型和分类器模型训练进行训练,不断调整特征提取模型和分类器模型的参数,以使其准确性更高,最后,可以得到训练后的特征提取模型和分类器模型。对于每个业务类型,技术人员可以对该业务类型对应的CPU运行时的性能参数和CPU的电压、频率,进行能效评分,将能效评分最高的一组中的CPU的电压、频率作为该业务类型对应的配置调整策略。然后,将每个业务类型与相应的配置调整策略的进行对应存储。这样,该配置调整策略即可以为CPU在相应的业务类型下的待使用频率和待使用电压。
IMU固件可以将周期性获取到的CPU的性能参数和CPU的电压、频率,输入到预先训练的特征提取模型和分类器模型中,得到对应的目标业务类型。然后,查询业务分类和配置调整策略之间的对应关系,得到目标业务类型对应的配置调整策略。在该配置调整策略中包括有CPU待使用频率和待使用电压。再然后,可以将CPU的频率调节为该待使用频率,将CPU的电压调节为待使用电压。
通过本申请实施例所提出的能耗管理的方法,IMU固件可以获取IMU PM执行通知,以开启IMU PM。通过直接获取CPU当前的性能参数,并根据获取到的性能参数对CPU的频率和电压进行调节,达到能耗管理的目的。在这一过程中无需OS获取性能参数,再通知IMU固件进行CPU的频率和电压的调节,减少了交互过程,使得频率和电压的调节更加高效。
本申请实施例还提供了一种能耗管理的设备,如图6所示,该设备可以包括有CPU610和存储器620,在存储器620中存储有启动固件,OS,IMU固件分别对应的多个程序指令,多个程序指令用于被所述CPU读取并执行实现启动固件、OS以及IMU固件的功能。其中,IMU固件可以用于执行能耗管理的方法。
在一种可能的实现方式中,CPU610可以为图2中的CPU,可见在该CPU中包括有IMU核和AP核,为了保证IMU核内的数据安全,可以在IMU核和AP核之间通过系统隔离墙SIW隔离。上述IMU固件的功能可以由该IMU核处理实现。
另外,需要说明的是,IMU固件在执行能耗管理的方法时,与上述各能耗管理的方法实施例中的具体实现方式相同,在此不做赘述。
以上所述仅为本申请一个实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种能耗管理的方法,其特征在于,用于电子设备的能耗管理,所述电子设备包括中央处理器CPU,存储器;所述存储器中存储有启动固件,操作系统OS以及智能管理单元IMU固件分别对应的多个程序指令,所述多个程序指令用于被所述CPU读取并执行以实现所述启动固件、所述OS以及所述IMU固件的功能,其中,所述能耗管理的方法由所述IMU固件执行,包括:
    在操作系统OS运行之前,获取智能管理单元能耗管理IMU PM执行通知,其中,所述IMU PM执行通知是由启动固件在所述OS运行之前、确定由所述IMU固件执行能耗管理PM后发送的,所述启动固件还用于在所述OS运行之前阻止所述OS执行操作系统能耗管理OS PM;
    在根据所述IMU PM执行通知确定由IMU固件对CPU执行PM后,获取所述CPU当前的性能参数,其中,所述性能参数包括所述CPU的功耗、温度和使用率中的一种或多种;
    基于所述性能参数,对所述CPU进行能耗管理。
  2. 根据权利要求1所述的方法,其特征在于,所述IMU PM执行通知为IMU PM执行指令,所述获取IMU PM的执行通知包括:
    接收所述启动固件发送的所述IMU PM执行指令。
  3. 根据权利要求1所述的方法,其特征在于,所述IMU PM执行通知为在预设存储地址中的第一预设数据,所述获取IMU PM的执行通知包括:
    通过轮询所述预设存储地址,获取所述第一预设数据。
  4. 根据权利要求2或3中的任一项所述的方法,其特征在于,所述启动固件用于通过如下方法在所述OS运行之前阻止所述OS执行操作系统能耗管理OS PM:
    创建第一高级配置和电源接口ACPI表,并将所述第一ACPI表上报至OS,其中,所述第一ACPI表中不包括性能状态表,以阻止所述OS执行OS PM,所述性能状态表为性能支持状态PSS表或连续性能控制CPC表。
  5. 根据权利要求2或3中任一项所述的方法,其特征在于,所述启动固件用于通过如下方法在所述OS运行之前阻止所述OS执行操作系统能耗管理OS PM:
    创建第二ACPI表,并将所述第二ACPI表上报至OS,其中,所述第二ACPI表中包括性能状态表,所述第二ACPI表中包括的性能状态表中的频率可调值为相同的预设数值,或者,所述第二ACPI表中包括的性能状态表的表头为范围未定义的值,以阻止所述OS执行OS PM。
  6. 根据权利要求2所述的方法,其特征在于,所述方法还包括:当所述启动固件在所述OS运行之前、确定由所述OS执行PM后时,所述启动固件执行如下操作:
    创建第三ACPI表,向所述OS发送所述第三ACPI表,其中,所述第三ACPI中包括性能状态表,所述第三ACPI表中包括的性能状态表中的频率可调值为所述CPU支持的预设频率可调值,以使所述OS执行OS PM;
    向所述IMU固件发送IMU PM关闭指令;
    所述IMU固件还执行如下操作:
    接收所述启动固件发送的所述IMU PM关闭指令,关闭IMU PM。
  7. 根据权利要求3所述的方法,其特征在于,所述方法还包括:当所述启动固件在所述OS运行之前、确定由所述OS执行PM后时,所述启动固件执行如下操作:
    创建第三ACPI表,向所述OS发送所述第三ACPI表;
    在预设存储地址中写入第二预设数据;
    所述IMU固件还执行如下操作:
    通过轮询所述预设存储地址,获取所述第二预设数据,关闭IMU PM。
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述启动固件为基本输入输出系统BIOS固件或者统一的可扩展固件接口UEFI固件。
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
    将所述性能参数与所述CPU当前的频率和电压输入到预先训练的特征提取模型中,得到待分类特征数据;
    将所述待分类特征数据输入到预先训练的分类器模型中,得到目标业务类型;
    基于预先存储的业务类型和配置调整策略之间的对应关系,确定所述目标业务类型对应的配置调整策略,其中,所述配置调节策略中至少包括所述CPU的待使用频率和待使用电压;
    将所述CPU的频率和电压,分别调节为所述待使用频率和所述待使用电压。
  10. 一种能耗管理的方法,其特征在于,用于电子设备的能耗管理,所述电子设备包括中央处理器CPU,存储器;所述存储器中存储有启动固件,操作系统OS以及智能管理单元IMU固件分别对应的多个程序指令,所述多个程序指令用于被所述CPU读取并执行以实现所述固件、所述OS以及所述IMU固件的功能,其中,所述能耗管理方法由所述IMU固件执行,包括:
    在所述OS运行过程中,接收带外管理系统发送的用于通知所述IMU固件执行IMU PM的第一通知消息;
    根据所述第一通知消息与所述OS进行交互,使得所述OS不再负责能耗管理;
    获取所述CPU当前的性能参数,其中,所述性能参数包括所述CPU的功耗、温度和使用率中的一种或多种;
    基于所述性能参数,对所述CPU进行能耗管理。
  11. 根据权利要求10所述方法,其特征在于,所述根据所述第一通知消息与所述OS进 行交互,使得所述OS不再负责能耗管理,包括:
    在接收到所述第一通知消息后,如果接收到所述OS发送的第一能耗管理请求,则不根据所述第一能耗管理请求执行能耗管理,并向所述OS返回预设消息,使得所述OS不再负责所述能耗管理。
  12. 根据权利要求10所述方法,其特征在于,所述根据所述第一通知消息与所述OS进行交互,包括:
    在接收到所述第一通知消息后,获取第四高级配置和电源接口ACPI表,对所述第四ACPI表进行更新,得到第四更新ACPI表;
    向所述OS发送第四ACPI表更新消息,其中,所述第四ACPI表更新消息用于指示所述OS获取所述第四更新ACPI表,以使所述OS基于所述第四更新ACPI表关闭OS PM。
  13. 根据权利要求12所述的方法,其特征在于,所述对所述第四ACPI表进行更新,包括:
    将所述第四ACPI表中包括的性能状态表移除,其中,所述性能状态表为PSS表或CPC表;
    或者,将所述第四ACPI表中包括的性能状态表中的频率可调值调整为相同的预设数值;
    或者,将所述第四ACPI表中包括的性能状态表的表头修改为范围未定义的值。
  14. 根据权利要求10所述的方法,其特征在于,所述IMU固件还执行如下操作:
    在操作系统OS运行过程中,接收所述带外管理系统发送的用于通知所述IMU固件开启OS PM的第二通知消息;
    如果当前所述OS负责能耗管理,则不再对所述第二通知消息进行处理;
    如果当前所述OS不负责能耗管理,则根据所述第二通知消息与所述OS进行交互,使得所述OS负责能耗管理。
  15. 根据权利要求14所述的方法,其特征在于,所述根据所述第二通知消息与所述OS进行交互,使得所述OS负责能耗管理,包括:
    在接收到所述OS发送的第二能耗管理请求后,执行所述第二能耗管理请求。
  16. 根据权利要求14所述的方法,其特征在于,所述根据所述第二通知消息与所述OS进行交互,使得所述OS负责能耗管理,包括:
    获取第五ACPI表,对所述第五ACPI表进行更新,得到第五更新ACPI表;
    向所述OS发送第五ACPI表更新消息,其中,所述第五ACPI表更新消息用于指示所述OS获取所述第五更新ACPI表,以使所述OS根据所述第五更新ACPI表开启操作系统能耗管理OS PM。
  17. 根据权利要求16所述的方法,其特征在于,所述对所述第五ACPI表进行更新,包括:
    如果所述第五ACPI表中不包括性能状态表,则在所述第五ACPI表中添加性能状态表;
    如果所述第五ACPI表中包括有性能状态表,则将所述第五ACPI表中包括的性能状态表中的频率可调值调整为所述CPU支持的预设频率可调值。
  18. 根据权利要求10-17中任一项所述的方法,其特征在于,所述基于所述性能参数,对所述CPU进行能耗管理,包括:
    将所述性能参数与所述CPU当前的频率和电压输入到预先训练的特征提取模型中,得到待分类特征数据;
    将所述待分类特征数据输入到预先训练的分类器模型中,得到目标业务类型;
    基于预先存储的业务类型和配置调整策略之间的对应关系,确定所述目标业务类型对应的配置调整策略,其中,所述配置调节策略中至少包括所述CPU的待使用频率和待使用电压;
    将所述CPU的频率和电压,分别调节为所述待使用频率和所述待使用电压。
  19. 一种能耗管理的设备,其特征在于,所述设备包括CPU,存储器,所述存储器中存储有启动固件,操作系统OS以及智能管理单元IMU固件分别对应的多个程序指令,所述多个程序指令用于被所述CPU读取并执行以实现所述启动固件、所述OS以及所述IMU固件的功能;
    其中,所述IMU固件,用于执行权利要求1-9或10-18中任一项所述的能耗管理的方法。
  20. 如权利要求19所述的设备,其特征在于,所述CPU包括IMU核以及业务处理AP核,其中,所述AP核与所述IMU核通过系统隔离墙SIW隔离;
    所述IMU固件的功能由所述IMU核处理。
PCT/CN2020/122459 2019-10-22 2020-10-21 能耗管理的方法和设备 WO2021078144A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20878976.8A EP4033332A4 (en) 2019-10-22 2020-10-21 POWER MANAGEMENT METHOD AND DEVICE
US17/727,686 US20220244772A1 (en) 2019-10-22 2022-04-22 Power management method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911007882.3 2019-10-22
CN201911007882.3A CN112698712B (zh) 2019-10-22 2019-10-22 能耗管理的方法和设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/727,686 Continuation US20220244772A1 (en) 2019-10-22 2022-04-22 Power management method and device

Publications (1)

Publication Number Publication Date
WO2021078144A1 true WO2021078144A1 (zh) 2021-04-29

Family

ID=75504971

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/122459 WO2021078144A1 (zh) 2019-10-22 2020-10-21 能耗管理的方法和设备

Country Status (4)

Country Link
US (1) US20220244772A1 (zh)
EP (1) EP4033332A4 (zh)
CN (1) CN112698712B (zh)
WO (1) WO2021078144A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113625861B (zh) * 2021-08-27 2024-04-19 深圳供电局有限公司 一种功耗节约方法及系统
CN116301095B (zh) * 2022-12-23 2024-03-19 摩尔线程智能科技(北京)有限责任公司 Gpu的温度控制方法、装置、设备、介质和程序产品
CN115981448A (zh) * 2022-12-23 2023-04-18 摩尔线程智能科技(北京)有限责任公司 Gpu的功耗控制方法、装置、设备、介质和程序产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477403A (zh) * 2009-01-22 2009-07-08 浪潮电子信息产业股份有限公司 一种系统功耗自动控制方法
CN103488532A (zh) * 2013-09-02 2014-01-01 华为技术有限公司 一种调整处理器频率的方法和设备
CN105677000A (zh) * 2016-02-14 2016-06-15 华为技术有限公司 动态电压频率调整的系统及方法
US20170031425A1 (en) * 2015-07-31 2017-02-02 Hon Hai Precision Industry Co., Ltd. Power consumption management device, system and method thereof
US20180210532A1 (en) * 2017-01-20 2018-07-26 Alibaba Group Holdiing Limited Method and Apparatus for Implementing Heterogeneous Frequency Operation and Scheduling Task of Heterogeneous Frequency CPU
CN108803860A (zh) * 2018-06-26 2018-11-13 联想(北京)有限公司 一种功耗调节方法及电子设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032116B2 (en) * 2001-12-21 2006-04-18 Intel Corporation Thermal management for computer systems running legacy or thermal management operating systems
US7089430B2 (en) * 2001-12-21 2006-08-08 Intel Corporation Managing multiple processor performance states
US7577860B2 (en) * 2006-01-09 2009-08-18 Microsoft Corporation Processor specific BIOS interface for power management
CN101093446B (zh) * 2006-06-21 2011-06-22 鸿富锦精密工业(深圳)有限公司 操作系统引导装置、方法及其应用的电脑系统
US8315746B2 (en) * 2008-05-30 2012-11-20 Apple Inc. Thermal management techniques in an electronic device
US9477627B2 (en) * 2012-12-26 2016-10-25 Intel Corporation Interconnect to communicate information uni-directionally
US11307907B2 (en) * 2020-02-03 2022-04-19 Dell Products L.P. Information handling system and method to automatically synchronize operating system and boot firmware languages

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477403A (zh) * 2009-01-22 2009-07-08 浪潮电子信息产业股份有限公司 一种系统功耗自动控制方法
CN103488532A (zh) * 2013-09-02 2014-01-01 华为技术有限公司 一种调整处理器频率的方法和设备
US20170031425A1 (en) * 2015-07-31 2017-02-02 Hon Hai Precision Industry Co., Ltd. Power consumption management device, system and method thereof
CN105677000A (zh) * 2016-02-14 2016-06-15 华为技术有限公司 动态电压频率调整的系统及方法
US20180210532A1 (en) * 2017-01-20 2018-07-26 Alibaba Group Holdiing Limited Method and Apparatus for Implementing Heterogeneous Frequency Operation and Scheduling Task of Heterogeneous Frequency CPU
CN108803860A (zh) * 2018-06-26 2018-11-13 联想(北京)有限公司 一种功耗调节方法及电子设备

Also Published As

Publication number Publication date
CN112698712A (zh) 2021-04-23
EP4033332A4 (en) 2022-12-07
CN112698712B (zh) 2022-12-06
US20220244772A1 (en) 2022-08-04
EP4033332A1 (en) 2022-07-27

Similar Documents

Publication Publication Date Title
WO2021078144A1 (zh) 能耗管理的方法和设备
US9715397B2 (en) Methods and apparatuses for controlling thread contention
US10509456B2 (en) Server rack power management
US10146288B2 (en) Adaptive power consumption management in smart devices
US9618997B2 (en) Controlling a turbo mode frequency of a processor
JP5707321B2 (ja) スリーププロセッサ
WO2016101099A1 (en) Techniques for power management associated with processing received packets at a network device
US8677160B2 (en) Managing power consumption of a computer
US9274585B2 (en) Combined dynamic and static power and performance optimization on data centers
WO2013127151A1 (zh) 功耗封顶的控制方法、设备和系统
JP6263995B2 (ja) 情報処理システム、管理装置、情報処理システムの制御方法及び管理装置の制御プログラム
WO2014143674A1 (en) Controlling power supply unit power consumption during idle state
CN101833366B (zh) 一种机群作业管理系统中低功耗的动态结点控制方法
CN104407896A (zh) 一种简化计算机系统bios功能选项配置的方法
CN113360344B (zh) 一种服务器监控方法、装置、设备及计算机可读存储介质
Li et al. An efficient approach for reducing power consumption in a production-run cluster
CN114327017A (zh) 一种服务器控制方法、装置及服务器
CN117666750B (zh) 电源能耗的调整方法及装置
CN117666750A (zh) 电源能耗的调整方法及装置
CN117251043A (zh) 基于osi的动态电源管理方法及系统
CN114327883A (zh) 一种频率调控方法、装置、电子设备及介质
CN111858460A (zh) 一种fpga异构计算平台的控制方法及相关组件
CN102118407A (zh) 一种降低集群作业系统运行功耗的方法、节点及系统

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: 20878976

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020878976

Country of ref document: EP

Effective date: 20220422