WO2015123938A1 - Multi-core processor scheduling method and apparatus, and terminal - Google Patents

Multi-core processor scheduling method and apparatus, and terminal Download PDF

Info

Publication number
WO2015123938A1
WO2015123938A1 PCT/CN2014/079289 CN2014079289W WO2015123938A1 WO 2015123938 A1 WO2015123938 A1 WO 2015123938A1 CN 2014079289 W CN2014079289 W CN 2014079289W WO 2015123938 A1 WO2015123938 A1 WO 2015123938A1
Authority
WO
WIPO (PCT)
Prior art keywords
core
processor
processes
load
enabled
Prior art date
Application number
PCT/CN2014/079289
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2015123938A1 publication Critical patent/WO2015123938A1/en

Links

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/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4893Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues taking 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 present invention relates to the field of communications technologies, and in particular, to a multi-core processor scheduling method, apparatus, and terminal.
  • BACKGROUND With the development and application of intelligent mobile terminals, the processor core of intelligent mobile terminals has begun to evolve from single core to dual core, quad core and even eight core, thereby providing more operation for large games and multi-threaded applications. Good operating conditions.
  • the technical problem to be solved by the present invention is to provide a multi-core processor scheduling method, apparatus, and terminal, which are used to solve the disadvantages of the multi-core processor performance and power consumption in the related art.
  • the present invention provides a multi-core processor scheduling method, including: determining a target frequency of a current core of a processor, where the target frequency is an operating frequency that is requested by a current core of the processor. Determining whether the number of migratable processes in each enabled core of the processor meets a preset condition if the target frequency of the current core is greater than a current operating frequency of each enabled core of the processor; In the case where the number of migrateable processes in each of the enabled cores of the device satisfies the preset condition, a new core is opened for the processor.
  • determining the target frequency of the current core of the processor includes: determining a target frequency of the current core according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load of the processor.
  • determining whether the number of the migrateable processes in each enabled core of the processor meets the preset condition comprises: according to the load of each opened core and the average load of each core after starting a new core, Determining a load weight difference of each of the turned-on cores; determining, according to load weight differences of the respective turned-on cores, loads of the respective turned-on cores, and affinity of the respective turned-on cores, determining the processor Each The number of the migrateable processes in the core is turned on; whether the number of the migrateable processes is greater than a preset threshold, or whether the ratio of the number of the migrateable processes to the number of cores that are turned on is greater than a preset ratio.
  • the method further includes: a number of migrateable processes in each enabled core of the processor If the preset condition is not met, the processor is scheduled by the original kernel scheduling policy of the processor.
  • the method further includes: migrating at least a part of the migratable processes in the current core to the new core to reduce the current core load.
  • an embodiment of the present invention further provides a multi-core processor scheduling apparatus, including: a frequency determining unit, configured to determine a target frequency of a current core of the processor, where the target frequency is a current core of the processor Requesting the adjusted operating frequency; the process determining unit is further configured to determine, if the target frequency of the current core is greater than a current operating frequency of each enabled core of the processor, determining that each of the enabled cores of the processor is Whether the number of migration processes satisfies a preset condition; the opening unit is configured to, when the process determining unit determines that the number of migrateable processes in each enabled core of the processor satisfies the preset condition, Open a new core.
  • a frequency determining unit configured to determine a target frequency of a current core of the processor, where the target frequency is a current core of the processor Requesting the adjusted operating frequency
  • the process determining unit is further configured to determine, if the target frequency of the current core is greater than a current operating frequency of each enabled core of the processor,
  • the frequency determining unit is specifically configured to determine a target frequency of the current core according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load of the processor.
  • the process determining unit specifically includes: a load weight difference determining module, configured to determine, according to the load of each opened core and an average load of each core after the core is opened, determine a load weight difference of each opened core And a loadable process determining module, configured to determine, according to the load weight difference determining module, a load weight difference of the each opened core, a load of each opened core, and an affinity of each opened core, Determining a number of migrateable processes in each of the enabled cores of the processor; and comparing the module, determining whether the number of the migrateable processes is greater than a preset threshold, or determining a ratio of the number of migrateable processes to the number of cores that have been turned on Whether it is greater than the preset ratio.
  • the device further includes: a migration unit, configured to migrate at least a part of the migratable processes in the current core to the new core after opening a new core for the processor The load of the current core is reduced.
  • a migration unit configured to migrate at least a part of the migratable processes in the current core to the new core after opening a new core for the processor The load of the current core is reduced.
  • an embodiment of the present invention further provides a terminal, where the terminal includes any multi-core processor scheduling apparatus provided by the present invention.
  • the multi-core processor scheduling method, device and terminal provided by the invention when the multi-core processor needs to perform frequency adjustment on a certain core to achieve the target frequency, does not immediately perform the frequency modulation action, but firstly the current core The target frequency is compared with the current operating frequency of each of the enabled cores of the processor.
  • the target frequency of the current core is greater than the current operating frequency of each of the enabled cores of the processor, further determining among the open cores of the processor Whether the number of migration processes satisfies a preset condition, and a new core is opened for the processor if the number of migrateable processes in each enabled core of the processor satisfies the preset condition. In this way, the frequency modulation operation of the multi-core processor is combined with the core-opening operation.
  • the target frequency of a certain core is high, it indicates that the core has a heavy load and consumes a large amount of power, which can be mitigated by opening a new core.
  • FIG. 1 is a flow chart of a multi-core processor scheduling method according to an embodiment of the present invention
  • FIG. 2 is a specific flowchart of a multi-core processor scheduling method according to an embodiment of the present invention
  • FIG. 4 is another schematic structural diagram of a multi-core processor scheduling apparatus according to an embodiment of the present invention.
  • an embodiment of the present invention provides a multi-core processor scheduling method, including:
  • the multi-core processor scheduling method provided by the present invention, when the multi-core processor needs to perform frequency adjustment on the current core to achieve the target frequency, does not immediately perform the frequency modulation action, but firstly sets the current core target frequency and the processor. The current running frequencies of the respective enabled cores are respectively compared.
  • the current core target frequency is greater than the current running frequency of each enabled core of the processor, it is further determined whether the number of migrateable processes in each enabled core of the processor is satisfied. Pre-set conditions, open a new core for the processor if the number of migrateable processes in each enabled core of the processor meets the preset conditions. In this way, the frequency modulation operation of the multi-core processor is combined with the core-opening operation.
  • the target frequency of a certain core is high, the load of the core is heavy, and the power consumption is large, which can be mitigated by opening a new core.
  • each core of the processor each core adjusts its running frequency at any time according to the respective load conditions, and the current core refers to any core of the processor that is determining its target frequency.
  • the target frequency of the current core may be determined according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load condition of the processor.
  • the dynamic frequency modulation strategy is related to the load of each core of the processor. For example, when the load of a certain core of the processor is large, the frequency modulation strategy of the dynamic frequency modulation strategy is to raise the working frequency of the core, so that the processing task can be completed at a faster speed, when a certain core of the processor When the load is small, the purpose of the dynamic frequency modulation strategy is to reduce the operating frequency of the core, so as to effectively reduce power consumption while completing its processing tasks.
  • the specific method of increasing the operating frequency or lowering the operating frequency is achieved by periodically setting the target frequency for each core and causing each core to update the operating frequency to the corresponding target frequency according to certain rules.
  • the setting of the target frequency of each core can obtain the load of the core by using the underlying driver, and set a suitable target frequency for the core according to the load. For example, if the load acquired in this cycle is larger than the load acquired in the previous cycle, the corresponding target frequency is set to be larger than the current operating frequency. If the load acquired in this cycle is smaller than the load acquired in the previous cycle, the corresponding The target frequency is set to be smaller than the current operating frequency.
  • the specific value of the target frequency may be a pre-set value related to the load, or may be a value calculated according to the ratio of the load acquired this time and the load acquired in the previous cycle, and may of course be calculated by other methods.
  • the numerical values obtained by the present invention are not limited thereto.
  • the working frequencies of the cores may be the same or different, which is not limited by the embodiment of the present invention.
  • the operating frequencies of the cores are the same and change synchronously, they are multi-frequency multi-core processors.
  • the operating frequencies of the cores are different and the changes may be different, they are inter-frequency multi-core processors. Since the frequencies of the cores of the same-frequency multi-core processor must be changed synchronously and cannot be adjusted separately, it is more likely to cause the processor. The individual core load distributions are unbalanced. Therefore, the multi-core processor scheduling method provided by the embodiment of the present invention has a greater advantage for improving scheduling between intra-frequency multi-cores.
  • the determination of the target frequency and the adjustment of the operating frequency of the core to the target frequency are two steps. That is to say, it is determined that the target frequency of a certain core only determines the frequency to which the core is to be adjusted, and the operating frequency of the core is still the original frequency.
  • the core with too high target frequency since the new core is used to reduce the load for the core with too high target frequency, the core with too high target frequency only needs to work at a lower working frequency. Therefore, the target frequency is too
  • the high core can not adjust the operating frequency to a higher target frequency in this cycle, but adjust the operating frequency to a lower target frequency directly in the next cycle. It can also temporarily adjust the operating frequency to this cycle.
  • the multi-core scheduling method acquires the target frequency of one of the cores, and The core operating frequency is not immediately adjusted to the target frequency, but it is further determined whether the number of migrateable processes in each of the enabled cores of the processor satisfies a preset condition, that is, step S12.
  • the migratable process refers to a process in which each core of the processor can be migrated from the original core to another core.
  • the number of the newly-enabled cores may be one or multiple, and the embodiment of the present invention does not limit this. Determining the number of migrateable processes in each enabled core of the processor according to the load weight difference of each opened core, the load of each core that has been turned on, and the affinity of each enabled core; Specifically, the core of each opened core Sex can be used to count the number of task queues running on each enabled core and the number of task queues not bound to each enabled core. The number of migratable processes can then be determined among these unbound tasks based on the load weight difference of each enabled core and the load condition of each enabled core.
  • the processor is in step S13. Open a new core.
  • the number of migrateable processes may be the total number of migrateable processes of all enabled cores, or the number of each migrateable process in each enabled core, as long as the number of migrateable processes can be used.
  • the embodiment of the present invention does not limit this.
  • the new core is opened under the condition that the number of cores that have been opened is smaller than the total number of cores included in the processor.
  • the new core cannot be opened.
  • the multi-core processor scheduling method provided by the embodiment of the present invention further includes: If the number of migrateable processes in the core does not meet the preset conditions, the processor is scheduled by the processor's original kernel scheduling policy.
  • the method further comprises: migrating at least a part of the migratable processes in the current core to the new core to reduce the load of the current core.
  • the multi-core processor scheduling method includes the following steps:
  • an embodiment of the present invention further provides a multi-core processor scheduling apparatus. As shown in FIG. 3, the apparatus includes: a frequency determining unit 10 configured to determine a target frequency of a current core of the processor, where the target frequency is processed.
  • the operating frequency determined by the current core of the device is adjusted; the process determining unit 12 is further configured to determine that the current core frequency of the current core is greater than the current operating frequency of each enabled core of the processor, and determine that each of the enabled cores of the processor is Whether the number of migration processes satisfies a preset condition; the opening unit 14 is configured to open a new core for the processor if the process determination unit 12 determines that the number of migratable processes in each of the enabled cores of the processor satisfies a preset condition.
  • the multi-core processor scheduling apparatus when the frequency determining unit 10 determines that the current core needs to be frequency-adjusted to reach the target frequency, does not immediately perform the frequency-modulating action, but firstly, the process determining unit 12 sets the current core target. The frequency is compared with the current operating frequency of each of the enabled cores of the processor. If the target frequency of the current core is greater than the current operating frequency of each of the enabled cores of the processor, further determining the migratable in each enabled core of the processor Whether the number of processes satisfies a preset condition, and when the number of migrateable processes in each enabled core of the processor satisfies a preset condition, the opening unit 14 opens a new core for the processor.
  • the frequency modulation operation of the multi-core processor is combined with the core-opening operation.
  • the target frequency of a certain core is high, it indicates that the core has a heavy load and consumes a large amount of power, which can be mitigated by opening a new core.
  • the load on the core with heavier load can not only fully utilize the parallel processing capability of the multi-core processor, but also increase the load distribution equalization probability between multiple cores, so that each core maintains the multi-core low-frequency operation state. Ensure that the processor has high processing performance while effectively reducing the power consumption of the processor.
  • the frequency determining unit 10 may be specifically configured to determine a target frequency of the current core according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load of the processor.
  • the process determining unit 12 may specifically include: a load weight difference determining module, configured to determine a load weight difference of each opened core according to a load of each opened core and an average load of each core after the core is opened; The determining module is configured to determine, according to the load weight difference, a load weight difference of each opened core determined by the module, a load of each opened core, and an affinity of each opened core, and determine a migrationable in each opened core of the processor.
  • the apparatus may further include: a migration unit 16, configured to migrate at least a part of the migratable processes in the current core to the new core after the new core is opened for the processor Reduce the load on the current core.
  • the embodiment of the present invention further provides a terminal, which includes any of the multi-core processor scheduling devices provided by the foregoing embodiments, and thus can achieve corresponding beneficial effects.
  • a multi-core processor scheduling method, apparatus, and terminal provided by an embodiment of the present invention have the following beneficial effects: Fully exploit the parallel processing capability of a multi-core processor, and make a load distribution equalization probability between multiple cores Increase, so that each core maintains the multi-core low-frequency operation state, which ensures the processor has high processing performance while effectively reducing the power consumption of the processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The present invention relates to the technical field of communications. Provided are a multi-core processor scheduling method and apparatus, and a terminal, so as to solve the defect in a related art that considerations cannot be given to performance and power consumption of a multi-core processor at the same time. The method comprises: determining a target frequency of a current core of a processor, the target frequency being an operating frequency adjusted under a request of the current core of the processor; if the target frequency of the current core is higher than current operating frequencies of started cores of the processor, determining whether the number of migratable processes in the started cores of the processor meets a preset condition; and starting a new core for the processor in a case in which the number of migratable processes in the started cores of the processor meets the preset condition. The present invention can be used in all kinds of multi-core processors.

