WO2014032477A1 - 一种多核中央处理器的调控方法及系统 - Google Patents

一种多核中央处理器的调控方法及系统 Download PDF

Info

Publication number
WO2014032477A1
WO2014032477A1 PCT/CN2013/078790 CN2013078790W WO2014032477A1 WO 2014032477 A1 WO2014032477 A1 WO 2014032477A1 CN 2013078790 W CN2013078790 W CN 2013078790W WO 2014032477 A1 WO2014032477 A1 WO 2014032477A1
Authority
WO
WIPO (PCT)
Prior art keywords
cpu
core
regulation mode
cpu core
processing unit
Prior art date
Application number
PCT/CN2013/078790
Other languages
English (en)
French (fr)
Inventor
刘炼
王玉婷
仵小勇
钟祥君
Original Assignee
惠州Tcl移动通信有限公司
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 惠州Tcl移动通信有限公司 filed Critical 惠州Tcl移动通信有限公司
Priority to EP13833832.2A priority Critical patent/EP2891980A4/en
Priority to US14/398,351 priority patent/US9600330B2/en
Publication of WO2014032477A1 publication Critical patent/WO2014032477A1/zh

Links

Images

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • 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/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/329Power saving characterised by the action undertaken by task scheduling
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5094Allocation of resources, e.g. of the central processing unit [CPU] where the allocation takes into account power or heat criteria
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the invention relates to the field of computers, in particular to a multi-core central processing unit (Central Processing) Unit, CPU) control method and system.
  • Central Processing Central Processing Unit
  • Android Android
  • tablet PCs have become a trend in the use of dual-core, quad-core processors. Because multi-core CPUs have certain advantages in processing power, multi-core CPUs are increasingly used on mobile devices. widely. However, while multi-core CPUs bring certain performance improvements to mobile devices, they also make the bottleneck of mobile devices more prominent.
  • Android system multi-core smartphones generally schedule task processes to multiple cores of multi-core CPUs according to the "load balancing mechanism". But under the "load balancing mechanism", even if the mobile phone is idle or low-powered, multi-core The multi-core of the CPU is always running, which makes a lot of power that is already scarce. In the case of idle and low power, the user may think more about how to save power, rather than improve the performance of the mobile phone; when the mobile phone has sufficient power, the user may want to use the processing power of the multi-core CPU to improve the performance of the mobile phone, but the current mobile The device cannot regulate the CPU of the multi-core CPU according to the needs of the user.
  • the purpose of the embodiments of the present invention is to provide a method and system for controlling a multi-core CPU, which aims to solve the problem that the multi-core CPU cannot be adjusted according to actual needs of the user in the prior art.
  • a multi-core central processing unit Central Processing a method for controlling a unit, the CPU, includes: receiving an operation instruction related to the multi-core CPU; and responding to the operation instruction, adjusting, by using a bottom core interface, a CPU core of the multi-core CPU according to a preset CPU regulation mode,
  • the CPU regulation mode includes at least one of adjusting a number of opening of the CPU core, adjusting an operating frequency of the CPU core, and a process of migrating the CPU core; and calling the multi-core CPU
  • the subsystem controls switching, frequency modulation, and process migration of the CPU core of the multi-core CPU.
  • the CPU regulation mode includes at least a first regulation mode and a second regulation mode; the first regulation mode corresponds to at least one of the multi-core CPUs, and the CPU core is turned on and running. a high frequency state; the second control mode corresponds to one of the multi-core CPUs being turned on and running in a low frequency state; wherein, when the CPU regulation mode is the first regulation mode, the method further The method includes: recording the number of the CPU cores used by the process and the time when the process uses the CPU core; and migrating the high-frequency process to the idle CPU core for processing, and adjusting the idle CPU core to a high frequency The operating state; wherein, when the CPU regulation mode is the second regulation mode, the method further comprises: recording a process using the number of CPU cores and a time when the process uses the CPU core; and The CPU core is shut down, a CPU core is reserved for operation, and the running CPU core is down-converted.
  • the CPU regulation mode further includes a third regulation mode; when the CPU regulation mode is the third regulation mode, the method further includes: acquiring the device every predetermined time The operating state information of the CPU core of the multi-core CPU; when the occupancy rate of the CPU core of the multi-core CPU is less than a first predetermined value, one of the CPU cores is reserved to run and the other CPU cores are closed, and The running CPU core performs frequency down processing; when the running CPU core occupancy rate is greater than a second predetermined value, all CPU cores are turned on; and the CPU core of the multi-core CPU is caused by a migration process The occupancy rate is balanced.
  • the calling the multi-core CPU includes: calling an underlying function or communicating with the underlying core through a socket mechanism; obtaining an opening for adjusting the CPU core a quantity, a running frequency of the CPU core, and a function of process migration; and controlling switching, frequency modulation, and process migration of the CPU core of the multi-core CPU by the function.
  • a method for controlling a multi-core CPU includes: receiving an operation instruction related to regulating the multi-core CPU; and responding to the operation instruction, and using a bottom core interface to a CPU core of the multi-core CPU according to a preset CPU regulation mode Carry out regulation.
  • the CPU regulation mode includes at least one of adjusting a number of opening of the CPU core, adjusting an operating frequency of the CPU core, and a process of migrating the CPU core.
  • the CPU regulation mode includes at least a first regulation mode and a second regulation mode; the first regulation mode corresponds to at least one of the multi-core CPUs, and the CPU core is turned on and running. a high frequency state; the second regulation mode corresponds to one of the multi-core CPUs being turned on and running in a low frequency state.
  • the method further includes: recording a process using the number of CPU cores and a time when the process uses the CPU core; And migrating the high-frequency process to the idle CPU core for processing, and adjusting the idle CPU core to a high-frequency operation state.
  • the method further includes: recording a process using the number of CPU cores and a time when the process uses the CPU core; And shutting down the idle CPU core, keeping a CPU core running, and down-clocking the running CPU core.
  • the CPU regulation mode further includes a third regulation mode; when the CPU regulation mode is the third regulation mode, the method further includes: acquiring the device every predetermined time The operating state information of the CPU core of the multi-core CPU; when the occupancy rate of the CPU core of the multi-core CPU is less than a first predetermined value, one of the CPU cores is reserved to run and the other CPU cores are closed, and The running CPU core performs frequency down processing; when the running CPU core occupancy rate is greater than a second predetermined value, all CPU cores are turned on; and the CPU core of the multi-core CPU is caused by a migration process The occupancy rate is balanced.
  • the method for regulating the multi-core central processing unit further includes: calling the multi-core CPU
  • the subsystem controls switching, frequency modulation, and process migration of the CPU core of the multi-core CPU.
  • the calling the multi-core CPU includes: calling an underlying function or communicating with the underlying core through a socket mechanism; obtaining an opening for adjusting the CPU core a quantity, a running frequency of the CPU core, and a function of process migration; and controlling switching, frequency modulation, and process migration of the CPU core of the multi-core CPU by the function.
  • a control system for a multi-core CPU includes: an operation command receiving module for receiving an operation instruction related to regulating the multi-core CPU; and a regulation module for responding to the operation instruction according to a preset CPU
  • the regulation mode regulates the CPU core of the multi-core CPU through the underlying core interface.
  • the CPU control mode includes at least one of adjusting a number of opening of the CPU core, adjusting an operating frequency of the CPU core, and a process of migrating the CPU core.
  • the CPU regulation mode includes at least a first regulation mode and a second regulation mode; the first regulation mode corresponds to at least one of the multi-core CPUs, and the CPU core is turned on and running. a high frequency state; the second regulation mode corresponds to one of the multi-core CPUs being turned on and running in a low frequency state.
  • the control module when the CPU control mode is the first control mode, the control module is configured to record the number of processes used by the process and the time when the process uses the CPU core. And for processing the high frequency process to the idle CPU core for processing, and for adjusting the idle CPU core to a high frequency operation state.
  • the control module when the CPU control mode is the second control mode, the control module is used to record the number of processes used by the process and the time when the process uses the CPU core. And for shutting down an idle CPU core and retaining a CPU core operation, and for performing frequency down processing on the running CPU core.
  • the CPU regulation mode further includes a third regulation mode; when the CPU regulation mode is the third regulation mode, the control module is configured to acquire the device every predetermined time.
  • Running state information of the CPU core of the multi-core CPU and when the occupancy rate of the CPU core of the multi-core CPU is less than a first predetermined value, retaining one of the CPU cores to run and shutting down other CPU cores, And performing a down-conversion process on the running CPU core; and the control module is further configured to: when the occupancy rate of the running CPU core is greater than a second predetermined value, open all CPU cores, and serve to pass The migration process balances the occupancy of the CPU core of the multi-core CPU.
  • control module is used to call the multi-core CPU
  • the subsystem controls switching, frequency modulation, and process migration of the CPU core of the multi-core CPU.
  • control module includes: a local service module, configured to call an underlying function or communicate with the underlying core through a socket mechanism; and an acquisition module for acquiring the adjustment a function of the number of CPU cores to be turned on, the operating frequency of the CPU core, and a process migration; and a control module for controlling switching, frequency modulation, and process migration of the CPU core of the multi-core CPU by the function.
  • FIG. 1 is a flowchart of a method for regulating a multi-core CPU according to an embodiment of the present invention.
  • FIG. 2 is a flow chart of the method of FIG. 1 in a third mode of regulation.
  • FIG. 3 is a flow chart of the implementation of the method shown in FIG. 1.
  • FIG. 4 is a structural block diagram of a control system of a multi-core CPU according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a control module of the system shown in FIG.
  • the embodiments of the present invention provide a method and system for controlling a multi-core CPU. To further clarify and clarify the objects, technical solutions, and effects of the present invention, the present invention will be further described in detail below. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
  • the multi-core CPU in the embodiment of the present invention refers to a CPU having at least two cores, such as a dual-core CPU, a three-core CPU, a quad-core CPU, and the like.
  • computing systems, environments, and configurations that are well known for use with embodiments of the present invention may include, but are not limited to, tablets, mobile phones, personal computers, servers, multi-processor systems, microcomputer-based systems, main architectures A computer, and a distributed computing environment, including any of the above systems or devices.
  • module or "unit” as used herein may be referred to as a software object or exemplification executed on the computing system.
  • the various components, modules, engines, and services described herein can be implemented as objects or processes executing on the computing system. While the systems and methods described herein are preferably implemented as software, implementation in software and hardware or hardware is also possible and contemplated.
  • the method and system for adjusting the multi-core CPU of the embodiment of the present invention may be run in a computer/mobile device, and the computer may be a combination of one or more of a personal computer, a server, etc., and the mobile device may be Tablet, mobile phone, PDA (Personal Digital A system in which one or more of Assistant, personal digital assistant, notebook computer, and the like are combined.
  • the computer/mobile device can include any combination of a processor, a memory, a sensor, a switching device, a power supply, a clock signal generator, an input and output device, and the like.
  • any combination of a processor, a memory, a sensor, a switching device, a power supply, a clock signal generator, an input/output device, and the like in the above computer/mobile device for implementing the steps and multi-core in the method for controlling the multi-core CPU of the embodiment of the present invention
  • the function of the CPU's control system for implementing the steps and multi-core in the method for controlling the multi-core CPU of the embodiment of the present invention The function of the CPU's control system.
  • the software program instructions corresponding to the control system of the multi-core CPU are stored in the memory and executed by the processor to implement process management in the operating system.
  • the above-mentioned memory computer readable storage medium which may be a magnetic disk, an optical disk, or a read-only storage memory (Read-Only) Memory, ROM) or Random Access Memory (RAM).
  • FIG. 1 is a flowchart of a preferred embodiment of a method for controlling a multi-core CPU according to an embodiment of the present invention. As shown in the figure, the method includes:
  • the preset CPU control mode is generated by: setting a CPU control mode for adjusting the number of open of the CPU core, the running frequency of the CPU core, and process migration, where the CPU control mode includes a predefined Regulatory mode and automatic control mode.
  • the CPU regulation mode includes at least one of adjusting a number of opening of the CPU core, adjusting an operating frequency of the CPU core, and a process of migrating the CPU core.
  • the CPU regulation mode includes at least a first regulation mode and a second regulation mode; the first regulation mode corresponds to at least one CPU core of the multi-core CPU being turned on and operating in a high frequency state; One of the CPU cores in the multi-core CPU is turned on and operates in a low frequency state.
  • the CPU control mode in the embodiment of the present invention can be divided into two major categories, namely, a predefined control mode and an automatic control mode, and the predefined control mode can be further subdivided into a performance optimal mode and a power saving mode, and the performance is performed.
  • the best mode corresponds to the first control mode
  • the power saving mode corresponds to the second control mode, that is, the best performance mode is that the CPU core of the multi-core CPU is turned on and runs in a high frequency state
  • the power saving mode is A CPU core for a multi-core CPU is turned on and running in a low frequency state.
  • the user's mobile device has sufficient power or can be charged, the user may wish to experience some large games or frequently perform online operations using the mobile device, and pay more attention to the mobile device during the user's operation or game experience on the mobile device.
  • the performance of the present invention provides an optimal mode of performance for a multi-core CPU to keep the mobile device operating at optimal performance.
  • the method when the CPU regulation mode is the first regulation mode, the method further includes: recording the number of the CPU cores used by the process and the time when the process uses the CPU core, and the high frequency The secondary process migrates to the idle CPU core for processing, and adjusts the idle CPU core to a high-frequency operating state.
  • the CPU regulation mode is the second regulation mode, the method further includes: recording the number of the CPU cores and the time when the process uses the CPU core, shutting down the idle CPU core, and retaining one CPU The core runs and down-clocks the CPU core in operation.
  • the multi-core CPU architecture can be used to record the number of CPU cores used by the process and to use the subsystem CPUACCT (the node system that generates the CPU usage status report in Cgroups) to record the process usage.
  • the embodiment of the present invention provides a power saving mode to turn off the idle CPU core. And the CPU core being used is down-converted to achieve power saving.
  • the embodiment of the present invention can also implement process management through a multi-core CPU architecture, such as recording the number of CPU cores used by the process and using the CPUACCT subsystem to record the time of the CPU core used by the process, according to the CPU core used.
  • process management through a multi-core CPU architecture, such as recording the number of CPU cores used by the process and using the CPUACCT subsystem to record the time of the CPU core used by the process, according to the CPU core used.
  • the number and the time of the CPU core to close the idle CPU core keep a CPU core running, and down-convert the running CPU core within an acceptable range, and finally realize that the mobile device is used in the power saving mode.
  • the user's mobile device is not in a power-deficient state and can operate normally, the user may want the mobile device to implement automatic control of the CPU core according to a specific situation, for example, by a specific event trigger. According to this situation, the present invention is implemented.
  • the example provides an automatic control mode to enable the mobile device to regulate the operation of the CPU core according to its own usage.
  • the CPU control mode further includes a third control mode; when the CPU control mode is the third control mode, the method further includes:
  • the above first predetermined value may be in the range of 1% to 50%, for example: 22%, 35%, 43%, 50%, and the like.
  • the second predetermined value may be in the range of 50% to 99%, for example: 61%, 77%, 89%, 92%, and the like.
  • the CPU core running state information of the multi-core CPU is acquired every predetermined time; in this step, the bottom layer is actively reported to each CPU core of the multi-core CPU by the CPUACCT subsystem every predetermined time.
  • the status information is then reported by the socket (socket) message and is obtained by an automatic control system.
  • the automatic control system can automatically send the control command according to the running status information of the multi-core CPU.
  • the CPU core occupancy rate of the multi-core CPU is less than 20%
  • the redundant CPU core is turned off to reserve a CPU core, and the running CPU core is down-converted; when the CPU core occupancy rate of the multi-core CPU is Under 20%, the CPU core subsystem can be used to shut down the idle CPU core, leaving only one CPU core running.
  • the embodiment of the present invention mainly encapsulates the Cgroups (a mechanism for limiting, isolating, recording physical resources used by the Linux kernel, physical resources including CPU, I/O ports, etc.) through the underlying core interface, and invoking the same.
  • the subsystem CPUSET realizes switching, frequency modulation and process migration control of the CPU core of the multi-core CPU.
  • the method further includes: by calling the multi-core CPU
  • the subsystem CPUSET controls the switching, frequency modulation and process migration of the CPU core of the multi-core CPU.
  • the subsystem CPUSET controls the switching, frequency modulation and process migration of the CPU core of the multi-core CPU, including:
  • the method of the embodiment of the present invention may include the following steps:
  • Deamon service providing a function for adjusting the number of CPU cores to be turned on, the running frequency of the CPU core, and the process migration through the Deamon service; the purpose of this step is to complete the Native by using the Framework.
  • Service and JAVA API Application Programming Interface, application programming interface
  • direct connection work thus complete the call to the Deamon service through inter-process communication, and then provide for the upper layer such as opencpu, closecpu, etc. (opencpu, closecpu, etc. are custom function names, provide open and close CPU Core)
  • JNI interface functions A series of JNI interface functions.
  • the switching, frequency modulation, and process migration control of the CPU core of the multi-core CPU is implemented by the functions for adjusting the number of CPU cores to be turned on, the operating frequency of the CPU core, and the process migration.
  • This step is to use the API to provide the JNI interface for the upper layer, complete the CPUControl class (the CPUControl class is a custom class name), and implement it for Android.
  • the apk program uses a series of API interfaces to implement functions such as turning on the CPU core, turning off the CPU core, adjusting the CPU frequency, and process migration.
  • the embodiment of the present invention further provides a multi-core CPU control system, as shown in FIG. 4, including:
  • the operation instruction receiving module 100 is configured to receive an operation instruction related to the regulation of the multi-core CPU
  • the control module 200 is configured to, in response to the operation instruction, adjust the CPU core of the multi-core CPU through an underlying core interface according to a preset CPU regulation mode.
  • the CPU regulation mode includes at least one of adjusting a number of opening of the CPU core, adjusting an operating frequency of the CPU core, and a process of migrating the CPU core.
  • the CPU regulation mode includes at least a first regulation mode and a second regulation mode; the first regulation mode corresponds to at least one CPU core of the multi-core CPU being turned on and operating in a high frequency state; One of the CPU cores in the multi-core CPU is turned on and operates in a low frequency state.
  • the regulation module 200 when the CPU regulation mode is the first regulation mode, the regulation module 200 is configured to record the number of the CPU cores used by the process and the time of the CPU core used by the process. And for processing the high frequency process to the idle CPU core for processing, and for adjusting the idle CPU core to a high frequency operation state.
  • the regulation module 200 when the CPU regulation mode is the second regulation mode, the regulation module 200 is configured to record the number of the CPU cores used by the process and the time of the CPU core used by the process. And for shutting down an idle CPU core and retaining a CPU core operation, and for performing frequency down processing on the running CPU core.
  • the CPU regulation mode further includes a third regulation mode; when the CPU regulation mode is the third regulation mode, the regulation module 200 is configured to acquire the multicore every predetermined time.
  • Running state information of the CPU core of the CPU and when the occupancy rate of the CPU core of the multi-core CPU is less than a first predetermined value, retaining one of the CPU cores to run and shutting down other CPU cores, and The running CPU core performs frequency-down processing; the control module 200 is further configured to: when the occupancy rate of the running CPU core is greater than a second predetermined value, open all CPU cores, and The occupancy of the CPU core of the multi-core CPU is balanced.
  • control module 200 is configured to invoke the multi-core CPU
  • the subsystem CPUSET controls the switching, frequency modulation and process migration of the CPU core of the multi-core CPU.
  • the control module 200 includes: a local service module 230, configured to call an underlying function or communicate with the underlying core through a socket mechanism; and an obtaining module 220, configured to acquire an open quantity for adjusting the CPU core, the CPU core The running frequency and the function of the process migration; the control module 210 is configured to control switching, frequency modulation and process migration of the CPU core of the multi-core CPU by using the function.
  • control module 200 includes an underlying core interface module 240 for encapsulating a Cgroups interface and calling a multi-core CPU.
  • the subsystem CPUSET implements the switching, frequency modulation and process migration control of the CPU core for the multi-core CPU.
  • the local service module 230 is further configured to set a system service for invoking an underlying function or communicating with the underlying core through a socket mechanism.
  • the framework module is configured to invoke a system service, and the system service provides a function for adjusting the number of CPU cores to be turned on, the running frequency of the CPU core, and the process migration.
  • the API module is configured to implement switching, frequency modulation, and process migration control of the CPU core of the multi-core CPU by using the function for adjusting the number of CPU cores to be turned on, the operating frequency of the CPU core, and the process migration.
  • control method and system of the multi-core CPU of the present invention provides a predefined control mode and an automatic adjustment mode of the multi-core CPU for the specific usage and performance requirements of the user's mobile device, so that the mobile device maintains when the power is sufficient. It runs in the best performance state and keeps running in power saving mode when the battery is low.
  • the user can also set the automatic adjustment mode, so that the mobile device can automatically adjust the CPU's switching, frequency modulation and process according to the usage of its CPU.
  • the migration function by the user of the mobile device, can select input commands in different scenarios to control the working state of each CPU core of the multi-core CPU, improve the processing capability of the multi-core CPU, or achieve the purpose of energy saving.