Description

一种多核处理器调度方法、 装置及终端 技术领域 本发明涉及通信技术领域, 特别是涉及一种多核处理器调度方法、 装置及终端。 背景技术 随着智能移动终端的发展和应用的不断丰富, 智能移动终端的处理器核心开始从 单核向双核、 四核乃至八核发展, 从而为大型游戏和多线程应用的运行提供了更为良 好的运行条件。 为了提高用户体验, 复杂程序的运行往往需要较快的处理器运行速度作为保障, 也就是需要处理器具有较高的频率, 而这又有种种弊端: 不但会大大增加处理器的功 耗, 还容易使多核处理器的各个核心之间的负载彼此不平衡, 导致处理器的一些核心 频率过快、功耗过大而另一些处理器核心则负载较小、 白白的浪费处理器资源。 总之, 多核处理器性能和功耗不能兼顾。 发明内容 本发明要解决的技术问题是提供一种多核处理器调度方法、 装置及终端, 用以解 决相关技术中多核处理器性能和功耗不能兼顾的弊端。 为达上述目的, 一方面, 本发明提供一种多核处理器调度方法, 包括: 确定处理 器的当前核心的目标频率, 所述目标频率为所述处理器的当前核心所请求调整到的运 行频率; 如果所述当前核心的目标频率大于所述处理器的各个已开启核心的当前运行 频率, 确定所述处理器的各个已开启核心中的可迁移进程数是否满足预设条件; 在所 述处理器的各个已开启核心中的可迁移进程数满足所述预设条件的情况下, 为所述处 理器开启新的核心。 可选的, 所述确定处理器的当前核心的目标频率包括: 根据所述处理器的动态调 频策略确定所述当前核心的目标频率, 所述动态调频策略与所述处理器的负载相关。 可选的, 所述确定所述处理器的各个已开启核心中的可迁移进程数是否满足预设 条件包括: 根据所述各个已开启核心的负载与开启新的核心后各个核心的平均负载, 确定所述各个已开启核心的负载权重差; 根据所述各个已开启核心的负载权重差、 所 述各个已开启核心的负载以及所述各个已开启核心的亲和性, 确定所述处理器的各个 已开启核心中的可迁移进程数; 确定所述可迁移进程数是否大于预设阈值, 或者确定 所述可迁移进程数与已开启核心数的比值是否大于预设比例。 优选地, 所述确定所述处理器的各个已开启核心中的可迁移进程数是否满足预设 条件之后, 所述方法还包括: 在所述处理器的各个已开启核心中的可迁移进程数不满 足所述预设条件的情况下, 通过所述处理器原有的内核调度策略调度所述处理器。 优选地, 为所述处理器开启新的核心之后, 所述方法还包括: 将所述当前核心中 的可迁移进程中的至少一部分迁移至所述新的核心中以减小所述当前核心的负载。 另一方面, 本发明的实施例还提供一种多核处理器调度装置, 包括: 频率确定单 元, 设置为确定处理器的当前核心的目标频率, 所述目标频率为所述处理器的当前核 心所请求调整到的运行频率; 进程确定单元, 还设置为如果所述当前核心的目标频率 大于所述处理器的各个已开启核心的当前运行频率, 确定所述处理器的各个已开启核 心中的可迁移进程数是否满足预设条件; 开启单元, 设置为在所述进程确定单元确定 所述处理器的各个已开启核心中的可迁移进程数满足所述预设条件的情况下, 为所述 处理器开启新的核心。 可选的, 所述频率确定单元具体设置为根据所述处理器的动态调频策略确定所述 当前核心的目标频率, 所述动态调频策略与所述处理器的负载相关。 可选的, 所述进程确定单元具体包括: 负载权重差确定模块, 设置为根据所述各 个已开启核心的负载与开核后各个核心的平均负载, 确定所述各个已开启核心的负载 权重差; 可迁移进程确定模块, 设置为根据所述负载权重差确定模块确定的所述各个 已开启核心的负载权重差、 所述各个已开启核心的负载以及所述各个已开启核心的亲 和性, 确定所述处理器的各个已开启核心中的可迁移进程数; 比较模块, 设置为确定 所述可迁移进程数是否大于预设阈值, 或者确定所述可迁移进程数与已开启核心数的 比值是否大于预设比例。 可选的, 所述装置还包括: 迁移单元, 设置为在为所述处理器开启新的核心之后, 将所述当前核心中的可迁移进程中的至少一部分迁移至所述新的核心中以减小所述当 前核心的负载。 另一方面, 本发明的实施例还提供一种终端, 所述终端包括本发明提供的任一种 多核处理器调度装置。 本发明提供的多核处理器调度方法、 装置及终端, 当多核处理器调度过程中需要 对某个核心进行频率调整以达到目标频率时, 并不立即执行该调频动作, 而是首先将 当前核心的目标频率与处理器的各个已开启核心的当前运行频率分别进行比较, 如果 当前核心的目标频率大于处理器的各个已开启核心的当前运行频率, 则进一步确定处 理器的各个已开启核心中的可迁移进程数是否满足预设条件, 在所述处理器的各个已 开启核心中的可迁移进程数满足所述预设条件的情况下, 为处理器开启新的核心。 这 样就将多核处理器的调频操作与开核操作结合起来, 当某个核心的目标频率较高时, 说明该核心的负载较重, 运行起来功耗较大, 可以通过开启新的核心来减轻具有较重 负载的核心上的负载, 不仅能充分发挥多核处理器的并行处理能力, 而且使得多个核 心之间的负载分配均衡概率加大, 从而使各个核心保持在多核低频的运行状态, 在保 证处理器具有较高处理性能的同时有效降低了处理器的功耗。 附图说明 图 1是本发明的实施例提供的多核处理器调度方法的一种流程图; 图 2是本发明的实施例提供的多核处理器调度方法的一种具体流程图; 图 3是本发明的实施例提供的多核处理器调度装置的一种结构示意图; 图 4是本发明的实施例提供的多核处理器调度装置的另一种结构示意图。 具体实施方式 以下结合附图, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实 施例仅仅用以解释本发明, 并不限定本发明。 如图 1所示, 本发明的实施例提供一种多核处理器调度方法, 包括: The present invention relates to the field of communications technologies, and in particular, to a multi-core processor scheduling method, apparatus, and terminal. BACKGROUND With the development and application of intelligent mobile terminals, the processor core of intelligent mobile terminals has begun to evolve from single core to dual core, quad core and even eight core, thereby providing more operation for large games and multi-threaded applications. Good operating conditions. In order to improve the user experience, the operation of complex programs often requires faster processor speed as a guarantee, that is, the processor needs to have a higher frequency, and this has various drawbacks: not only greatly increases the power consumption of the processor, but also It is easy to make the load between the cores of the multi-core processor unbalanced with each other, causing some core frequencies of the processor to be too fast, excessive power consumption, and other processor cores to load less and waste processor resources in vain. In short, multi-core processor performance and power consumption can not be balanced. SUMMARY OF THE INVENTION The technical problem to be solved by the present invention is to provide a multi-core processor scheduling method, apparatus, and terminal, which are used to solve the disadvantages of the multi-core processor performance and power consumption in the related art. To achieve the above objective, in one aspect, the present invention provides a multi-core processor scheduling method, including: determining a target frequency of a current core of a processor, where the target frequency is an operating frequency that is requested by a current core of the processor. Determining whether the number of migratable processes in each enabled core of the processor meets a preset condition if the target frequency of the current core is greater than a current operating frequency of each enabled core of the processor; In the case where the number of migrateable processes in each of the enabled cores of the device satisfies the preset condition, a new core is opened for the processor. Optionally, determining the target frequency of the current core of the processor includes: determining a target frequency of the current core according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load of the processor. Optionally, determining whether the number of the migrateable processes in each enabled core of the processor meets the preset condition comprises: according to the load of each opened core and the average load of each core after starting a new core, Determining a load weight difference of each of the turned-on cores; determining, according to load weight differences of the respective turned-on cores, loads of the respective turned-on cores, and affinity of the respective turned-on cores, determining the processor Each The number of the migrateable processes in the core is turned on; whether the number of the migrateable processes is greater than a preset threshold, or whether the ratio of the number of the migrateable processes to the number of cores that are turned on is greater than a preset ratio. Preferably, after determining whether the number of migrateable processes in each enabled core of the processor meets a preset condition, the method further includes: a number of migrateable processes in each enabled core of the processor If the preset condition is not met, the processor is scheduled by the original kernel scheduling policy of the processor. Preferably, after the new core is opened for the processor, the method further includes: migrating at least a part of the migratable processes in the current core to the new core to reduce the current core load. In another aspect, an embodiment of the present invention further provides a multi-core processor scheduling apparatus, including: a frequency determining unit, configured to determine a target frequency of a current core of the processor, where the target frequency is a current core of the processor Requesting the adjusted operating frequency; the process determining unit is further configured to determine, if the target frequency of the current core is greater than a current operating frequency of each enabled core of the processor, determining that each of the enabled cores of the processor is Whether the number of migration processes satisfies a preset condition; the opening unit is configured to, when the process determining unit determines that the number of migrateable processes in each enabled core of the processor satisfies the preset condition, Open a new core. Optionally, the frequency determining unit is specifically configured to determine a target frequency of the current core according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load of the processor. Optionally, the process determining unit specifically includes: a load weight difference determining module, configured to determine, according to the load of each opened core and an average load of each core after the core is opened, determine a load weight difference of each opened core And a loadable process determining module, configured to determine, according to the load weight difference determining module, a load weight difference of the each opened core, a load of each opened core, and an affinity of each opened core, Determining a number of migrateable processes in each of the enabled cores of the processor; and comparing the module, determining whether the number of the migrateable processes is greater than a preset threshold, or determining a ratio of the number of migrateable processes to the number of cores that have been turned on Whether it is greater than the preset ratio. Optionally, the device further includes: a migration unit, configured to migrate at least a part of the migratable processes in the current core to the new core after opening a new core for the processor The load of the current core is reduced. In another aspect, an embodiment of the present invention further provides a terminal, where the terminal includes any multi-core processor scheduling apparatus provided by the present invention. The multi-core processor scheduling method, device and terminal provided by the invention, when the multi-core processor needs to perform frequency adjustment on a certain core to achieve the target frequency, does not immediately perform the frequency modulation action, but firstly the current core The target frequency is compared with the current operating frequency of each of the enabled cores of the processor. If the target frequency of the current core is greater than the current operating frequency of each of the enabled cores of the processor, further determining among the open cores of the processor Whether the number of migration processes satisfies a preset condition, and a new core is opened for the processor if the number of migrateable processes in each enabled core of the processor satisfies the preset condition. In this way, the frequency modulation operation of the multi-core processor is combined with the core-opening operation. When the target frequency of a certain core is high, it indicates that the core has a heavy load and consumes a large amount of power, which can be mitigated by opening a new core. The load on the core with heavier load can not only fully utilize the parallel processing capability of the multi-core processor, but also increase the load distribution equalization probability between multiple cores, so that each core maintains the multi-core low-frequency operation state. Ensure that the processor has high processing performance while effectively reducing the power consumption of the processor. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a flow chart of a multi-core processor scheduling method according to an embodiment of the present invention; FIG. 2 is a specific flowchart of a multi-core processor scheduling method according to an embodiment of the present invention; A schematic diagram of a structure of a multi-core processor scheduling apparatus provided by an embodiment of the present invention; FIG. 4 is another schematic structural diagram of a multi-core processor scheduling apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION The present invention will be further described in detail below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. As shown in FIG. 1, an embodiment of the present invention provides a multi-core processor scheduling method, including:
511 ,确定处理器的当前核心的目标频率,该目标频率为处理器的当前核心所请求 调整到的运行频率; 511. Determine a target frequency of a current core of the processor, where the target frequency is an operating frequency that is requested by a current core of the processor;
512,如果当前核心的目标频率大于处理器的各个已开启核心的当前运行频率,确 定处理器的各个已开启核心中的可迁移进程数是否满足预设条件; S13 ,在处理器的各个已开启核心中的可迁移进程数满足预设条件的情况下,为处 理器开启新的核心。 本发明提供的多核处理器调度方法, 当多核处理器调度过程中需要对当前核心进 行频率调整以达到目标频率时, 并不立即执行该调频动作, 而是首先将当前核心的目 标频率与处理器的各个已开启核心的当前运行频率分别进行比较, 如果当前核心的目 标频率大于处理器的各个已开启核心的当前运行频率, 则进一步确定处理器的各个已 开启核心中的可迁移进程数是否满足预设条件, 在处理器的各个已开启核心中的可迁 移进程数满足预设条件的情况下, 为处理器开启新的核心。 这样就将多核处理器的调 频操作与开核操作结合起来, 当某个核心的目标频率较高时,说明该核心的负载较重, 运行起来功耗较大, 可以通过开启新的核心来减轻具有较重负载的核心上的负载, 不 仅能充分发挥多核处理器的并行处理能力, 而且使得多个核心之间的负载分配均衡概 率加大, 从而使各个核心保持在多核低频的运行状态, 在保证处理器具有较高处理性 能的同时有效降低了处理器的功耗。 其中, 处理器的多个核心中, 每个核心都会根据各自的负载情况, 随时调整各自 的运行频率, 而当前核心即是指处理器中任何一个正在确定其目标频率的核心。 步骤 S11中, 可以根据处理器的动态调频策略确定当前核心的目标频率, 该动态 调频策略与处理器的负载情况相关。 具体对多核处理器而言, 动态调频策略与处理器 的每个核心的负载相关。 例如, 当处理器的某个核心的负载较大时, 动态调频策略的 调频宗旨就是升高该核心的工作频率, 以便能够以较快的速度完成其处理任务, 当处 理器的某个核心的负载较小时, 动态调频策略的宗旨就是降低该核心的工作频率, 以 便在完成其处理任务的同时有效降低功耗。 升高工作频率或降低工作频率的具体方法 是通过周期性地为每个核心设置目标频率, 并使各个核心按照一定的规则将工作频率 更新为对应的目标频率来实现。 可选的, 每个核心的目标频率的设置都可以借助底层 驱动来获取该核心的负载, 并根据该负载为该核心设置一个合适的目标频率。 例如, 如果本周期获取的负载比上个周期获取的负载大, 则将对应的目标频率设置成比当前 工作频率大, 如果本周期获取的负载比上个周期获取的负载小, 则将对应的目标频率 设置成比当前工作频率小。 目标频率的具体数值即可以是预先设置好的与负载相关的 数值, 也可以是根据本次获取的负载与上个周期获取的负载的比值计算而得的值, 当 然还可以是通过其他方法计算而得的数值, 本发明的实施例对此不做限制。 可选的, 在多核处理器中, 各个核心的工作频率可以相同, 也可以不同, 本发明 的实施例对此不作限定。当各个核心的工作频率相同且同步变化时为同频多核处理器, 当各个核心的工作频率不同且变化也可以不相同时为异频多核处理器。 由于同频多核 处理器的各个核心的频率必须同步变化, 无法单独进行调节, 因此更容易导致处理器 的各个核心负载分配不平衡。 因而, 本发明实施例提供的多核处理器调度方法对于改 进同频多核之间的调度具有更大的优势。 需要说明的是, 对每个核心而言, 目标频率的确定与将该核心的工作频率调整成 该目标频率是两个步骤。 也就是说, 确定了某个核心的目标频率只是确定了下一步欲 将该核心调整到的频率, 而此时该核心的工作频率仍然是原频率。 本实施例中, 既然 已经通过开启新的核心来为目标频率过高的核心减轻负载, 那么该目标频率过高的核 心就只需要以较低的工作频率工作即可, 因此, 该目标频率过高的核心既可以在本周 期中不将工作频率调整为较高的目标频率, 而直接在下个周期中将工作频率调整为较 低的目标频率, 也可以在本周期中暂时将工作频率调整到该较高的工作频率, 然后在 下个周期中将工作频率调整为较低的目标频率。 为了更好地利用处理器中各个核心的处理能力, 使处理器的性能和功耗达到良好 的折中, 本发明实施例提供的多核调度方法, 在获取其中某个核心的目标频率之后, 并不立即将该核心的运行频率调整到该目标频率, 而是进一步确定处理器的各个已开 启核心中的可迁移进程数是否满足预设条件, 即步骤 S12。 其中, 可迁移进程是指处 理器的各个核心中可以从原来的核心迁移到其他核心的进程。 由于只有可并行处理的 应用才适于采用多个核心来运行, 因此, 多核处理器中的应用中应包括尽可能多的可 并行处理的进程或线程, 这是具有可迁移进程的基础。 确定处理器的各个已开启核心中的可迁移进程数是否满足预设条件可包括如下步 骤: 根据各个已开启核心的负载与开启新的核心后各个核心的平均负载, 确定各个已 开启核心的负载权重差;其中,开启新的核心后各个核心的平均负载=已开启核心的平 均负载 X已开启核心数 ÷ (已开启核心数 +新开启核心数); 各个已开启核心的负载权 重差 =各个已开启核心的负载 -开启新的核心后各个核心的平均负载。 可选的, 新开启 核心数既可以是一个, 也可以是多个, 本发明的实施例对此不做限制。 根据各个已开启核心的负载权重差、 各个已开启核心的负载以及各个已开启核心 的亲和性, 确定处理器的各个已开启核心中的可迁移进程数; 具体的, 各个已开启核 心的亲和性可以用来计算各个已开启核心上运行的任务队列数及未与各个已开启核心 绑定的任务队列数。 然后可以根据各个已开启核心的负载权重差和各个已开启核心的 负载情况, 在这些未绑定的任务中确定可迁移进程数。 确定可迁移进程数是否大于预设阈值, 或者确定可迁移进程数与已开启核心数的 比值是否大于预设比例。 其中, 可迁移进程数大于预设阈值, 或者可迁移进程数与已 开启核心数的比值大于预设比例, 即为步骤 S12和 S13中的预设条件。 当可迁移进程 数满足该预设条件时, 即当可迁移进程数大于预设阈值, 或者可迁移进程数与已开启 核心数的比值大于预设比例时, 在步骤 S13中就为该处理器开启新的核心。 需要说明的是, 上述实施例中, 可迁移进程数既可以为所有已开启核心的可迁移 进程总数, 也可以为各个已开启核心中各自的可迁移进程数, 只要该可迁移进程数能 够用于确定是否需要开启新的核心即可, 本发明的实施例对此不作限制。 为了更有效 的减轻目标频率较高的核心的负载, 优选的, 可以仅根据该目标频率较高的核心中的 可迁移进程数来确定是否开启新的核心。 例如, 当该目标频率较高的核心中的可迁移 进程数大于预设阈值时, 就为该处理器开启新的核心。 当然, 开启新的核心是在已开启的核心数小于处理器所包括的总核心数的条件下 进行的, 当处理器中的所有核心都已经开启时, 就不能开启新的核心了。 优选地, 在步骤 S12的确定处理器的各个已开启核心中的可迁移进程数是否满足 预设条件之后, 本发明的实施例提供的多核处理器调度方法还包括: 在处理器的各个 已开启核心中的可迁移进程数不满足预设条件的情况下, 通过处理器原有的内核调度 策略调度处理器。 也就是说, 当当前核心的目标频率大于处理器的各个已开启核心的 当前运行频率,但处理器的各个已开启核心中的可迁移进程数并不满足上述预设条件, 那么也不为该处理器开启新的核心。 这是由于开启新的核心以及在各个核心之间进行 任务调度也是需要耗费资源、 付出代价的。 如果确定开启新的核心和任务调度的代价 过高, 那么只需沿用处理器原有的调度方法即可。 优选地, 为处理器开启新的核心之后, 该方法还包括: 将当前核心中的可迁移进 程中的至少一部分迁移至新的核心中以减小当前核心的负载。 可选的, 还可以将其他 已开启核心的可迁移进程中的至少一部分迁移至新的核心中, 从而使处理器的各个核 心负载均衡, 且都工作在较低的频率上, 在保持处理器具有较高性能的同时有效降低 了处理器的功耗。 下面通过具体的实施例对本发明实施例提供的多核处理器调度方法进行详细说 明。 如图 2所示, 本实施例中, 多核处理器调度方法包括如下步骤: 512. If the target frequency of the current core is greater than a current running frequency of each enabled core of the processor, determine whether the number of migrateable processes in each enabled core of the processor meets a preset condition; S13, each of the processors is enabled. When the number of migrateable processes in the core meets the preset conditions, a new core is opened for the processor. The multi-core processor scheduling method provided by the present invention, when the multi-core processor needs to perform frequency adjustment on the current core to achieve the target frequency, does not immediately perform the frequency modulation action, but firstly sets the current core target frequency and the processor. The current running frequencies of the respective enabled cores are respectively compared. If the current core target frequency is greater than the current running frequency of each enabled core of the processor, it is further determined whether the number of migrateable processes in each enabled core of the processor is satisfied. Pre-set conditions, open a new core for the processor if the number of migrateable processes in each enabled core of the processor meets the preset conditions. In this way, the frequency modulation operation of the multi-core processor is combined with the core-opening operation. When the target frequency of a certain core is high, the load of the core is heavy, and the power consumption is large, which can be mitigated by opening a new core. The load on the core with heavier load can not only fully utilize the parallel processing capability of the multi-core processor, but also increase the load distribution equalization probability between multiple cores, so that each core maintains the multi-core low-frequency operation state. Ensure that the processor has high processing performance while effectively reducing the power consumption of the processor. Among them, each core of the processor, each core adjusts its running frequency at any time according to the respective load conditions, and the current core refers to any core of the processor that is determining its target frequency. In step S11, the target frequency of the current core may be determined according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load condition of the processor. Specifically for multi-core processors, the dynamic frequency modulation strategy is related to the load of each core of the processor. For example, when the load of a certain core of the processor is large, the frequency modulation strategy of the dynamic frequency modulation strategy is to raise the working frequency of the core, so that the processing task can be completed at a faster speed, when a certain core of the processor When the load is small, the purpose of the dynamic frequency modulation strategy is to reduce the operating frequency of the core, so as to effectively reduce power consumption while completing its processing tasks. The specific method of increasing the operating frequency or lowering the operating frequency is achieved by periodically setting the target frequency for each core and causing each core to update the operating frequency to the corresponding target frequency according to certain rules. Optionally, the setting of the target frequency of each core can obtain the load of the core by using the underlying driver, and set a suitable target frequency for the core according to the load. For example, if the load acquired in this cycle is larger than the load acquired in the previous cycle, the corresponding target frequency is set to be larger than the current operating frequency. If the load acquired in this cycle is smaller than the load acquired in the previous cycle, the corresponding The target frequency is set to be smaller than the current operating frequency. The specific value of the target frequency may be a pre-set value related to the load, or may be a value calculated according to the ratio of the load acquired this time and the load acquired in the previous cycle, and may of course be calculated by other methods. The numerical values obtained by the present invention are not limited thereto. Optionally, in the multi-core processor, the working frequencies of the cores may be the same or different, which is not limited by the embodiment of the present invention. When the operating frequencies of the cores are the same and change synchronously, they are multi-frequency multi-core processors. When the operating frequencies of the cores are different and the changes may be different, they are inter-frequency multi-core processors. Since the frequencies of the cores of the same-frequency multi-core processor must be changed synchronously and cannot be adjusted separately, it is more likely to cause the processor. The individual core load distributions are unbalanced. Therefore, the multi-core processor scheduling method provided by the embodiment of the present invention has a greater advantage for improving scheduling between intra-frequency multi-cores. It should be noted that for each core, the determination of the target frequency and the adjustment of the operating frequency of the core to the target frequency are two steps. That is to say, it is determined that the target frequency of a certain core only determines the frequency to which the core is to be adjusted, and the operating frequency of the core is still the original frequency. In this embodiment, since the new core is used to reduce the load for the core with too high target frequency, the core with too high target frequency only needs to work at a lower working frequency. Therefore, the target frequency is too The high core can not adjust the operating frequency to a higher target frequency in this cycle, but adjust the operating frequency to a lower target frequency directly in the next cycle. It can also temporarily adjust the operating frequency to this cycle. This higher operating frequency then adjusts the operating frequency to a lower target frequency in the next cycle. In order to make better use of the processing power of each core in the processor to achieve a good compromise between the performance and the power consumption of the processor, the multi-core scheduling method provided by the embodiment of the present invention acquires the target frequency of one of the cores, and The core operating frequency is not immediately adjusted to the target frequency, but it is further determined whether the number of migrateable processes in each of the enabled cores of the processor satisfies a preset condition, that is, step S12. Among them, the migratable process refers to a process in which each core of the processor can be migrated from the original core to another core. Since only parallel-processable applications are suitable for running with multiple cores, applications in multi-core processors should include as many processes or threads as possible that can be processed in parallel, which is the basis for a migratable process. Determining whether the number of migratable processes in each enabled core of the processor meets the preset condition may include the following steps: determining the load of each opened core according to the load of each opened core and the average load of each core after starting a new core The weight difference; among them, the average load of each core after opening a new core = the average load of the opened core X has opened the core number ÷ (the number of cores opened + the number of newly opened cores); the load weight difference of each open core = each The core load has been turned on - the average load of each core after opening a new core. Optionally, the number of the newly-enabled cores may be one or multiple, and the embodiment of the present invention does not limit this. Determining the number of migrateable processes in each enabled core of the processor according to the load weight difference of each opened core, the load of each core that has been turned on, and the affinity of each enabled core; Specifically, the core of each opened core Sex can be used to count the number of task queues running on each enabled core and the number of task queues not bound to each enabled core. The number of migratable processes can then be determined among these unbound tasks based on the load weight difference of each enabled core and the load condition of each enabled core. Determine whether the number of migrateable processes is greater than a preset threshold, or determine whether the ratio of the number of migrateable processes to the number of cores that have been turned on is greater than a preset ratio. The number of migrateable processes is greater than a preset threshold, or the number of migrateable processes is The ratio of the number of open cores is greater than the preset ratio, which is the preset condition in steps S12 and S13. When the number of migrating processes meets the preset condition, that is, when the number of migtable processes is greater than a preset threshold, or the ratio of the number of migtable processes to the number of cores that have been turned on is greater than a preset ratio, the processor is in step S13. Open a new core. It should be noted that, in the foregoing embodiment, the number of migrateable processes may be the total number of migrateable processes of all enabled cores, or the number of each migrateable process in each enabled core, as long as the number of migrateable processes can be used. In order to determine whether a new core needs to be opened, the embodiment of the present invention does not limit this. In order to more effectively alleviate the load of the core with a higher target frequency, it is preferable to determine whether to open a new core based only on the number of migrateable processes in the core with the higher target frequency. For example, when the number of migrateable processes in the core with a higher target frequency is greater than a preset threshold, a new core is opened for the processor. Of course, the new core is opened under the condition that the number of cores that have been opened is smaller than the total number of cores included in the processor. When all the cores in the processor are already turned on, the new core cannot be opened. Preferably, after determining whether the number of the removable processes in the respective enabled cores of the processor meets the preset condition in the step S12, the multi-core processor scheduling method provided by the embodiment of the present invention further includes: If the number of migrateable processes in the core does not meet the preset conditions, the processor is scheduled by the processor's original kernel scheduling policy. That is, when the target frequency of the current core is greater than the current operating frequency of each enabled core of the processor, but the number of migrateable processes in each enabled core of the processor does not satisfy the above preset condition, then the The processor turns on the new core. This is due to the fact that opening a new core and scheduling tasks between cores also consumes resources and costs. If it is determined that the cost of starting a new core and task scheduling is too high, then it is only necessary to follow the original scheduling method of the processor. Preferably, after the new core is opened for the processor, the method further comprises: migrating at least a part of the migratable processes in the current core to the new core to reduce the load of the current core. Optionally, at least a part of the other core-capable migration processes can also be migrated to the new core, so that the core loads of the processor are balanced, and all work at a lower frequency, while maintaining the processor It has higher performance while effectively reducing the power consumption of the processor. The multi-core processor scheduling method provided by the embodiment of the present invention is described in detail below through a specific embodiment. As shown in FIG. 2, in this embodiment, the multi-core processor scheduling method includes the following steps:
101.根据处理器的调频策略确定当前核心所需的目标频率, 执行 102; 101. Determine a target frequency required by the current core according to a frequency modulation policy of the processor, and execute 102;
102.根据目标频率上报调频请求, 执行 103 ; 103.确定目标频率是否大于处理器的各个已开启核心的当前运行频率, 如果是, 执行 104, 如果否, 执行 106; 102. Reporting the FM request according to the target frequency, performing 103; 103. Determine whether the target frequency is greater than a current operating frequency of each of the enabled cores of the processor, and if so, execute 104, if no, execute 106;
104.确定当前核心中可迁移进程数是否大于预设阈值,如果是,执行 105,如果否, 执行 106;  104. Determine whether the number of migrateable processes in the current core is greater than a preset threshold, if yes, execute 105, if not, execute 106;
105. 开启新的核心并将处理器中的任务平均分配到各个已开启的核心中;  105. Open a new core and evenly distribute the tasks in the processor to each of the enabled cores;
106.按照原有的内核调度算法进行调度。 相应的, 本发明的实施例还提供一种多核处理器调度装置, 如图 3所示, 该装置 包括: 频率确定单元 10, 设置为确定处理器的当前核心的目标频率, 该目标频率为处理 器的当前核心所请求调整到的运行频率; 进程确定单元 12, 还设置为如果当前核心的目标频率大于处理器的各个已开启核 心的当前运行频率, 确定处理器的各个已开启核心中的可迁移进程数是否满足预设条 件; 开启单元 14, 设置为在进程确定单元 12确定处理器的各个已开启核心中的可迁 移进程数满足预设条件的情况下, 为处理器开启新的核心。 本发明提供的多核处理器调度装置,当频率确定单元 10确定需要对当前核心进行 频率调整以达到目标频率时, 并不立即执行该调频动作, 而是首先由进程确定单元 12 将当前核心的目标频率与处理器的各个已开启核心的当前运行频率分别进行比较, 如 果当前核心的目标频率大于处理器的各个已开启核心的当前运行频率, 则进一步确定 处理器的各个已开启核心中的可迁移进程数是否满足预设条件, 在处理器的各个已开 启核心中的可迁移进程数满足预设条件的情况下,才由开启单元 14为处理器开启新的 核心。 这样就将多核处理器的调频操作与开核操作结合起来, 当某个核心的目标频率 较高时, 说明该核心的负载较重, 运行起来功耗较大, 可以通过开启新的核心来减轻 具有较重负载的核心上的负载, 不仅能充分发挥多核处理器的并行处理能力, 而且使 得多个核心之间的负载分配均衡概率加大, 从而使各个核心保持在多核低频的运行状 态, 在保证处理器具有较高处理性能的同时有效降低了处理器的功耗。 频率确定单元 10 可具体设置为根据处理器的动态调频策略确定当前核心的目标 频率, 该动态调频策略与处理器的负载相关。 可选的, 进程确定单元 12具体可包括: 负载权重差确定模块, 设置为根据各个已开启核心的负载与开核后各个核心的平 均负载, 确定各个已开启核心的负载权重差; 可迁移进程确定模块, 设置为根据负载权重差确定模块确定的各个已开启核心的 负载权重差、 各个已开启核心的负载以及各个已开启核心的亲和性, 确定处理器的各 个已开启核心中的可迁移进程数; 比较模块, 设置为确定可迁移进程数是否大于预设阈值, 或者确定可迁移进程数 与已开启核心数的比值是否大于预设比例。 优选地, 如图 4所示, 该装置还可包括: 迁移单元 16, 设置为在为处理器开启新 的核心之后, 将当前核心中的可迁移进程中的至少一部分迁移至新的核心中以减小当 前核心的负载。 相应的, 本发明的实施例还提供一种终端, 该终端包括上述实施例提供的任一种 多核处理器调度装置, 因此也能达到相应的有益效果。 尽管为示例目的, 已经公开了本发明的优选实施例, 本领域的技术人员将意识到 各种改进、 增加和取代也是可能的, 因此, 本发明的范围应当不限于上述实施例。 工业实用性 如上所述, 本发明实施例提供的一种多核处理器调度方法、 装置及终端具有以下 有益效果: 充分发挥多核处理器的并行处理能力, 使得多个核心之间的负载分配均衡 概率加大, 从而使各个核心保持在多核低频的运行状态, 在保证处理器具有较高处理 性能的同时有效降低了处理器的功耗。 106. Perform scheduling according to the original kernel scheduling algorithm. Correspondingly, an embodiment of the present invention further provides a multi-core processor scheduling apparatus. As shown in FIG. 3, the apparatus includes: a frequency determining unit 10 configured to determine a target frequency of a current core of the processor, where the target frequency is processed. The operating frequency determined by the current core of the device is adjusted; the process determining unit 12 is further configured to determine that the current core frequency of the current core is greater than the current operating frequency of each enabled core of the processor, and determine that each of the enabled cores of the processor is Whether the number of migration processes satisfies a preset condition; the opening unit 14 is configured to open a new core for the processor if the process determination unit 12 determines that the number of migratable processes in each of the enabled cores of the processor satisfies a preset condition. The multi-core processor scheduling apparatus provided by the present invention, when the frequency determining unit 10 determines that the current core needs to be frequency-adjusted to reach the target frequency, does not immediately perform the frequency-modulating action, but firstly, the process determining unit 12 sets the current core target. The frequency is compared with the current operating frequency of each of the enabled cores of the processor. If the target frequency of the current core is greater than the current operating frequency of each of the enabled cores of the processor, further determining the migratable in each enabled core of the processor Whether the number of processes satisfies a preset condition, and when the number of migrateable processes in each enabled core of the processor satisfies a preset condition, the opening unit 14 opens a new core for the processor. In this way, the frequency modulation operation of the multi-core processor is combined with the core-opening operation. When the target frequency of a certain core is high, it indicates that the core has a heavy load and consumes a large amount of power, which can be mitigated by opening a new core. The load on the core with heavier load can not only fully utilize the parallel processing capability of the multi-core processor, but also increase the load distribution equalization probability between multiple cores, so that each core maintains the multi-core low-frequency operation state. Ensure that the processor has high processing performance while effectively reducing the power consumption of the processor. The frequency determining unit 10 may be specifically configured to determine a target frequency of the current core according to a dynamic frequency modulation policy of the processor, where the dynamic frequency modulation policy is related to a load of the processor. Optionally, the process determining unit 12 may specifically include: a load weight difference determining module, configured to determine a load weight difference of each opened core according to a load of each opened core and an average load of each core after the core is opened; The determining module is configured to determine, according to the load weight difference, a load weight difference of each opened core determined by the module, a load of each opened core, and an affinity of each opened core, and determine a migrationable in each opened core of the processor. The number of processes; the comparison module is set to determine whether the number of migrateable processes is greater than a preset threshold, or whether the ratio of the number of migrateable processes to the number of cores that have been turned on is greater than a preset ratio. Preferably, as shown in FIG. 4, the apparatus may further include: a migration unit 16, configured to migrate at least a part of the migratable processes in the current core to the new core after the new core is opened for the processor Reduce the load on the current core. Correspondingly, the embodiment of the present invention further provides a terminal, which includes any of the multi-core processor scheduling devices provided by the foregoing embodiments, and thus can achieve corresponding beneficial effects. While the preferred embodiments of the present invention have been disclosed for purposes of illustration, those skilled in the art will recognize that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above. Industrial Applicability As described above, a multi-core processor scheduling method, apparatus, and terminal provided by an embodiment of the present invention have the following beneficial effects: Fully exploit the parallel processing capability of a multi-core processor, and make a load distribution equalization probability between multiple cores Increase, so that each core maintains the multi-core low-frequency operation state, which ensures the processor has high processing performance while effectively reducing the power consumption of the processor.

Claims

权 利 要 求 书 、 一种多核处理器调度方法, 包括: Claims, a multi-core processor scheduling method, including:
确定处理器的当前核心的目标频率, 所述目标频率为所述处理器的当前核 心所请求调整到的运行频率;  Determining a target frequency of a current core of the processor, the target frequency being an operating frequency to which the current core of the processor is requested to be adjusted;
如果所述当前核心的目标频率大于所述处理器的各个已开启核心的当前运 行频率, 确定所述处理器的各个已开启核心中的可迁移进程数是否满足预设条 件;  If the target frequency of the current core is greater than a current running frequency of each enabled core of the processor, determining whether the number of migrateable processes in each enabled core of the processor meets a preset condition;
在所述处理器的各个已开启核心中的可迁移进程数满足所述预设条件的情 况下, 为所述处理器开启新的核心。 、 根据权利要求 1所述的方法, 其中, 所述确定处理器的当前核心的目标频率包 括:  A new core is turned on for the processor if the number of migrateable processes in each of the enabled cores of the processor meets the predetermined condition. The method according to claim 1, wherein the determining the target frequency of the current core of the processor comprises:
根据所述处理器的动态调频策略确定所述当前核心的目标频率, 所述动态 调频策略与所述处理器的负载相关。 、 根据权利要求 1所述的方法, 其中, 所述确定所述处理器的各个已开启核心中 的可迁移进程数是否满足预设条件包括: 根据所述各个已开启核心的负载与开启新的核心后各个核心的平均负载, 确定所述各个已开启核心的负载权重差;  Determining a target frequency of the current core according to a dynamic frequency modulation policy of the processor, the dynamic frequency modulation policy being related to a load of the processor. The method according to claim 1, wherein the determining whether the number of the migrateable processes in each of the enabled cores of the processor meets a preset condition comprises: starting a new one according to the load of each opened core The average load of each core after the core, determining the load weight difference of each of the opened cores;
根据所述各个已开启核心的负载权重差、 所述各个已开启核心的负载以及 所述各个已开启核心的亲和性, 确定所述处理器的各个已开启核心中的可迁移 进程数;  Determining, according to the load weight difference of each of the enabled cores, the load of each of the turned-on cores, and the affinity of each of the enabled cores, determining the number of migrateable processes in each enabled core of the processor;
确定所述可迁移进程数是否大于预设阈值, 或者确定所述可迁移进程数与 已开启核心数的比值是否大于预设比例。 、 根据权利要求 1所述的方法, 其中, 所述确定所述处理器的各个已开启核心中 的可迁移进程数是否满足预设条件之后, 所述方法还包括:  Determining whether the number of the migrateable processes is greater than a preset threshold, or determining whether a ratio of the number of the migrateable processes to the number of opened cores is greater than a preset ratio. The method according to claim 1, wherein, after the determining whether the number of the removable processes in each of the enabled cores of the processor meets a preset condition, the method further includes:
在所述处理器的各个已开启核心中的可迁移进程数不满足所述预设条件的 情况下, 通过所述处理器原有的内核调度策略调度所述处理器。 、 根据权利要求 1-4中任一项所述的方法, 其中, 为所述处理器开启新的核心之 后, 所述方法还包括: 将所述当前核心中的可迁移进程中的至少一部分迁移至所述新的核心中以 减小所述当前核心的负载。 、 一种多核处理器调度装置, 包括: If the number of migratable processes in each enabled core of the processor does not satisfy the preset condition, the processor is scheduled by the original kernel scheduling policy of the processor. The method according to any one of claims 1 to 4, wherein after the new core is opened for the processor, the method further comprises: migrating at least a part of the migratable processes in the current core Up to the new core to reduce the load on the current core. A multi-core processor scheduling device, comprising:
频率确定单元, 设置为确定处理器的当前核心的目标频率, 所述目标频率 为所述处理器的当前核心所请求调整到的运行频率; 进程确定单元, 设置为如果所述当前核心的目标频率大于所述处理器的各 个已开启核心的当前运行频率, 确定所述处理器的各个已开启核心中的可迁移 进程数是否满足预设条件;  a frequency determining unit, configured to determine a target frequency of a current core of the processor, where the target frequency is an operating frequency that is requested by the current core of the processor; and a process determining unit, configured to be a target frequency of the current core If the current running frequency of each enabled core of the processor is greater than, determine whether the number of migrateable processes in each enabled core of the processor meets a preset condition;
开启单元, 设置为在所述进程确定单元确定所述处理器的各个已开启核心 中的可迁移进程数满足所述预设条件的情况下, 为所述处理器开启新的核心。 、 根据权利要求 6所述的装置, 其中, 所述频率确定单元具体设置为根据所述处 理器的动态调频策略确定所述当前核心的目标频率, 所述动态调频策略与所述 处理器的负载相关。 、 根据权利要求 6所述的装置, 其中, 所述进程确定单元具体包括: 负载权重差确定模块, 设置为根据所述各个已开启核心的负载与开核后各 个核心的平均负载, 确定所述各个已开启核心的负载权重差; 可迁移进程确定模块, 设置为根据所述负载权重差确定模块确定的所述各 个已开启核心的负载权重差、 所述各个已开启核心的负载以及所述各个已开启 核心的亲和性, 确定所述处理器的各个已开启核心中的可迁移进程数; 比较模块, 设置为确定所述可迁移进程数是否大于预设阈值, 或者确定所 述可迁移进程数与已开启核心数的比值是否大于预设比例。 、 根据权利要求 6-8中任一项所述的装置, 其中, 还包括: 迁移单元, 设置为在为所述处理器开启新的核心之后, 将所述当前核心中 的可迁移进程中的至少一部分迁移至所述新的核心中以减小所述当前核心的负 载。 0、 一种终端, 所述终端包括权利要求 6-9中任一项所述的多核处理器调度装置。  And an opening unit, configured to enable a new core for the processor if the process determining unit determines that the number of migratable processes in each enabled core of the processor satisfies the preset condition. The device according to claim 6, wherein the frequency determining unit is specifically configured to determine a target frequency of the current core according to a dynamic frequency modulation policy of the processor, the dynamic frequency modulation policy and a load of the processor Related. The device according to claim 6, wherein the process determining unit specifically includes: a load weight difference determining module, configured to determine, according to the load of each opened core and the average load of each core after the core is opened, a load weight difference module of each of the enabled cores; a loadable process determining module, configured to determine, according to the load weight difference determining module, a load weight difference of each of the turned-on cores, a load of each of the turned-on cores, and each of the The affinity of the core is enabled, and the number of migrateable processes in each enabled core of the processor is determined; the comparison module is configured to determine whether the number of the migrateable processes is greater than a preset threshold, or determine the migratable process Whether the ratio of the number to the number of cores that have been turned on is greater than the preset ratio. The apparatus according to any one of claims 6-8, further comprising: a migration unit configured to: after opening a new core for the processor, to be in a migratable process in the current core At least a portion migrates to the new core to reduce the load of the current core. A terminal, the terminal comprising the multi-core processor scheduling device of any one of claims 6-9.
PCT/CN2014/079289 2014-02-24 2014-06-05 Multi-core processor scheduling method and apparatus, and terminal WO2015123938A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410062275.8 2014-02-24
CN201410062275.8A CN104866379B (en) 2014-02-24 2014-02-24 A kind of multi-core processor dispatching method, device and terminal