Abstract

提供了一种多核中央处理器的调控方法及系统,其中,所述调控方法包括:接收与调控多核CPU相关的操作指令(S101);响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控(S102)。可以调控多核中央处理器的每个CPU核的工作状态,提高多核中央处理器的工作效率和节能省电。

Description

一种多核中央处理器的调控方法及系统 技术领域
本发明涉及计算机领域,尤其涉及一种多核中央处理器(Central Processing Unit,CPU)的调控方法及系统。
背景技术
安卓(Android)系统智能手机以及平板电脑等移动设备使用双核、四核处理器已经成为一种趋势,由于多核CPU在处理能力有着一定的优势,所以多核CPU在移动设备上的应用也越来越广泛。然而多核CPU为移动设备带来一定性能提升的同时,也使得移动设备在电能方面的瓶颈更为突出。
目前,Android系统多核智能手机一般是根据“负载均衡机制”来调度任务进程至多核CPU的多个核心。但是该“负载均衡机制”下,即使是手机处于空闲或者低电状态,多核 CPU的多核心始终处于运行状态,这使得本来就显得稀缺的电能被大量浪费。在手机空闲和低电的情况下用户可能更多的考虑如何省电,而非手机性能的提高;在手机电能充足时,用户则可能希望利用多核CPU的处理能力提高手机性能,但目前的移动设备都无法根据用户的需求对多核CPU的CPU进行调控。
因此,现有技术还有待于改进和发展。
技术问题
鉴于上述现有技术的不足,本发明实施例的目的在于提供一种多核CPU的调控方法及系统,旨在解决现有技术中多核CPU无法根据用户的实际需要进行调控的问题。
技术解决方案
一种多核中央处理器(Central Processing Unit,CPU)的调控方法,包括:接收与调控所述多核CPU相关的操作指令;响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控,所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者;以及通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
上述多核中央处理器的调控方法中,所述CPU调控模式至少包括第一调控模式和第二调控模式;所述第一调控模式对应所述多核CPU中的至少一个所述CPU核打开并运行在高频状态;所述第二调控模式对应所述多核CPU中的一个所述CPU核打开并运行在低频状态;其中,当所述CPU调控模式为所述第一调控模式时,所述方法还包括:记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及将高频次的进程迁移至空闲的CPU核进行处理,并将所述空闲的CPU核调整为高频次的运行状态;其中,当所述CPU调控模式为所述第二调控模式时,所述方法还包括:记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及将空闲的CPU核关闭,保留一个CPU核运行,并对所述运行中的CPU核进行降频处理。
上述多核中央处理器的调控方法中,所述CPU调控模式还包括第三调控模式;当所述CPU调控模式为所述第三调控模式时,所述方法还包括:每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息;当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;当所述运行中的CPU核的占用率大于第二预定值时,打开所有的CPU核;以及通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
上述多核中央处理器的调控方法中,所述通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移的步骤包括:调用底层的函数或者通过套接字机制同底层核心进行通信;获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;以及通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
一种多核中央处理器的调控方法,包括:接收与调控所述多核CPU相关的操作指令;以及响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控。
上述多核中央处理器的调控方法中,所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者。
上述多核中央处理器的调控方法中,所述CPU调控模式至少包括第一调控模式和第二调控模式;所述第一调控模式对应所述多核CPU中的至少一个所述CPU核打开并运行在高频状态;所述第二调控模式对应所述多核CPU中的一个所述CPU核打开并运行在低频状态。
上述多核中央处理器的调控方法中,当所述CPU调控模式为所述第一调控模式时,所述方法还包括:记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及将高频次的进程迁移至空闲的CPU核进行处理,并将所述空闲的CPU核调整为高频次的运行状态。
上述多核中央处理器的调控方法中,当所述CPU调控模式为所述第二调控模式时,所述方法还包括:记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及将空闲的CPU核关闭,保留一个CPU核运行,并对所述运行中的CPU核进行降频处理。
上述多核中央处理器的调控方法中,所述CPU调控模式还包括第三调控模式;当所述CPU调控模式为所述第三调控模式时,所述方法还包括:每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息;当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;当所述运行中的CPU核的占用率大于第二预定值时,打开所有的CPU核;以及通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
上述多核中央处理器的调控方法中,还包括:通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
上述多核中央处理器的调控方法中,所述通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移的步骤包括:调用底层的函数或者通过套接字机制同底层核心进行通信;获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;以及通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
一种多核中央处理器的调控系统,包括:一操作指令接收模块,用于接收与调控所述多核CPU相关的操作指令;以及一调控模块,用于响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控。
上述多核中央处理器的调控系统,所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者。
上述多核中央处理器的调控系统中,所述CPU调控模式至少包括第一调控模式和第二调控模式;所述第一调控模式对应所述多核CPU中的至少一个所述CPU核打开并运行在高频状态;所述第二调控模式对应所述多核CPU中的一个所述CPU核打开并运行在低频状态。
上述多核中央处理器的调控系统中,当所述CPU调控模式为所述第一调控模式时,所述调控模块用于记录进程使用所述CPU核的数量及进程使用所述CPU核的时间,以及用于将高频次的进程迁移至空闲的CPU核进行处理,并用于将所述空闲的CPU核调整为高频次的运行状态。
上述多核中央处理器的调控系统中,当所述CPU调控模式为所述第二调控模式时,所述调控模块用于记录进程使用所述CPU核的数量及进程使用所述CPU核的时间,以及用于将空闲的CPU核关闭和保留一个CPU核运行,并用于对所述运行中的CPU核进行降频处理。
上述多核中央处理器的调控系统中,所述CPU调控模式还包括第三调控模式;当所述CPU调控模式为所述第三调控模式时,所述调控模块用于每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息,以及用于当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;以及所述调控模块还用于当所述运行中的CPU核的占用率大于第二预定值时,打开所有的CPU核,以及用于通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
上述多核中央处理器的调控系统中,所述调控模块用于通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
上述多核中央处理器的调控系统中,所述调控模块包括:一本地服务模块,用于调用底层的函数或者通过套接字机制同底层核心进行通信;一获取模块,用于获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;以及一控制模块,用于通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
有益效果
可调控多核CPU的每个CPU核的工作状态,提高多核CPU的处理能力或者达到节能省电的目的。
附图说明
图1为本发明实施例的多核CPU的调控方法的流程图。
图2为图1所示方法的在第三调控模式下的流程图。
图3为图1所示方法的调控实现流程图。
图4为本发明实施例的多核CPU的调控系统的结构框图。
图5为图4所示系统的调控模块的结构框图。
本发明的最佳实施方式
本发明实施例提供一种多核CPU的调控方法及系统,为使本发明的目的、技术方案及效果更加清楚、明确,以下对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例中的多核CPU是指至少具有两核的CPU,例如:双核CPU、三核CPU、四核CPU,诸如此类。
在以下的说明中,本发明的具体实施例将参考由一部或多部计算机/移动设备所执行的作业的步骤及符号来说明,除非另有述明。因此,其将可了解到这些步骤及操作,其中有数次提到为由计算机/移动设备执行,包括了由代表了以一结构化型式中的数据的电子信号的计算机/移动设备处理单元所操纵。此操纵转换该数据或将其维持在该计算机/移动设备的内存系统中的位置处,其可重新配置或另外以本领域技术人员所熟知的方式来改变该计算机/移动设备的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本发明原理以上述文字来说明,其并不代表为一种限制,本领域技术人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。
本发明的原理使用许多其它泛用性或特定目的运算、通信环境或组态来进行作业。所熟知适合用于本发明实施例的运算系统、环境与组态的范例可包括(但不限于)平板电脑、移动电话、个人计算机、服务器、多处理器系统、微电脑为主的系统、主架构型计算机、及分布式运算环境,其中包括了任何的上述系统或装置。
如在此处使用的术语“模块”或“单元”可称之为在该运算系统上执行的软件对象或例式。在此处所述的不同组件、模块、引擎及服务可实施为在该运算系统上执行的对象或处理。而在此处所述的系统及方法优选地是实施成软件,在软件及硬件或硬件上的实施亦有可能并进行考虑。
本发明实施例的多核CPU的调控方法及系统可以运行于计算机/移动设备中,该计算机可以是个人电脑、服务器等等中的一种或者一种以上组合而成的系统,该移动设备可以是平板电脑、移动电话、PDA(Personal Digital Assistant,个人数字助理)、笔记本电脑等等中的一种或者一种以上组合而成的系统。该计算机/移动设备中可以包括处理器、存储器、传感器、开关器件、电源、时钟信号生成器、输入输出设备等中的任意组合。上述计算机/移动设备中的处理器、存储器、传感器、开关器件、电源、时钟信号生成器、输入输出设备等中的任意组合用于实现本发明实施例的多核CPU的调控方法中的步骤及多核CPU的调控系统中的功能。
在本实施例中,所述多核CPU的调控系统所对应的软件程序指令存储于存储器中,并被处理器执行,以实现操作系统中的进程管理。
另外,上述存储器计算机可读取的存储介质,该存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
请参阅图1,图1为本发明实施例多核CPU的调控方法较佳实施例的流程图,如图所示,其包括:
S101、接收与调控多核CPU相关的操作指令。
S102、响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控。
该预设的CPU调控模式是通过以下步骤生成的:预先设置用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的CPU调控模式,所述CPU调控模式包括预定义调控模式及自动调控模式。
在本发明实施例中,所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者。所述CPU调控模式至少包括第一调控模式和第二调控模式;所述第一调控模式对应所述多核CPU中的至少一个CPU核打开并运行在高频状态;所述第二调控模式对应所述多核CPU中的一个CPU核打开并运行在低频状态。
具体地,本发明实施例中的CPU调控模式可分为两个大类即预定义调控模式及自动调控模式,预定义调控模式又可细分为性能最佳模式及省电模式,所述性能最佳模式对应上述第一调控模式,所述省电模式对应上述第二调控模式,即,所述性能最佳模式为多核CPU的CPU核均打开并运行在高频状态,所述省电模式为多核CPU的一个CPU核打开并运行在低频状态。下面分别对这些模式进行详细的说明。
在用户的移动设备电能充足或者能够充电的情况下,用户可能希望利用移动设备体验一些大型游戏或者频繁的进行上网操作,在用户对移动设备进行操作或游戏体验的过程中,会更加注重移动设备的性能,所以本发明实施例提供一种多核CPU的性能最佳模式来使移动设备保持在最佳性能上进行运行。
在本发明实施例中,当所述CPU调控模式为所述第一调控模式时,所述方法还包括:记录进程使用所述CPU核的数量及进程使用所述CPU核的时间,将高频次的进程迁移至空闲的CPU核进行处理,并将所述空闲的CPU核调整为高频次的运行状态。当所述CPU调控模式为所述第二调控模式时,所述方法还包括:记录进程使用所述CPU核的数量及进程使用所述CPU核的时间,将空闲的CPU核关闭,保留一个CPU核运行,并对所述运行中的CPU核进行降频处理。
对于如何使多核CPU保持性能最佳的状态,具体可通过多核CPU架构来记录进程使用的CPU核的数量以及利用其子系统CPUACCT(Cgroups中生成CPU使用状态报告的节点系统)来记录进程使用的CPU核的时间,从而根据进程使用的CPU核的数量及CPU核的时间通过其子系统CPUSET(Cgroups中为任务分配独立CPU及内存的节点)将高频次的进程迁移到空闲的CPU核进行处理,并且还通过CPUSET子系统将正在使用的CPU核固定运行在高频状态,从而使多核CPU的每个CPU核都在运行并保持在高频状态,充分发挥多核CPU处理能力强的优势,提高用户游戏或上网的使用体验。
在用户的移动设备缺电并且不能进行充电的情况下,用户可能只希望利用移动设备来进行正常的通信即可,所以本发明实施例提供了一种省电模式,来将空闲的CPU核关闭,并且对正在使用的CPU核进行降频处理,从而达到省电的目的。
在省电模式下,本发明实施例也可通过多核CPU架构来实现进程管理,例如记录进程使用的CPU核的数量以及利用CPUACCT子系统来记录进程使用的CPU核的时间,根据使用的CPU核的数量以及CPU核的时间来关闭空闲的CPU核,保留一个CPU核运行,并在可接受范围内对该运行的CPU核进行降频处理,最终实现移动设备在省电模式下使用。
在用户的移动设备不处于缺电状态并且能够正常运行的情况下,用户可能希望移动设备能根据具体的情况,例如通过具体的事件触发实现CPU核的自动调控,根据这一情况,本发明实施例提供了一自动调控模式,来实现移动设备根据自身的使用情况调控CPU核的运行。
在本发明实施例中,所述CPU调控模式还包括第三调控模式;当所述CPU调控模式为所述第三调控模式时,所述方法还包括:
S201、每隔一预定时间获取所述多核CPU的所述CPU核运行状态信息,当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理。
S202、当所述运行的CPU核的占用率大于第二预定值时,打开所有的CPU核。
S203、通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
上述第一预定值可以是在1%至50%的范围内取值,例如:22%、35%、43%、50%,等等。上述第二预定值可以是在50%至99%的范围内取值,例如:61%、77%、89%、92%,等等。
具体地,在自动调控模式下,每隔一预定时间获取多核CPU的CPU核运行状态信息;此步骤中,具体是底层通过CPUACCT子系统每隔一预定时间主动上报多核CPU的每个CPU核运行状态信息,然后该运行状态信息可通过socket(套接字)消息的方式上报,并被一自动调控系统获取,该自动调控系统可根据获取到多核CPU的运行状态信息自动下发调控命令。当所述多核CPU的CPU核占用率均为20%以下时,关闭多余的CPU核保留一个CPU核运行,并对运行的CPU核进行降频处理;当多核CPU的每个CPU核占用率均在20%以下时,可通过CPUSET子系统来关闭空闲的CPU核,只保留一个CPU核运行。 当所述运行的CPU核的占用率为90%以上时,打开所有的CPU核;而在该运行的CPU核的占用率达到90%以上时,则可通过CPUSET来打开所有的或者部分的CPU核以提高移动设备的处理能力。通过调节进程迁移使多核CPU核的占用率保持平衡。在多个CPU核运行时,当发现多核CPU的多个CPU核占用率不平衡时,例如CPU0的占用率为95%,而CPU1的占用率为20%,此时可通过动态的进程迁移操作来使多核CPU的每个CPU核保持平衡。
下面对多核CPU的调控来进行更详细的说明。
本发明实施例主要是通过底层核心接口对Cgroups(Linux内核所提供的一种限制、隔离、记录进程所使用物理资源的机制,物理资源包括CPU、I/O口等)接口进行封装,调用其子系统CPUSET,从而实现对多核CPU的CPU核进行开关、调频及进程迁移控制。
在本发明实施例中,所述方法还包括:通过调用所述多核CPU 的子系统CPUSET控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
其中,所述通过调用所述多核CPU 的子系统CPUSET控制所述多核CPU的所述CPU核的开关、调频及进程迁移的步骤包括:
S301、调用底层的函数或者通过socket(套接字)机制同底层核心进行通信。
S302、获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数。
S303、通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
具体地,本发明实施例的方法可以包括以下步骤:
设置一系统服务,用于调用底层的函数或者通过socket机制同底层核心之间进行通信;这主要是通过Native Service(本地服务)来设计一个Deamon服务(系统服务),并且由init root(Android系统中Linux内核启动的第一条进程)进程来进行启动该Deamon服务,从而实现远程调用函数,具体可直接调用底层的函数或者通过socket机制(一种进程间通信机制)同底层核心之间进行通信。
调用Deamon服务,通过所述Deamon服务提供用于调节CPU核的开启数量、CPU核的运行频率及进程迁移的函数;此步骤目的是利用Framework(框架)来完成Native Service与JAVA API(Application Programming Interface,应用程序编程接口)的直接连接的工作,从而通过进程间通信完成对Deamon服务的调用,然后针对上层提供诸如opencpu、closecpu等(opencpu、closecpu等是自定义函数名,提供打开、关闭CPU核心)一系列的JNI接口函数。
通过所述用于调节CPU核的开启数量、CPU核的运行频率及进程迁移的函数来实现对多核CPU的CPU核的开关、调频及进程迁移控制。此步骤是利用API针对上层提供的JNI接口,完成对CPUControl类(CPUControl类是自定义的类名),实现给Android apk程序使用的一系列API接口,从而实现例如打开CPU核、关闭CPU核、调节CPU频率以及进程迁移的功能。
基于上述方法,本发明实施例还提供一种多核CPU的调控系统,如图4所示,包括:
操作指令接收模块100,用于接收与调控多核CPU相关的操作指令;
调控模块200,用于响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的所述CPU核进行调控。
在本发明实施例中,所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者。所述CPU调控模式至少包括第一调控模式和第二调控模式;所述第一调控模式对应所述多核CPU中的至少一个CPU核打开并运行在高频状态;所述第二调控模式对应所述多核CPU中的一个CPU核打开并运行在低频状态。
在本发明实施例中,当所述CPU调控模式为所述第一调控模式时,所述调控模块200用于记录进程使用的所述CPU核的数量及进程使用的所述CPU核的时间,以及用于将高频次的进程迁移至空闲的CPU核进行处理,并用于将所述空闲的CPU核调整为高频次的运行状态。
在本发明实施例中,当所述CPU调控模式为所述第二调控模式时,所述调控模块200用于记录进程使用的所述CPU核的数量及进程使用的所述CPU核的时间,以及用于将空闲的CPU核关闭和保留一个CPU核运行,并用于对所述运行中的CPU核进行降频处理。
在本发明实施例中,所述CPU调控模式还包括第三调控模式;当所述CPU调控模式为所述第三调控模式时,所述调控模块200用于每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息,以及用于当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;所述调控模块200还用于当所述运行的CPU核的占用率大于第二预定值时,打开所有的CPU核,以及用于通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
在本发明实施例中,所述调控模块200用于通过调用所述多核CPU 的子系统CPUSET控制所述多核CPU的所述CPU核的开关、调频及进程迁移。所述调控模块200包括:本地服务模块230,用于调用底层的函数或者通过socket机制同底层核心进行通信;获取模块220,用于获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;控制模块210,用于通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
具体地,所述调控模块200包括一底层核心接口模块240,用于对Cgroups接口进行封装,调用多核CPU 的子系统CPUSET,实现对多核CPU进行CPU核的开关、调频及进程迁移控制。所述本地服务模块230还用于设置一系统服务,用于调用底层的函数或者通过socket机制同底层核心之间进行通信。框架模块,用于调用系统服务,通过所述系统服务提供用于调节CPU核的开启数量、CPU核的运行频率及进程迁移的函数。API模块,用于通过所述用于调节CPU核的开启数量、CPU核的运行频率及进程迁移的函数来实现对多核CPU的CPU核的开关、调频及进程迁移控制。关于上述各功能单元的作用在前面的方法中已有详述,故不再赘述。
综上所述,本发明多核CPU的调控方法及系统,针对用户的移动设备的具体的使用情况以及性能需求,提供多核CPU的预定义调控模式及自动调节模式,使得移动设备在电量充足时保持最佳性能状态下运行,在电量不足情况下则保持省电模式下运行,此外,用户还可设置自动调节模式,从而使移动设备能够根据其CPU的使用情况自动调节CPU的开关、调频及进程迁移功能,通过本发明,移动设备的用户可选择在不同的场景下,输入指令来调控多核CPU的每个CPU核的工作状态,提高多核CPU的处理能力或者达到节能省电的目的。
应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。
本发明的实施方式
工业实用性
序列表自由内容