Publications (1)

Publication Number Publication Date
WO2015123938A1 true WO2015123938A1 (en) 2015-08-27

Family

ID=53877587

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/079289 WO2015123938A1 (en) 2014-02-24 2014-06-05 Multi-core processor scheduling method and apparatus, and terminal

Country Status (2)

Country Link
CN (1) CN104866379B (en)
WO (1) WO2015123938A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569574A (en) * 2015-10-10 2017-04-19 中兴通讯股份有限公司 Frequency management method and device for multicore CPU (Central Processing Unit)
US10157081B2 (en) * 2015-11-13 2018-12-18 Telefonaktiebolaget Lm Ericsson (Publ) Trainer of many core systems for adaptive resource control
CN105930218A (en) * 2016-04-18 2016-09-07 深圳市万普拉斯科技有限公司 Computing resource frequency adjustment method and system
CN106227602A (en) * 2016-07-26 2016-12-14 张升泽 The distribution method being supported between multi core chip and system
WO2018018491A1 (en) * 2016-07-28 2018-02-01 张升泽 Method and system for allocating voltage of electronic chip in plurality of intervals
CN106293935A (en) * 2016-07-28 2017-01-04 张升泽 Electric current is in the how interval distribution method within multi core chip and system
CN106201728A (en) * 2016-07-28 2016-12-07 张升泽 Power distribution methods based on many interval distribution and system
CN106227606A (en) * 2016-07-28 2016-12-14 张升泽 The method and system of many interval distribution electronic chip voltages
CN106559499B (en) * 2016-12-07 2020-02-07 苏州浪潮智能科技有限公司 Storage system and method and system for distributing computing resources thereof
CN106843815B (en) * 2017-01-18 2019-02-19 电子科技大学 The optimization method that on-chip multi-processor system multithreading is run simultaneously
CN109669778B (en) * 2018-12-21 2023-09-01 北京奇虎科技有限公司 Method and system for determining number of parallel processes for running unit

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090089792A1 (en) * 2007-09-27 2009-04-02 Sun Microsystems, Inc. Method and system for managing thermal asymmetries in a multi-core processor
CN101414268A (en) * 2007-10-15 2009-04-22 南京大学 Method for managing processor hot plug on ARM MPCore processor
CN101901167A (en) * 2010-07-22 2010-12-01 网御神州科技(北京)有限公司 Multi-network security auditing method and system under multi-CPU architecture
CN102184125A (en) * 2011-06-02 2011-09-14 首都师范大学 Load balancing method based on program behaviour online analysis under heterogeneous multi-core environment
CN102520782A (en) * 2011-12-15 2012-06-27 江苏中科梦兰电子科技有限公司 Power supply management method based on automatic adjustment of processor nuclear number
EP2581830A1 (en) * 2010-06-10 2013-04-17 Fujitsu Limited Multi-core processor system, method of power control, and power control program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101108397B1 (en) * 2005-06-10 2012-01-30 엘지전자 주식회사 Apparatus and method for controlling power supply in a multi-core processor
CN101067758B (en) * 2007-06-14 2010-05-19 华南理工大学 Energy consumption management method for inserting system
US8453150B2 (en) * 2010-06-08 2013-05-28 Advanced Micro Devices, Inc. Multithread application-aware memory scheduling scheme for multi-core processors

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090089792A1 (en) * 2007-09-27 2009-04-02 Sun Microsystems, Inc. Method and system for managing thermal asymmetries in a multi-core processor
CN101414268A (en) * 2007-10-15 2009-04-22 南京大学 Method for managing processor hot plug on ARM MPCore processor
EP2581830A1 (en) * 2010-06-10 2013-04-17 Fujitsu Limited Multi-core processor system, method of power control, and power control program
CN101901167A (en) * 2010-07-22 2010-12-01 网御神州科技(北京)有限公司 Multi-network security auditing method and system under multi-CPU architecture
CN102184125A (en) * 2011-06-02 2011-09-14 首都师范大学 Load balancing method based on program behaviour online analysis under heterogeneous multi-core environment
CN102520782A (en) * 2011-12-15 2012-06-27 江苏中科梦兰电子科技有限公司 Power supply management method based on automatic adjustment of processor nuclear number