Claims (20)

  1. 一种多核中央处理器(Central Processing Unit,CPU)的调控方法,其包括:
    接收与调控所述多核CPU相关的操作指令;
    响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控,所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者;以及
    通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
  2. 根据权利要求1所述的多核中央处理器的调控方法,其中所述CPU调控模式至少包括第一调控模式和第二调控模式;
    所述第一调控模式对应所述多核CPU中的至少一个所述CPU核打开并运行在高频状态;
    所述第二调控模式对应所述多核CPU中的一个所述CPU核打开并运行在低频状态;
    其中,当所述CPU调控模式为所述第一调控模式时,所述方法还包括:
    记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及
    将高频次的进程迁移至空闲的CPU核进行处理,并将所述空闲的CPU核调整为高频次的运行状态;
    其中,当所述CPU调控模式为所述第二调控模式时,所述方法还包括:
    记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及
    将空闲的CPU核关闭,保留一个CPU核运行,并对所述运行中的CPU核进行降频处理。
  3. 根据权利要求1所述的多核中央处理器的调控方法,其中所述CPU调控模式还包括第三调控模式;
    当所述CPU调控模式为所述第三调控模式时,所述方法还包括:
    每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息;
    当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;
    当所述运行中的CPU核的占用率大于第二预定值时,打开所有的CPU核;以及
    通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
  4. 根据权利要求1所述的多核中央处理器的调控方法,其中所述通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移的步骤包括:
    调用底层的函数或者通过套接字机制同底层核心进行通信;
    获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;以及
    通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
  5. 一种多核中央处理器的调控方法,其包括:
    接收与调控所述多核CPU相关的操作指令;以及
    响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控。
  6. 根据权利要求5所述的多核中央处理器的调控方法,其中所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者。
  7. 根据权利要求5所述的多核中央处理器的调控方法,其中所述CPU调控模式至少包括第一调控模式和第二调控模式;
    所述第一调控模式对应所述多核CPU中的至少一个所述CPU核打开并运行在高频状态;
    所述第二调控模式对应所述多核CPU中的一个所述CPU核打开并运行在低频状态。
  8. 根据权利要求7所述的多核中央处理器的调控方法,其中当所述CPU调控模式为所述第一调控模式时,所述方法还包括:
    记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及
    将高频次的进程迁移至空闲的CPU核进行处理,并将所述空闲的CPU核调整为高频次的运行状态。
  9. 根据权利要求7所述的多核中央处理器的调控方法,其中当所述CPU调控模式为所述第二调控模式时,所述方法还包括:
    记录进程使用所述CPU核的数量及进程使用所述CPU核的时间;以及
    将空闲的CPU核关闭,保留一个CPU核运行,并对所述运行中的CPU核进行降频处理。
  10. 根据权利要求5所述的多核中央处理器的调控方法,其中所述CPU调控模式还包括第三调控模式;
    当所述CPU调控模式为所述第三调控模式时,所述方法还包括:
    每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息;
    当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;
    当所述运行中的CPU核的占用率大于第二预定值时,打开所有的CPU核;以及
    通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
  11. 根据权利要求5所述的多核中央处理器的调控方法,还包括:
    通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
  12. 根据权利要求11所述的多核中央处理器的调控方法,其中所述通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移的步骤包括:
    调用底层的函数或者通过套接字机制同底层核心进行通信;
    获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;以及
    通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
  13. 一种多核中央处理器的调控系统,其包括:
    一操作指令接收模块,用于接收与调控所述多核CPU相关的操作指令;以及
    一调控模块,用于响应所述操作指令,根据预设的CPU调控模式通过底层核心接口对所述多核CPU的CPU核进行调控。
  14. 根据权利要求13所述的多核中央处理器的调控系统,其中所述CPU调控模式包括调节所述CPU核的开启数量、调节所述CPU核的运行频率及迁移所述CPU核的进程中的至少一者。
  15. 根据权利要求13所述的多核中央处理器的调控系统,其中所述CPU调控模式至少包括第一调控模式和第二调控模式;
    所述第一调控模式对应所述多核CPU中的至少一个所述CPU核打开并运行在高频状态;
    所述第二调控模式对应所述多核CPU中的一个所述CPU核打开并运行在低频状态。
  16. 根据权利要求15所述的多核中央处理器的调控系统,其中当所述CPU调控模式为所述第一调控模式时,所述调控模块用于记录进程使用所述CPU核的数量及进程使用所述CPU核的时间,以及用于将高频次的进程迁移至空闲的CPU核进行处理,并用于将所述空闲的CPU核调整为高频次的运行状态。
  17. 根据权利要求15所述的多核中央处理器的调控系统,其中当所述CPU调控模式为所述第二调控模式时,所述调控模块用于记录进程使用所述CPU核的数量及进程使用所述CPU核的时间,以及用于将空闲的CPU核关闭和保留一个CPU核运行,并用于对所述运行中的CPU核进行降频处理。
  18. 根据权利要求13所述的多核中央处理器的调控系统,其中所述CPU调控模式还包括第三调控模式;
    当所述CPU调控模式为所述第三调控模式时,所述调控模块用于每隔一预定时间获取所述多核CPU的所述CPU核的运行状态信息,以及用于当所述多核CPU的所述CPU核的占用率均小于第一预定值时,保留其中一个CPU核运行并关闭其它的CPU核,并对所述运行中的CPU核进行降频处理;以及
    所述调控模块还用于当所述运行中的CPU核的占用率大于第二预定值时,打开所有的CPU核,以及用于通过迁移进程使所述多核CPU的所述CPU核的占用率保持平衡。
  19. 根据权利要求13所述的多核中央处理器的调控系统,其中所述调控模块用于通过调用所述多核CPU 的子系统控制所述多核CPU的所述CPU核的开关、调频及进程迁移。
  20. 根据权利要求19所述的多核中央处理器的调控系统,其中所述调控模块包括:
    一本地服务模块,用于调用底层的函数或者通过套接字机制同底层核心进行通信;
    一获取模块,用于获取用于调节所述CPU核的开启数量、所述CPU核的运行频率及进程迁移的函数;以及
    一控制模块,用于通过所述函数控制对所述多核CPU的所述CPU核的开关、调频及进程迁移。
PCT/CN2013/078790 2012-08-29 2013-07-04 一种多核中央处理器的调控方法及系统 WO2014032477A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP13833832.2A EP2891980A4 (en) 2012-08-29 2013-07-04 METHOD AND SYSTEM FOR ADJUSTING AND CONTROLLING A MULTI-CORE CENTRALIZED PROCESSOR UNIT
US14/398,351 US9600330B2 (en) 2012-08-29 2013-07-04 Method and system for regulation and control of a multi-core central processing unit

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210311472.X 2012-08-29
CN201210311472.XA CN102866921B (zh) 2012-08-29 2012-08-29 一种多核cpu的调控方法及系统

Publications (1)

Publication Number Publication Date
WO2014032477A1 true WO2014032477A1 (zh) 2014-03-06

Family

ID=47445800

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/078790 WO2014032477A1 (zh) 2012-08-29 2013-07-04 一种多核中央处理器的调控方法及系统

Country Status (4)

Country Link
US (1) US9600330B2 (zh)
EP (1) EP2891980A4 (zh)
CN (1) CN102866921B (zh)
WO (1) WO2014032477A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016126880A1 (en) * 2015-02-03 2016-08-11 Alibaba Group Holding Limited Apparatus, device and method for allocating cpu resources
CN111045476A (zh) * 2019-12-18 2020-04-21 湖南国科微电子股份有限公司 多核cpu系统下时序波形控制方法、系统、设备及介质
US10789100B2 (en) 2015-04-15 2020-09-29 Alibaba Group Holding Limited System, apparatus and method for resource provisioning
WO2023155904A1 (zh) * 2022-02-21 2023-08-24 华为技术有限公司 一种网络设备运行状态的调整方法、装置及相关设备

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102866921B (zh) * 2012-08-29 2016-05-11 惠州Tcl移动通信有限公司 一种多核cpu的调控方法及系统
WO2014107958A1 (zh) * 2013-01-10 2014-07-17 惠州Tcl移动通信有限公司 应用程序自动适配多核处理器模式的方法、移动设备
US10223156B2 (en) 2013-06-09 2019-03-05 Apple Inc. Initiating background updates based on user activity
US9256484B2 (en) * 2013-06-09 2016-02-09 Apple Inc. Dynamic adjustment of mobile device based on user activity
CN103488478A (zh) * 2013-09-03 2014-01-01 厦门雅迅网络股份有限公司 基于android平台的设备管理框架
CN103825842B (zh) * 2014-02-28 2017-06-23 新华三技术有限公司 一种多cpu系统的数据流处理方法和装置
US9432796B2 (en) 2014-05-30 2016-08-30 Apple Inc. Dynamic adjustment of mobile device based on peer event data
CN104239153B (zh) * 2014-09-29 2018-09-11 三星电子(中国)研发中心 多核cpu负载均衡的方法和装置
US10491708B2 (en) 2015-06-05 2019-11-26 Apple Inc. Context notifications
US9779058B2 (en) * 2015-07-13 2017-10-03 Google Inc. Modulating processsor core operations
US20170031724A1 (en) * 2015-07-31 2017-02-02 Futurewei Technologies, Inc. Apparatus, method, and computer program for utilizing secondary threads to assist primary threads in performing application tasks
JP2017046084A (ja) * 2015-08-25 2017-03-02 コニカミノルタ株式会社 画像処理装置、制御タスクの割り当て方法及び割り当てプログラム
CN106557148B (zh) * 2015-09-28 2019-06-28 华为终端有限公司 一种接口电路、显示驱动器、终端设备和显示控制方法
CN107132903B (zh) * 2016-02-29 2020-11-13 中兴通讯股份有限公司 一种节能管理实现方法、装置及网络设备
CN105930218A (zh) * 2016-04-18 2016-09-07 深圳市万普拉斯科技有限公司 运算资源频率调整方法及系统
CN106020844A (zh) * 2016-05-31 2016-10-12 广东欧珀移动通信有限公司 处理器中内核运行配置的确定方法以及装置
CN106155866A (zh) * 2016-08-01 2016-11-23 浪潮电子信息产业股份有限公司 一种监控cpu核心频率的方法及装置
CN106339064A (zh) * 2016-08-29 2017-01-18 宇龙计算机通信科技(深圳)有限公司 一种重新开机的方法及装置
CN106708241A (zh) * 2016-11-24 2017-05-24 捷开通讯(深圳)有限公司 移动终端及提高其在低功耗模式下的性能的方法
CN106775828B (zh) * 2016-11-25 2020-07-03 Oppo广东移动通信有限公司 应用程序安装方法及装置、计算机设备
CN107239348B (zh) * 2017-06-23 2020-05-15 厦门美图移动科技有限公司 一种多核处理器调度方法、装置及移动终端
CN107360327B (zh) * 2017-07-19 2021-05-07 腾讯科技(深圳)有限公司 语音识别方法、装置和存储介质
CN108121433B (zh) * 2017-12-06 2021-10-15 中国航空工业集团公司西安航空计算技术研究所 一种gpu多处理器系统的任务调度方法
US10802883B2 (en) * 2018-08-21 2020-10-13 Intel Corporation Method, system, and device for near-memory processing with cores of a plurality of sizes
CN110377418B (zh) * 2019-06-05 2021-09-03 上海易点时空网络有限公司 用于单台服务器的cpu多核使用率优化处理方法及装置
CN110673958B (zh) * 2019-09-30 2022-07-08 Oppo(重庆)智能科技有限公司 调频方法、调频装置、存储介质与电子设备
CN110647401B (zh) * 2019-09-30 2022-07-08 Oppo(重庆)智能科技有限公司 调频方法、调频装置、存储介质与电子设备
WO2021196065A1 (en) * 2020-04-01 2021-10-07 Intel Corporation Technology to automatically conduct speed switching in processor links without warm resets
CN112181639B (zh) * 2020-09-11 2023-07-28 江苏航天龙梦信息技术有限公司 基于龙芯平台的动态调频调压方法
CN112559176A (zh) * 2020-12-11 2021-03-26 广州橙行智动汽车科技有限公司 一种指令处理方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1690955A (zh) * 2004-04-29 2005-11-02 钜格系统科技股份有限公司 手持式信息处理装置的电源管理方法
CN1716190A (zh) * 2004-07-01 2006-01-04 技嘉科技股份有限公司 中央处理器运作频率最佳化调整方法
CN1906587A (zh) * 2004-03-16 2007-01-31 索尼计算机娱乐公司 降低多处理器系统中的功耗的方法和装置
CN101201689A (zh) * 2006-12-13 2008-06-18 上海晨兴电子科技有限公司 一种多任务系统中自动管理cpu功耗的方法
CN102866921A (zh) * 2012-08-29 2013-01-09 惠州Tcl移动通信有限公司 一种多核cpu的调控方法及系统

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6711447B1 (en) * 2003-01-22 2004-03-23 Intel Corporation Modulating CPU frequency and voltage in a multi-core CPU architecture
US20080005591A1 (en) * 2006-06-28 2008-01-03 Trautman Mark A Method, system, and apparatus for dynamic thermal management
US20080115010A1 (en) * 2006-11-15 2008-05-15 Rothman Michael A System and method to establish fine-grained platform control
US7865751B2 (en) * 2007-06-18 2011-01-04 Intel Corporation Microarchitecture controller for thin-film thermoelectric cooling
US7962774B2 (en) * 2007-10-04 2011-06-14 Wisconsin Alumni Research Foundation Over-provisioned multicore processor
JP2010079622A (ja) * 2008-09-26 2010-04-08 Hitachi Ltd マルチコアプロセッサシステム、および、そのタスク制御方法
US8984523B2 (en) * 2009-05-26 2015-03-17 Telefonaktiebolaget L M Ericsson (Publ) Method for executing sequential code on the scalable processor at increased frequency while switching off the non-scalable processor core of a multicore chip
CN101598967A (zh) * 2009-06-23 2009-12-09 中兴通讯股份有限公司 多核防火墙单板及其运行方法
US8683476B2 (en) * 2009-06-30 2014-03-25 Oracle America, Inc. Method and system for event-based management of hardware resources using a power state of the hardware resources
US8276142B2 (en) * 2009-10-09 2012-09-25 Intel Corporation Hardware support for thread scheduling on multi-core processors
US9063730B2 (en) * 2010-12-20 2015-06-23 Intel Corporation Performing variation-aware profiling and dynamic core allocation for a many-core processor
US8516493B2 (en) * 2011-02-01 2013-08-20 Futurewei Technologies, Inc. System and method for massively multi-core computing systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1906587A (zh) * 2004-03-16 2007-01-31 索尼计算机娱乐公司 降低多处理器系统中的功耗的方法和装置
CN1690955A (zh) * 2004-04-29 2005-11-02 钜格系统科技股份有限公司 手持式信息处理装置的电源管理方法
CN1716190A (zh) * 2004-07-01 2006-01-04 技嘉科技股份有限公司 中央处理器运作频率最佳化调整方法
CN101201689A (zh) * 2006-12-13 2008-06-18 上海晨兴电子科技有限公司 一种多任务系统中自动管理cpu功耗的方法
CN102866921A (zh) * 2012-08-29 2013-01-09 惠州Tcl移动通信有限公司 一种多核cpu的调控方法及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2891980A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016126880A1 (en) * 2015-02-03 2016-08-11 Alibaba Group Holding Limited Apparatus, device and method for allocating cpu resources
US10089150B2 (en) 2015-02-03 2018-10-02 Alibaba Group Holding Limited Apparatus, device and method for allocating CPU resources
US10789100B2 (en) 2015-04-15 2020-09-29 Alibaba Group Holding Limited System, apparatus and method for resource provisioning
CN111045476A (zh) * 2019-12-18 2020-04-21 湖南国科微电子股份有限公司 多核cpu系统下时序波形控制方法、系统、设备及介质
WO2023155904A1 (zh) * 2022-02-21 2023-08-24 华为技术有限公司 一种网络设备运行状态的调整方法、装置及相关设备