Also Published As

Publication number Publication date
CN104866379A (en) 2015-08-26
CN104866379B (en) 2019-06-14

Similar Documents

Publication Publication Date Title
WO2015123938A1 (en) Multi-core processor scheduling method and apparatus, and terminal
US10613883B2 (en) Managing virtual machine migration
US10795674B2 (en) Automatic scaling of microservices applications
US9489222B2 (en) Techniques for workload balancing among a plurality of physical machines
CN103353853A (en) Automatic load adjusting method
US20130174146A1 (en) Dynamically scaling multi-tier applications in a cloud environment
TWI693548B (en) Device and method for dynamically adjusting task loading for multi-core processor
JP2013524317A5 (en)
CN108241530A (en) A kind of streaming computing bipartite graph method for scheduling task based on Storm
Singh et al. Survey on various load balancing techniques in cloud computing
WO2015032201A1 (en) Virtual machine placing method and device
Liu et al. Dynamic resource allocation for MapReduce with partitioning skew
WO2017181936A1 (en) Network resource deployment method, apparatus, controller, and core network device
CN109960579B (en) Method and device for adjusting service container
CN104811467B (en) The data processing method of aggreggate utility
CN104881316A (en) Virtual machine transferring method and device
CN103443771A (en) Method and device for resource dispatching among data centers
CN103677959B (en) A kind of virtual machine cluster migration method and system based on multicast
JP2010141601A5 (en)
CN105519075A (en) Resource scheduling method and apparatus
CN111124439B (en) Intelligent dynamic unloading algorithm with cloud edge cooperation
CN103383654A (en) Method and device for adjusting mappers to execute on multi-core machine
Janpan et al. A virtual machine consolidation framework for CloudStack platforms
US20120042322A1 (en) Hybrid Program Balancing
CN112559176A (en) Instruction processing method and device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14883444

Country of ref document: EP

Kind code of ref document: A1