Also Published As

Publication number Publication date
US9600330B2 (en) 2017-03-21
CN102866921A (zh) 2013-01-09
EP2891980A4 (en) 2016-05-18
EP2891980A1 (en) 2015-07-08
US20150113536A1 (en) 2015-04-23
CN102866921B (zh) 2016-05-11

Similar Documents

Publication Publication Date Title
WO2014032477A1 (zh) 一种多核中央处理器的调控方法及系统
WO2021217529A1 (zh) 一种进程间通信的方法及系统
US9063783B2 (en) Coordinating parallel execution of processes using agents
US11860796B2 (en) Execution space agnostic device drivers
US6260075B1 (en) System and method for providing shared global offset table for common shared library in a computer system
JP2015537307A (ja) コンポーネント指向ハイブリッドクラウドオペレーティングシステムのアーキテクチャ及びその通信方法
TW201205441A (en) Multi-CPU domain mobile electronic device and operation method thereof
CN109564526A (zh) 使用封装和线程提示信息的组合来控制处理器的性能状态
EP3633507B1 (en) Technologies for secure and efficient native code invocation for firmware services
US11422849B2 (en) Technology for dynamically grouping threads for energy efficiency
WO2021223744A1 (zh) 实现热迁移的方法、芯片、板卡和存储介质
Holmbacka et al. Task migration for dynamic power and performance characteristics on many-core distributed operating systems
US8463972B2 (en) System and method for dynamic, local retriggered interrupt routing discovery
WO2024007934A1 (zh) 中断处理方法、电子设备和存储介质
US11221875B2 (en) Cooperative scheduling of virtual machines
Takase et al. mROS: A lightweight runtime environment of ROS 1 nodes for embedded devices
Takase et al. Work-in-Progress: Design Concept of a Lightweight Runtime Environment for Robot Software Components Onto Embedded Devices
WO2023236479A1 (zh) 用于执行任务调度的方法及其相关产品
CN117950756A (zh) 自适应环境的插件框架设计方法、系统、设备及储存介质
WO2022166553A1 (zh) 一种实现批量系统调用的方法及装置
Shi et al. Design of Airborne Distributed Service Component Platform Based on FACE
WO2024027413A1 (zh) 一种协同调度方法和相关设备
Huang et al. Research on application software architecture under the project management informatization of power grid enterprises
CN117519897A (zh) 一种数据处理方法及装置
CN114296809A (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: 13833832

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14398351

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE