WO2016082360A1 - Method and device for implementing cpu service migration - Google Patents

Method and device for implementing cpu service migration Download PDF

Info

Publication number
WO2016082360A1
WO2016082360A1 PCT/CN2015/073414 CN2015073414W WO2016082360A1 WO 2016082360 A1 WO2016082360 A1 WO 2016082360A1 CN 2015073414 W CN2015073414 W CN 2015073414W WO 2016082360 A1 WO2016082360 A1 WO 2016082360A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
migration
cpu
preset
data plane
Prior art date
Application number
PCT/CN2015/073414
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 WO2016082360A1 publication Critical patent/WO2016082360A1/en

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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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

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)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A method and device for implementing CPU service migration. The method comprises: setting that a system CPU uses a user mode. The method further comprises: when an average value of CPU load weights on all the data plane cores reaches a load threshold, adjusting a preset service migration factor according to a corresponding preset step length and a corresponding preset period; and when the adjusted service migration factor satisfies a migration threshold, migrating services on the CPU according to a preset migration policy. In this technical solution, a CPU load threshold is set to trigger adjustment of service migration, and the adjustment is determined according to a migration threshold, so that services on the CPU are adjusted when the set migration threshold is satisfied and the power consumption of the CPU is reduced; besides, a low load migration factor and a low load migration threshold are set, and adjustment and service migration are performed according to a preset CPU descending policy, so the power consumption of the CPU is reduced and the adjustment efficiency of the CPU power consumption is improved.

Description

一种实现CPU业务迁移的方法及装置Method and device for realizing CPU service migration 技术领域Technical field
本申请涉及计算机技术,尤指一种实现中央处理器CPU业务迁移的方法及装置。The present application relates to computer technology, and more particularly to a method and apparatus for realizing CPU migration of a central processing unit.
背景技术Background technique
CPU的节能通常在芯片本身支持的降频和关核等技术基础上实现,不同的CPU节能在于节能的策略不同。对每个操作系统(OS)目前有不同的节能策略,比如Linux操作系统,为X86的CPU提供了多种频率调节器;其中,Ondemand调节器,在支持的可变频率范围内,根据负荷自动调节CPU核的工作频率;Performance调节器,将CPU设置为所支持的最高频率运行,以提供最优的性能;Userspace调节器可以根据需要,设置CPU工作在特定的频率而不受CPU负荷的影响。除此之外,对其他操作系统及不同类型的CPU也存在相应的用于CPU节能调整的调节器。对于不同的操作系统和不同型号的CPU都存在与X86的CPU上的Userspace调节器相同的调节器。一般的,可以将Userspace调节器称为用户模式的调节器,在CPU上设置用户模式调节器也叫做设置系统CPU使用用户模式。The CPU's energy saving is usually implemented on the basis of technologies such as frequency reduction and shutdown supported by the chip itself. Different CPU energy saving strategies are different in energy saving strategies. There are different energy-saving strategies for each operating system (OS), such as the Linux operating system, which provides multiple frequency regulators for the X86 CPU; among them, the Ondemand regulator, in the supported variable frequency range, automatically according to the load. Adjust the operating frequency of the CPU core; the Performance regulator sets the CPU to the highest frequency supported to provide optimal performance; the Userspace regulator can set the CPU to operate at a specific frequency without CPU load as needed. . In addition, there are corresponding regulators for CPU energy saving adjustment for other operating systems and different types of CPUs. For different operating systems and different models of CPUs, there are the same regulators as the Userspace regulator on the X86 CPU. In general, the Userspace regulator can be referred to as a user mode regulator, and setting a user mode regulator on the CPU is also called setting the system CPU usage user mode.
相关的CPU节能方法通常设置系统工作的模式,比如“节能模式”、“高性能模式”等,通过按键或其他手动操作的方式触发系统进入节能模式。或者通过检测CPU的占有率计算需要调整的CPU目标频率,这种方式可以将CPU核都调节至最低频率运行,但是在低业务量情况下,依然存在较大的能耗浪费,无法做到最优的节能效果。Related CPU power saving methods usually set the mode in which the system works, such as "energy saving mode", "high performance mode", etc., and trigger the system to enter the energy saving mode by means of a button or other manual operation. Or by detecting the CPU occupancy rate to calculate the CPU target frequency that needs to be adjusted, this way can adjust the CPU core to the lowest frequency operation, but in the case of low traffic, there is still a large waste of energy, which cannot be the most Excellent energy saving effect.
发明内容Summary of the invention
为了解决上述问题,本发明实施例提供一种实现CPU业务迁移的方法及装置,能够降低CPU的能耗,更好的实现系统节能。In order to solve the above problems, the embodiments of the present invention provide a method and an apparatus for implementing CPU service migration, which can reduce the power consumption of the CPU and better implement system energy saving.
为了达到上述目的,本发明实施例提供一种实现CPU业务迁移的方法, 包括:In order to achieve the above object, an embodiment of the present invention provides a method for implementing CPU service migration. include:
当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;When the average value of the CPU load proportion on all the data plane cores reaches the load threshold, the preset service mobility factor is adjusted according to the corresponding preset step size and the preset period;
当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。When the adjusted service mobility factor meets the migration threshold, the services on the CPU are migrated according to a preset migration policy.
可选地,该方法还包括:Optionally, the method further includes:
当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整之前,根据系统业务线程对CPU性能要求,划分控制面核和数据面核,并记录业务应用线程在数据面核中的分布;When the average value of the CPU load on all data planes reaches the load threshold, before the preset service migration factor is adjusted according to the corresponding preset step and preset period, the control plane is divided according to the CPU performance requirements of the system service thread. Core and data face kernel, and record the distribution of business application threads in the data plane kernel;
在系统启动时,设置数据面核为排他绑定核;业务应用线程启动时,设置亲和性绑定至每个数据面核。When the system starts, set the data plane core to the exclusive binding core; when the business application thread starts, set the affinity binding to each data plane core.
可选地,业务迁移因数包含低负荷迁移因数;迁移阈值包含低负荷迁移阈值;所述按照预先设置的迁移策略将CPU上的业务进行迁移包括:Optionally, the service mobility factor includes a low load mobility factor; the migration threshold includes a low load migration threshold; and the migrating the services on the CPU according to the preset migration policy includes:
当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应按照预先设置的分配策略分配后,将对应的业务应用线程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求。When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding is set according to a preset After the allocation of the policy is assigned, after the corresponding service application thread is migrated to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load operation requirement.
可选地,业务迁移因数包含高负荷迁移因数;迁移阈值包含高负荷迁移阈值;所述按照预先设置的迁移策略将CPU上的业务进行迁移包括:Optionally, the service mobility factor includes a high load mobility factor; the migration threshold includes a high load migration threshold; and the migrating the services on the CPU according to the preset migration policy includes:
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程的分布恢复业务到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求。When the high load migration factor satisfies the high load migration threshold, the service on the CPU restores the service to the corresponding CPU according to the distribution of the business application thread on each data plane core recorded, and adjusts the frequency of the migrated CPU to meet the work. Claim.
可选地,所有数据面核上CPU负荷比重的均值包括:单位时间内每个数据面核上的每个业务运行的除管理开销以外的数据所占的时间的累加;Optionally, the average value of the CPU load proportions on all the data plane cores includes: an accumulation of time occupied by data other than the management overhead of each service running on each data plane core per unit time;
负荷阈值包含高负荷阈值和低负荷阈值。The load threshold includes a high load threshold and a low load threshold.
可选地,业务迁移因数包含高负荷迁移因数和低负荷迁移因数;所述按 照相应的预设步长及预设周期对业务迁移因数进行调整包括:Optionally, the traffic mobility factor includes a high load mobility factor and a low load mobility factor; Adjusting the business mobility factor according to the corresponding preset step size and preset period includes:
对高负荷迁移因数按照预设周期采用第一预设步长进行业务迁移因数的调整;Adjusting the traffic migration factor by using the first preset step size according to the preset period for the high load migration factor;
对低负荷迁移因数按照预设周期采用第二预设步长进行业务迁移因数的调整;Adjusting the traffic migration factor by using the second preset step size according to the preset period for the low load mobility factor;
第一预设步长大于第二预设步长。The first preset step size is greater than the second preset step size.
可选地,将CPU上的业务进行迁移包括:Optionally, migrating the services on the CPU includes:
关闭数据面核上所有进行业务迁移的业务应用线程的业务相关定时器,进行业务迁移;Close the service-related timers of all service application threads that perform service migration on the data plane core to perform service migration.
进行业务迁移包括:Conducting business migration includes:
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据所述记录的每个数据面核上的业务应用线程业务恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求;当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用进程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求;When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the business application thread service on each data plane core of the record, and the frequency of the migrated CPU is adjusted to meet the work. When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to the preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to the preset allocation policy, and the corresponding service is allocated. After the application process migrates to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load working requirement;
在将业务迁移到的相应的数据面核上时,开启迁移业务的业务相关定时器,使业务应用线程继续工作。When the service is migrated to the corresponding data plane core, the service-related timer of the migration service is started, so that the service application thread continues to work.
另一方面,本申请还提供一种实现中央处理器CPU业务迁移的装置,包括:调整单元和迁移单元;其中,On the other hand, the present application further provides an apparatus for implementing a CPU migration of a central processing unit, including: an adjustment unit and a migration unit;
调整单元,当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;Adjusting the unit, when the average value of the CPU load proportion on all the data plane cores reaches the load threshold, adjusting the preset service mobility factor according to the corresponding preset step size and the preset period;
迁移单元,设置为当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。The migration unit is configured to migrate the services on the CPU according to a preset migration policy when the adjusted service migration factor satisfies the migration threshold.
可选地,该装置还包括核绑定单元和核设置单元;其中, Optionally, the device further includes a core binding unit and a core setting unit; wherein
核绑定单元,设置为根据系统业务线程对CPU性能要求,划分控制面核和数据面核,并记录业务应用线程在数据面核中的分布;The core binding unit is configured to divide the control plane core and the data plane core according to the CPU performance requirements of the system service thread, and record the distribution of the service application thread in the data plane kernel;
核设置单元,设置为在系统启动时,设置数据面核为排他绑定核;业务应用线程启动时,设置亲和性绑定至每个数据面核。The core setting unit is set to set the data plane core as the exclusive binding core when the system is started; when the business application thread starts, set the affinity binding to each data plane core.
可选地,业务迁移因数包含低负荷迁移因数;所述迁移阈值包含低负荷迁移阈值;所述迁移单元是设置为,Optionally, the traffic mobility factor includes a low load mobility factor; the migration threshold includes a low load migration threshold; the migration unit is set to,
当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用线程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求。When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding service application thread is allocated. After migrating to the corresponding unclosed data plane core, close the data plane core of the migrated service and adjust the CPU frequency to meet the low load operation requirements.
可选地,业务迁移因数包含高负荷迁移因数;所述迁移阈值包含高负荷迁移阈值;所述迁移单元是设置为,当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程的分布恢复业务到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求。Optionally, the traffic mobility factor includes a high load mobility factor; the migration threshold includes a high load migration threshold; and the migration unit is configured to record the traffic on the CPU according to the high load migration factor when the high load migration threshold is met. The distribution of business application threads on each data plane core restores the service to the corresponding CPU and adjusts the frequency of the CPU that is migrated to meet the work requirements.
可选地,调整单元是设置为,将单位时间内每个数据面核上的每个业务运行的除管理开销以外的数据所占的时间的累加作为数据面核的负荷比重的均值,当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;Optionally, the adjusting unit is configured to calculate, as the average value of the load proportion of the data face kernel, of the time occupied by the data other than the management overhead of each service running on each data face core per unit time, when all When the average value of the CPU load proportion on the data plane core reaches the load threshold, the preset service mobility factor is adjusted according to the corresponding preset step size and preset period;
负荷阈值包含高负荷阈值和低负荷阈值。The load threshold includes a high load threshold and a low load threshold.
可选地,所述业务迁移因数包含高负荷迁移因数和低负荷迁移因数;调整单元是设置为,对高负荷迁移因数按照预设周期采用第一预设步长进行业务迁移因数的调整;对低负荷迁移因数按照预设周期采用第二预设步长进行业务迁移因数的调整;Optionally, the service mobility factor includes a high load mobility factor and a low load mobility factor; and the adjusting unit is configured to adjust the traffic mobility factor by using the first preset step size according to the preset period for the high load mobility factor; The low load migration factor is adjusted according to a preset period using a second preset step size;
第一预设步长大于第二预设步长。The first preset step size is greater than the second preset step size.
可选地,迁移单元是设置为,当调整的业务迁移因数满足迁移阈值时,关闭数据面核上所有进行业务迁移的业务应用线程的业务相关定时器,进行业务迁移; Optionally, the migration unit is configured to: when the adjusted service mobility factor meets the migration threshold, close a service-related timer of all service application threads on the data plane core for performing service migration, and perform service migration;
所述进行业务迁移包括:The business migration includes:
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据所述记录的每个数据面核上的业务应用线程业务恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求;当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用进程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求;When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the business application thread service on each data plane core of the record, and the frequency of the migrated CPU is adjusted to meet the work. When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to the preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to the preset allocation policy, and the corresponding service is allocated. After the application process migrates to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load working requirement;
在将业务迁移到的相应的数据面核上时,开启迁移业务的业务相关定时器,使业务应用线程继续工作。When the service is migrated to the corresponding data plane core, the service-related timer of the migration service is started, so that the service application thread continues to work.
本申请还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述方法。The application also provides a computer storage medium having stored therein computer executable instructions for performing the above method.
与相关技术相比,本发明实施例提供的技术方案,包括:设置系统CPU使用用户模式,还包括:当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。本发明实施例通过设置CPU负荷阈值触发进行业务迁移的调整,根据迁移阈值对调整进行判断,实现CPU上业务在满足设定迁移阈值时的调整,降低了CPU的能耗。另外,通过低负荷迁移因数和低负荷迁移阈值的设定,按照预先设置的CPU递减策略进行调整和业务迁移,降低了CPU能耗和提高了CPU能耗调整的效率。Compared with the related art, the technical solution provided by the embodiment of the present invention includes: setting a system CPU to use a user mode, and further comprising: when a mean value of a CPU load proportion on all data plane cores reaches a load threshold, a preset service mobility factor The adjustment is performed according to the preset preset step size and the preset period; when the adjusted service migration factor satisfies the migration threshold, the services on the CPU are migrated according to the preset migration policy. The embodiment of the present invention triggers the adjustment of the service migration by setting the CPU load threshold, and determines the adjustment according to the migration threshold to implement the adjustment of the service on the CPU when the set migration threshold is met, thereby reducing the power consumption of the CPU. In addition, through the setting of the low load migration factor and the low load migration threshold, the adjustment and service migration are performed according to the preset CPU decrementing strategy, which reduces the CPU power consumption and improves the efficiency of CPU power consumption adjustment.
附图概述BRIEF abstract
图1为本发明实施例实现CPU业务迁移的方法的流程图;FIG. 1 is a flowchart of a method for implementing CPU service migration according to an embodiment of the present invention;
图2为本发明实施例管理线程与业务线程的控制关系示意图;2 is a schematic diagram of a control relationship between a management thread and a service thread according to an embodiment of the present invention;
图3为本发明实施例实现业务迁出和迁入的流程示意图; 3 is a schematic flowchart of implementing a service migration and migration in an embodiment of the present invention;
图4为本发明实施例实现CPU业务迁移的装置的结构框图。FIG. 4 is a structural block diagram of an apparatus for implementing CPU service migration according to an embodiment of the present invention.
本发明的较佳实施方式Preferred embodiment of the invention
下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
图1为本发明实施例实现CPU业务迁移的方法的流程图,如图1所示,包括:FIG. 1 is a flowchart of a method for implementing CPU service migration according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
步骤100、当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整。Step 100: When the average value of the CPU load proportion on all the data plane cores reaches the load threshold, adjust the preset service mobility factor according to the preset preset step size and the preset period.
可选地,本步骤之前还包括:根据系统业务线程对CPU的性能要求,划分控制面核和数据面核;以及,Optionally, before the step, the method further includes: dividing the control plane core and the data plane core according to the performance requirement of the system service thread; and
在系统启动时,设置数据面核为排他绑定核;业务应用线程启动时,设置亲和性绑定至每个数据面核,并记录业务应用线程在数据面核中的分布。When the system starts, set the data plane core to the exclusive binding core; when the business application thread starts, set the affinity binding to each data plane core, and record the distribution of the business application thread in the data plane kernel.
需要说明的是,所述根据系统业务线程对CPU性能要求划分控制面核和数据面核,包括:将对CPU性能要求较低的线程绑定至控制面核;将对CPU性能要求较高的业务应用线程绑定至数据面核。操作系统(OS)的内核线程、OS的内核中断、OS的应用线程及业务中用于用户配置交互的线程等是根据本领域技术人员经验判定的对CPU性能要求较低的线程,当除所述根据本领域技术人员经验判断对CPU性能要求较低的线程外的其他线程被判定为绑定至控制面核时,其绑定过程可以根据实际情况进行调整。数据面核和控制面核的定义为本领域技术人员的公知常识。设置数据面核为排他绑定核和设置亲和性绑定至每个数据面核是本领域技术人员根据数据面核和控制面核的定义进行的设置,属于本领域技术人员的公知常识。It should be noted that, according to the system service thread, the control plane core and the data plane core are divided into CPU performance requirements, including: binding a thread with lower CPU performance requirements to the control plane core; and having higher CPU performance requirements. The business application thread is bound to the data plane core. The kernel thread of the operating system (OS), the kernel interrupt of the OS, the application thread of the OS, and the thread for user configuration interaction in the service are threads that have lower CPU performance requirements according to experience of those skilled in the art. According to the experience of those skilled in the art, when other threads outside the thread that have lower CPU performance requirements are determined to be bound to the control plane core, the binding process can be adjusted according to actual conditions. The definition of the data face kernel and the control face kernel are common knowledge of those skilled in the art. Setting the data plane kernel as the exclusive binding core and setting the affinity binding to each data plane core is a setting made by those skilled in the art according to the definition of the data plane kernel and the control plane kernel, and is common knowledge of those skilled in the art.
可选地,步骤100中,所有数据面核上CPU负荷比重的均值包括:单位时间内每个数据面核上的每个业务运行除管理开销以外的数据所占的时间的累加;Optionally, in step 100, the average value of the CPU load proportions on all the data plane cores includes: an accumulation of time occupied by data other than the management overhead of each service running on each data plane core per unit time;
负荷阈值包含高负荷阈值和低负荷阈值。The load threshold includes a high load threshold and a low load threshold.
需要说明的是,这里的高负荷阈值和低负荷阈值是本领域技术人员根据 实际经验获得的数值;可选的,高负荷阈值是指根据业务负荷计算CPU的负荷达到百分之十,低负荷阈值是指根据业务负荷计算CPU的负荷降到百分之二。这里,高负荷阈值和低负荷阈值的确定与系统对业务性能要求的紧迫程度相关,在性能要求很高的场景下,对于一些业务,当需要有多核运行支持时,该高负荷阈值和低负荷阈值可以设置低一些,反之可以设置得高一些。系统的紧迫程度由技术人员根据系统要求确定。It should be noted that the high load threshold and the low load threshold herein are based on those skilled in the art. The value obtained by actual experience; optionally, the high load threshold means that the CPU load is calculated to be 10% according to the traffic load, and the low load threshold is calculated to reduce the CPU load to 2% according to the traffic load. Here, the determination of the high load threshold and the low load threshold is related to the urgency of the system performance requirements. In a scenario with high performance requirements, for some services, when multi-core operation support is required, the high load threshold and low load The threshold can be set lower, otherwise it can be set higher. The urgency of the system is determined by the technician based on system requirements.
可选地,所述业务迁移因数包含高负荷迁移因数和低负荷迁移因数;按照相应的预设步长及预设周期对业务迁移因数进行调整包括:Optionally, the service mobility factor includes a high load mobility factor and a low load mobility factor; adjusting the traffic mobility factor according to the corresponding preset step size and the preset period includes:
对高负荷迁移因数按照预设周期采用第一预设步长进行业务迁移因数的调整;对低负荷迁移因数按照预设周期采用第二预设步长进行业务迁移因数的调整;其中,第一预设步长大于第二预设步长。Adjusting the service mobility factor by using the first preset step size according to the preset period for the high load mobility factor; adjusting the service mobility factor by using the second preset step size for the low load mobility factor according to the preset period; The preset step size is greater than the second preset step size.
需要说明的是,高负荷迁移因数与低负荷迁移因数是根据本领域技术人员的经验获得的数值;可选的,高负荷迁移因数为300;低负荷迁移因数为-300;当进行业务迁移要求迁移因数的阻尼时间变小时,根据要求调整迁移因数即可。预设周期是本领域技术人员根据经验获得的数值;可选的,预设周期可以是1S,当预设周期为1S时,可选的,第一预设步长为300,第二预设步长为1;即高负荷时,以较高的效率提高CPU性能;低负荷时,对业务迁移进行较为缓和的调整,通过对业务迁移的调整设置,首先可以实现满足业务对性能的要求;其次,还可以节省CPU的能耗。It should be noted that the high load migration factor and the low load migration factor are values obtained according to the experience of those skilled in the art; optionally, the high load migration factor is 300; the low load migration factor is -300; when the service migration is required The damping time of the migration factor becomes small, and the migration factor can be adjusted as required. The preset period is a value obtained by a person skilled in the art according to experience; optionally, the preset period may be 1S, and when the preset period is 1S, the first preset step size is 300, and the second preset is The step size is 1; that is, when the load is high, the CPU performance is improved with higher efficiency; when the load is low, the service migration is moderately adjusted. By adjusting the service migration, the service performance requirement can be met first; Secondly, it can also save CPU power consumption.
步骤101、当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。Step 101: When the adjusted service mobility factor meets the migration threshold, the services on the CPU are migrated according to a preset migration policy.
可选地,当业务迁移因数包含低负荷迁移因数,迁移阈值包含低负荷迁移阈值时,本步骤中,按照预先设置的迁移策略将CPU上的业务进行迁移包括:Optionally, when the traffic mobility factor includes a low-load mobility factor and the migration threshold includes a low-load migration threshold, in this step, the services on the CPU are migrated according to the preset migration policy, including:
当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用线程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求。 When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding service application thread is allocated. After migrating to the corresponding unclosed data plane core, close the data plane core of the migrated service and adjust the CPU frequency to meet the low load operation requirements.
需要说明的是,这里进行业务迁移时,对每次业务迁移,对CPU核按照设置的递减策略进行减少;例如,系统业务通过8个CPU进行处理时,低负荷迁移因数满足低负荷迁移阈值时,减少CPU的工作数量到4个CPU;再次满足低负荷迁移阈值时,减少到2个;当然,可以按照其他预先设置的递减数值进行,可选地,根据业务变化情况及CPU性能进行调整。将递减部分的数据面核上业务按照预先设置的分配策略分配是指按照本领域技术人员根据实际情况设定的分配方法,可选的,可以采用平均分配的方法;当然,还可以采用业务分类后在进行分配的方法,具体情况根据实际情况确定。It should be noted that, when performing service migration, the CPU core is reduced according to the set decrement policy for each service migration; for example, when the system service is processed by 8 CPUs, when the low load mobility factor satisfies the low load migration threshold , reduce the number of CPU work to 4 CPUs; once again meet the low load migration threshold, reduce to 2; of course, can be carried out according to other preset decrement values, optionally, according to business changes and CPU performance. The allocation of the data on the data plane of the decremented part according to the pre-set allocation policy refers to the allocation method according to the actual situation of the person skilled in the art, and optionally, the method of equal allocation may be adopted; of course, the service classification may also be adopted. After the method of distribution, the specific situation is determined according to the actual situation.
可选地,当业务迁移因数包含高负荷迁移因数,迁移阈值包含高负荷迁移阈值时,所述按照预先设置的迁移策略将CPU上的业务进行迁移包括:Optionally, when the service mobility factor includes a high load mobility factor, and the migration threshold includes a high load migration threshold, the performing the migration on the CPU according to the preset migration policy includes:
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求。When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the recorded business application thread on each data plane core, and the frequency of the migrated CPU is adjusted to meet the working requirement.
可选地,将CPU上的业务进行迁移包括:关闭数据面核上所有进行业务迁移的业务应用线程的业务相关定时器,进行业务迁移;这里,进行业务迁移包括:Optionally, the migrating the service on the CPU includes: closing a service-related timer of the service application thread that performs the service migration on the data plane core, and performing service migration; where the service migration includes:
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程业务恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求;When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the recorded business application thread service on each data plane core, and the frequency of the migrated CPU is adjusted to meet the working requirement;
或者,当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用进程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求;Or, when the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding service is allocated. After the application process migrates to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load working requirement;
在将业务迁移到的相应的数据面核上时,开启迁移业务的业务相关定时器,使业务应用线程继续工作。When the service is migrated to the corresponding data plane core, the service-related timer of the migration service is started, so that the service application thread continues to work.
需要说明的是,这里在进行业务迁移时,调整CPU频率满足低负荷工作要求或高负荷工作要求属于本领域技术人员惯用技术手段,可选的,低负 荷工作要求的频率调整为使用CPU支持的最低频率,高负荷工作要求的频率调整为使用最高频率。It should be noted that, when performing service migration, adjusting the CPU frequency to meet the low load working requirement or the high load working requirement belongs to the technical means used by those skilled in the art, and optional, low negative The frequency required for the load operation is adjusted to use the lowest frequency supported by the CPU, and the frequency required for high load operation is adjusted to use the highest frequency.
图2为本发明实施例管理线程与业务线程的控制关系示意图;如图2所示,在实现过程中通过在控制面核上设置管理线程进行业务迁移,避免由于业务迁移影响管理线程进行业务迁移的工作,管理线程实现了每个数据面核业务应用线程的记录、数据面核的CPU负荷比重计算、业务迁移因数的调整和是否满足迁移阈值的判断、根据迁移阈值确定是否进行业务迁移;当然,根据实际情况,可以通过其他的硬件或芯片实现业务迁移过程,管理线程的实现只是其中的一种实现方式。2 is a schematic diagram of a control relationship between a management thread and a service thread according to an embodiment of the present invention; as shown in FIG. 2, in the implementation process, a management thread is set on a control plane core to perform service migration, thereby avoiding a service migration caused by a service migration. Work, the management thread realizes the record of each data plane core business application thread, the CPU load proportion calculation of the data plane core, the adjustment of the service migration factor and the judgment of whether the migration threshold is satisfied, and whether the service migration is performed according to the migration threshold; According to the actual situation, the business migration process can be realized by other hardware or chips, and the implementation of the management thread is only one of the implementation methods.
通过生成的控制指令,发送到相应的数据面核中完成业务迁移过程中业务相关定时器的开启和关闭,业务应用线程的迁入和迁出及数据面核的开启和关闭。Through the generated control command, it is sent to the corresponding data plane core to complete the opening and closing of the service-related timer in the service migration process, the moving in and out of the service application thread, and the opening and closing of the data plane core.
进行业务迁移,是通过添加的管理线程与数据面核进行交互实现,当管理线程关闭业务相关定时器时,管理线程实际上终止了数据面核上业务应用线程的工作,此时,按照预先设置的迁移策略,进行数据面核的迁入和迁出,在完成迁入或迁出之后,打开业务相关定时器重新开启业务的业务应用线程。对业务应用线程的停止、迁移及开启通过在管理线程中生成相应的控制指令实现,控制指令的生成数据本领域技术人员的惯用技术手段。The business migration is implemented by the interaction between the added management thread and the data plane core. When the management thread closes the service-related timer, the management thread actually terminates the work of the service application thread on the data plane core. At this time, according to the preset The migration strategy is to move in and out of the data plane core. After completing the move in or out, open the service related timer and restart the business application thread of the service. The stopping, migrating and opening of the business application thread is realized by generating corresponding control instructions in the management thread, and the generation of data of the control instruction is a conventional technical means by those skilled in the art.
图2中椭圆虚线表示循环。The elliptical dashed line in Figure 2 represents the loop.
图2中业务1中“执行业务回调处理”和“处理业务流程”所用的时间是管理线程计算数据面核的CPU负荷比重的依据。The time taken by the "execution of business callback processing" and "processing of business processes" in the service 1 in FIG. 2 is the basis for the management thread to calculate the proportion of the CPU load of the data face kernel.
图3为本发明实施例实现业务迁出和迁入的流程示意图;如图3所示,假设业务B的业务应用线程为CPU 2上的线程2,业务A的业务应用线程为CPU 1上的线程1。这里,依然通过管理线程对具体过程进行说明。FIG. 3 is a schematic diagram of a process for implementing a service migration and migration according to an embodiment of the present invention; as shown in FIG. 3, it is assumed that a service application thread of service B is a thread 2 on a CPU 2, and a service application thread of service A is a CPU 1 Thread 1. Here, the specific process is still explained by the management thread.
假设满足业务迁移的迁移阈值,按照预先设置的迁移策略需要将业务B迁移到CPU 1上继续业务,此时,管理线程通过发出请求指令(进入迁移模 式),通知CPU 1和CPU 2需要进行业务迁移,CPU1线程1和CPU2线程2则根据通知指令分别停止CPU 1和CPU 2上的业务相关定时器;Assume that the migration threshold of the service migration is met, and the service B needs to be migrated to the CPU 1 to continue the service according to the preset migration policy. At this time, the management thread sends a request command (by entering the migration mode). Equation), notifying CPU 1 and CPU 2 that service migration is required, and CPU1 thread 1 and CPU2 thread 2 respectively stop the service-related timers on CPU 1 and CPU 2 according to the notification instruction;
管理线程通过发送请求消息(或者控制指令或迁移消息),请求线程2将业务B迁移到CPU 1上,通过CPU 1上的线程1继续执行业务B,线程1接收到CPU 2迁入业务B的请求,完成业务B的迁入;The management thread requests the thread 2 to migrate the service B to the CPU 1 by sending a request message (or a control instruction or a migration message), and continues to execute the service B through the thread 1 on the CPU 1, and the thread 1 receives the CPU 2 moving into the service B. Request to complete the move of business B;
管理线程根据业务B从CPU 2的迁出和到CPU 1的迁入的完成,关闭CPU 2的数据面核,调整CPU 1的数据面核的频率,开启业务相关定时器,继续业务A和业务B的工作。The management thread closes the data plane core of the CPU 2 according to the migration of the service B from the CPU 2 and the migration to the CPU 1, adjusts the frequency of the data plane core of the CPU 1, starts the service-related timer, and continues the service A and the service. B's work.
图4为本发明实施例实现CPU业务迁移的装置的结构框图,包括:调整单元和迁移单元;其中,4 is a structural block diagram of an apparatus for implementing CPU service migration according to an embodiment of the present invention, including: an adjustment unit and a migration unit;
调整单元,当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;Adjusting the unit, when the average value of the CPU load proportion on all the data plane cores reaches the load threshold, adjusting the preset service mobility factor according to the corresponding preset step size and the preset period;
迁移单元,设置为当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。The migration unit is configured to migrate the services on the CPU according to a preset migration policy when the adjusted service migration factor satisfies the migration threshold.
本发明实施例装置还包括核绑定单元和核设置单元;其中,The device of the embodiment of the present invention further includes a core binding unit and a core setting unit; wherein
核绑定单元,设置为根据系统业务线程对CPU性能要求划分控制面核和数据面核,并记录业务应用线程在数据面核中的分布;The core binding unit is configured to divide the control plane core and the data plane core according to the CPU performance requirement of the system service thread, and record the distribution of the service application thread in the data plane kernel;
核设置单元,设置为在系统启动时,设置数据面核为排他绑定核;业务应用线程启动时,设置亲和性绑定至每个数据面核。The core setting unit is set to set the data plane core as the exclusive binding core when the system is started; when the business application thread starts, set the affinity binding to each data plane core.
当业务迁移因数包含低负荷迁移因数,迁移阈值包含低负荷迁移阈值时,迁移单元是设置为,When the business migration factor includes a low load migration factor and the migration threshold contains a low load migration threshold, the migration unit is set to
当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用线程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求。When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding service application thread is allocated. After migrating to the corresponding unclosed data plane core, close the data plane core of the migrated service and adjust the CPU frequency to meet the low load operation requirements.
当业务迁移因数包含高负荷迁移因数,迁移阈值包含高负荷迁移阈值时,迁移单元是设置为, When the business migration factor includes a high load migration factor and the migration threshold contains a high load migration threshold, the migration unit is set to
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程的分布恢复业务到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求。When the high load migration factor satisfies the high load migration threshold, the service on the CPU restores the service to the corresponding CPU according to the distribution of the business application thread on each data plane core recorded, and adjusts the frequency of the migrated CPU to meet the work. Claim.
调整单元是设置为,将单位时间内每个数据面核上的每个业务运行除管理开销以外的数据所占的时间的累加作为数据面核的负荷比重,当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;The adjustment unit is set to accumulate the time occupied by the data other than the management overhead for each business operation on each data plane core in a unit time as the load weight of the data plane core, and the CPU load proportion on all the data plane cores. When the mean value reaches the load threshold, the preset service migration factor is adjusted according to the corresponding preset step size and preset period;
负荷阈值包含高负荷阈值和低负荷阈值。The load threshold includes a high load threshold and a low load threshold.
调整单元是设置为,当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照、对高负荷迁移因数按照预设周期采用第一预设步长进行业务迁移因数的调整;对低负荷迁移因数按照预设周期采用第二预设步长进行业务迁移因数的调整;The adjustment unit is configured to: when the average value of the CPU load proportion on all the data plane cores reaches the load threshold, perform the service migration according to the preset service migration factor according to the preset load period according to the preset period. Adjustment of the factor; adjusting the service mobility factor by using the second preset step size according to the preset period for the low load mobility factor;
第一预设步长大于第二预设步长。The first preset step size is greater than the second preset step size.
迁移单元是设置为,当调整的业务迁移因数满足迁移阈值时,关闭数据面核上所有进行业务迁移的业务应用线程的业务相关定时器,进行业务迁移;The migration unit is configured to: when the adjusted service mobility factor meets the migration threshold, close the service-related timers of all service application threads on the data plane core for service migration, and perform service migration;
进行业务迁移包括:Conducting business migration includes:
当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程业务恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求;当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减后,将递减部分的数据面核上业务按照预先设置的分配策略分配后,将对应的业务应用进程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求;When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the recorded business application thread service on each data plane core, and the frequency of the migrated CPU is adjusted to meet the working requirement; When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to the preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to the preset allocation policy, and the corresponding service is allocated. After the application process migrates to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load working requirement;
在将业务迁移到的相应的数据面核上时,开启迁移业务的业务相关定时器,使业务应用线程继续工作。 When the service is migrated to the corresponding data plane core, the service-related timer of the migration service is started, so that the service application thread continues to work.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现,相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the steps described above can be accomplished by a program that instructs the associated hardware, such as a read-only memory, a magnetic or optical disk, and the like. Optionally, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits. Accordingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, or may be implemented by using a software function module. Formal realization. The invention is not limited to any specific form of combination of hardware and software.
虽然本申请所揭露的实施方式如上,但所述的内容仅为便于理解本申请而采用的实施方式,并非用以限定本申请,如本发明实施方式中的具体的实现方法。任何本申请所属领域内的技术人员,在不脱离本申请所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本申请的专利保护范围,仍须以所附的权利要求书所界定的范围为准。The embodiments disclosed in the present application are as described above, but the descriptions are only for the purpose of understanding the present application, and are not intended to limit the present application, such as the specific implementation method in the embodiments of the present invention. Any modifications and changes in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the disclosure. The scope defined by the appended claims shall prevail.
工业实用性Industrial applicability
上述技术方案通过设置CPU负荷阈值触发进行业务迁移的调整,根据迁移阈值对调整进行判断,实现CPU上业务在满足设定迁移阈值时的调整,降低了CPU的能耗。另外,通过低负荷迁移因数和低负荷迁移阈值的设定,按照预先设置的CPU递减策略进行调整和业务迁移,降低了CPU能耗和提高了CPU能耗调整的效率。 The above technical solution triggers the adjustment of the service migration by setting the CPU load threshold, and determines the adjustment according to the migration threshold to implement the adjustment of the service on the CPU when the set migration threshold is met, thereby reducing the power consumption of the CPU. In addition, through the setting of the low load migration factor and the low load migration threshold, the adjustment and service migration are performed according to the preset CPU decrementing strategy, which reduces the CPU power consumption and improves the efficiency of CPU power consumption adjustment.

Claims (15)

  1. 一种实现中央处理器CPU业务迁移的方法,包括:A method for implementing CPU migration of a central processing unit includes:
    当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;When the average value of the CPU load proportion on all the data plane cores reaches the load threshold, the preset service mobility factor is adjusted according to the corresponding preset step size and the preset period;
    当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。When the adjusted service mobility factor meets the migration threshold, the services on the CPU are migrated according to a preset migration policy.
  2. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整之前,根据系统业务线程对CPU性能要求划分控制面核和数据面核,并记录业务应用线程在数据面核中的分布;When the average value of the CPU load on all data planes reaches the load threshold, before the preset service mobility factor is adjusted according to the corresponding preset step size and preset period, the control plane core is divided according to the system service thread's CPU performance requirement. And data face kernel, and record the distribution of business application threads in the data plane kernel;
    在系统启动时,设置数据面核为排他绑定核;业务应用线程启动时,设置亲和性绑定至每个数据面核。When the system starts, set the data plane core to the exclusive binding core; when the business application thread starts, set the affinity binding to each data plane core.
  3. 根据权利要求2所述的方法,其中,The method of claim 2, wherein
    所述业务迁移因数包含低负荷迁移因数;所述迁移阈值包含低负荷迁移阈值;The traffic mobility factor includes a low load mobility factor; the migration threshold includes a low load migration threshold;
    所述按照预先设置的迁移策略将CPU上的业务进行迁移包括:The migration of the services on the CPU according to the preset migration policy includes:
    当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应按照预先设置的分配策略分配后,将对应的业务应用线程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求。When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding is set according to a preset After the allocation of the policy is assigned, after the corresponding service application thread is migrated to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load operation requirement.
  4. 根据权利要求2所述的方法,其中,The method of claim 2, wherein
    所述业务迁移因数包含高负荷迁移因数;所述迁移阈值包含高负荷迁移阈值;The traffic mobility factor includes a high load mobility factor; the migration threshold includes a high load migration threshold;
    所述按照预先设置的迁移策略将CPU上的业务进行迁移包括:The migration of the services on the CPU according to the preset migration policy includes:
    当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的 每个数据面核上的业务应用线程的分布恢复业务到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求。When the high load migration factor satisfies the high load migration threshold, the traffic on the CPU is based on the recorded The distribution of business application threads on each data plane core restores the service to the corresponding CPU and adjusts the frequency of the CPU that is migrated to meet the work requirements.
  5. 根据权利要求1或2所述的方法,其中,The method according to claim 1 or 2, wherein
    所述所有数据面核上CPU负荷比重的均值包括:单位时间内每个数据面核上的每个业务运行除管理开销以外的数据所占的时间的累加;The average value of the CPU load proportions on all the data plane cores includes: the accumulation of time occupied by data other than the management overhead of each service running on each data plane core per unit time;
    所述负荷阈值包含高负荷阈值和低负荷阈值。The load threshold includes a high load threshold and a low load threshold.
  6. 根据权利要求1或2所述的方法,其中,The method according to claim 1 or 2, wherein
    所述业务迁移因数包含高负荷迁移因数和低负荷迁移因数;所述按照相应的预设步长及预设周期对业务迁移因数进行调整包括:The service mobility factor includes a high load mobility factor and a low load mobility factor; the adjusting the traffic mobility factor according to the corresponding preset step size and the preset period includes:
    对高负荷迁移因数按照预设周期采用第一预设步长进行业务迁移因数的调整;Adjusting the traffic migration factor by using the first preset step size according to the preset period for the high load migration factor;
    对低负荷迁移因数按照预设周期采用第二预设步长进行业务迁移因数的调整;Adjusting the traffic migration factor by using the second preset step size according to the preset period for the low load mobility factor;
    所述第一预设步长大于第二预设步长。The first preset step size is greater than the second preset step size.
  7. 根据权利要求1或2所述的方法,其中,所述将CPU上的业务进行迁移包括:The method of claim 1 or 2, wherein the migrating the services on the CPU comprises:
    关闭数据面核上所有进行业务迁移的业务应用线程的业务相关定时器,进行业务迁移;Close the service-related timers of all service application threads that perform service migration on the data plane core to perform service migration.
    所述进行业务迁移包括:The business migration includes:
    当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据所述记录的每个数据面核上的业务应用线程业务恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求;当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用进程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求;When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the business application thread service on each data plane core of the record, and the frequency of the migrated CPU is adjusted to meet the work. When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to the preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to the preset allocation policy, and the corresponding service is allocated. After the application process migrates to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load working requirement;
    在将业务迁移到的相应的数据面核上时,开启迁移业务的业务相关定时 器,使业务应用线程继续工作。Start the service-related timing of the migration service when the service is migrated to the corresponding data plane core. The business application thread continues to work.
  8. 一种实现中央处理器CPU业务迁移的装置,包括:调整单元和迁移单元;其中,An apparatus for implementing a CPU migration of a central processing unit, comprising: an adjustment unit and a migration unit; wherein
    调整单元,设置为当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;The adjusting unit is configured to adjust the preset service mobility factor according to the preset preset step size and the preset period when the average value of the CPU load proportion on all the data plane cores reaches the load threshold;
    迁移单元,设置为当调整的业务迁移因数满足迁移阈值时,按照预先设置的迁移策略将CPU上的业务进行迁移。The migration unit is configured to migrate the services on the CPU according to a preset migration policy when the adjusted service migration factor satisfies the migration threshold.
  9. 根据权利要求8所述的装置,该装置还包括核绑定单元和核设置单元;其中,The apparatus according to claim 8, further comprising a core binding unit and a core setting unit; wherein
    核绑定单元,设置为根据系统业务线程对CPU性能要求,划分控制面核和数据面核,并记录业务应用线程在数据面核中的分布;The core binding unit is configured to divide the control plane core and the data plane core according to the CPU performance requirements of the system service thread, and record the distribution of the service application thread in the data plane kernel;
    核设置单元,设置为在系统启动时,设置数据面核为排他绑定核;业务应用线程启动时,设置亲和性绑定至每个数据面核。The core setting unit is set to set the data plane core as the exclusive binding core when the system is started; when the business application thread starts, set the affinity binding to each data plane core.
  10. 根据权利要求8所述的装置,其中,所述业务迁移因数包含低负荷迁移因数;所述迁移阈值包含低负荷迁移阈值;The apparatus of claim 8, wherein the traffic mobility factor comprises a low load mobility factor; the migration threshold comprises a low load migration threshold;
    所述迁移单元是设置为,The migration unit is configured to
    当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用线程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求。When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to a preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to a preset allocation policy, and the corresponding service application thread is allocated. After migrating to the corresponding unclosed data plane core, close the data plane core of the migrated service and adjust the CPU frequency to meet the low load operation requirements.
  11. 根据权利要求8所述的装置,其中,所述业务迁移因数包含高负荷迁移因数;所述迁移阈值包含高负荷迁移阈值;The apparatus of claim 8 wherein said traffic mobility factor comprises a high load mobility factor; said migration threshold comprises a high load migration threshold;
    所述迁移单元是设置为,The migration unit is configured to
    当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据记录的每个数据面核上的业务应用线程的分布恢复业务到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求。 When the high load migration factor satisfies the high load migration threshold, the service on the CPU restores the service to the corresponding CPU according to the distribution of the business application thread on each data plane core recorded, and adjusts the frequency of the migrated CPU to meet the work. Claim.
  12. 根据权利要求8或9所述的装置,其中,The device according to claim 8 or 9, wherein
    所述调整单元是设置为,将单位时间内每个数据面核上的每个业务运行除管理开销以外的数据所占的时间的累加作为数据面核的负荷比重的均值,当所有数据面核上CPU负荷比重的均值达到负荷阈值时,对预先设置的业务迁移因数按照相应的预设步长及预设周期进行调整;The adjusting unit is configured to calculate, as the average value of the load proportion of the data plane core, of the time occupied by the data except for the management overhead for each service running on each data plane core in a unit time, when all the data face kernels When the average value of the upper CPU load reaches the load threshold, the preset service migration factor is adjusted according to the preset preset step size and the preset period;
    所述负荷阈值包含高负荷阈值和低负荷阈值。The load threshold includes a high load threshold and a low load threshold.
  13. 根据权利要求8或9所述的装置,其中,所述业务迁移因数包含高负荷迁移因数和低负荷迁移因数;The apparatus of claim 8 or 9, wherein the traffic mobility factor comprises a high load mobility factor and a low load mobility factor;
    所述调整单元是设置为,The adjustment unit is configured to
    对高负荷迁移因数按照预设周期采用第一预设步长进行业务迁移因数的调整;对低负荷迁移因数按照预设周期采用第二预设步长进行业务迁移因数的调整;Adjusting the service mobility factor by using the first preset step size according to the preset period for the high load mobility factor; and adjusting the service mobility factor by using the second preset step size according to the preset period for the low load mobility factor;
    所述第一预设步长大于第二预设步长。The first preset step size is greater than the second preset step size.
  14. 根据权利要求8或9所述的装置,其中,The device according to claim 8 or 9, wherein
    所述迁移单元是设置为,当调整的业务迁移因数满足迁移阈值时,关闭数据面核上所有进行业务迁移的业务应用线程的业务相关定时器,进行业务迁移;The migration unit is configured to: when the adjusted service mobility factor meets the migration threshold, shut down the service-related timers of all the service application threads that perform service migration on the data plane core, and perform service migration;
    所述进行业务迁移包括:The business migration includes:
    当高负荷迁移因数满足高负荷迁移阈值时,将CPU上业务根据所述记录的每个数据面核上的业务应用线程业务恢复到相应的CPU上,并调整迁移到的CPU的频率以满足工作要求;当低负荷迁移因数满足低负荷迁移阈值时,将CPU上的业务按照预先设置的CPU递减策略进行递减,将递减部分的数据面核上业务按照预先设置的分配策略分配,将对应的业务应用进程迁移到相应的未关闭的数据面核后,关闭已迁出业务的数据面核,并调整该CPU频率以满足低负荷工作要求;When the high load migration factor satisfies the high load migration threshold, the service on the CPU is restored to the corresponding CPU according to the business application thread service on each data plane core of the record, and the frequency of the migrated CPU is adjusted to meet the work. When the low load migration factor satisfies the low load migration threshold, the service on the CPU is decremented according to the preset CPU decrement policy, and the service on the data plane of the decremented part is allocated according to the preset allocation policy, and the corresponding service is allocated. After the application process migrates to the corresponding unclosed data plane core, the data plane core of the migrated service is closed, and the CPU frequency is adjusted to meet the low load working requirement;
    在将业务迁移到的相应的数据面核上时,开启迁移业务的业务相关定时器,使业务应用线程继续工作。When the service is migrated to the corresponding data plane core, the service-related timer of the migration service is started, so that the service application thread continues to work.
  15. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1~7中任一项所述方法。 A computer storage medium having stored therein computer executable instructions for performing the method of any one of claims 1-7.
PCT/CN2015/073414 2014-11-25 2015-02-28 Method and device for implementing cpu service migration WO2016082360A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410691203.X 2014-11-25
CN201410691203.XA CN105700951B (en) 2014-11-25 2014-11-25 Method and device for realizing CPU service migration

Publications (1)

Publication Number Publication Date
WO2016082360A1 true WO2016082360A1 (en) 2016-06-02

Family

ID=56073443

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073414 WO2016082360A1 (en) 2014-11-25 2015-02-28 Method and device for implementing cpu service migration

Country Status (2)

Country Link
CN (1) CN105700951B (en)
WO (1) WO2016082360A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309036B (en) * 2018-03-27 2023-02-10 华为技术有限公司 CPU occupancy rate detection method and detection equipment
CN110928661B (en) * 2019-11-22 2023-06-16 北京浪潮数据技术有限公司 Thread migration method, device, equipment and readable storage medium
CN114968540A (en) * 2021-02-23 2022-08-30 华为技术有限公司 Frequency adjustment method for inter-core migration

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013387A (en) * 2007-02-09 2007-08-08 华中科技大学 Load balancing method based on object storage device
CN101256515A (en) * 2008-03-11 2008-09-03 浙江大学 Method for implementing load equalization of multicore processor operating system
CN103024034A (en) * 2012-12-11 2013-04-03 华为技术有限公司 Scheduling method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090005921A (en) * 2007-07-10 2009-01-14 삼성전자주식회사 Load balancing method and apparatus in symmetric multi-processor system
CN103188277B (en) * 2011-12-27 2016-05-18 中国电信股份有限公司 load energy consumption management system, method and server
KR20140080058A (en) * 2012-12-20 2014-06-30 삼성전자주식회사 Load balancing method for multicore and mobile terminal
CN103957231B (en) * 2014-03-18 2015-08-26 成都盛思睿信息技术有限公司 A kind of virtual machine distributed task dispatching method under cloud computing platform

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013387A (en) * 2007-02-09 2007-08-08 华中科技大学 Load balancing method based on object storage device
CN101256515A (en) * 2008-03-11 2008-09-03 浙江大学 Method for implementing load equalization of multicore processor operating system
CN103024034A (en) * 2012-12-11 2013-04-03 华为技术有限公司 Scheduling method and device

Also Published As

Publication number Publication date
CN105700951A (en) 2016-06-22
CN105700951B (en) 2021-01-26

Similar Documents

Publication Publication Date Title
US9176572B2 (en) System and method for controlling central processing unit power with guaranteed transient deadlines
US10613876B2 (en) Methods and apparatuses for controlling thread contention
US9104411B2 (en) System and method for controlling central processing unit power with guaranteed transient deadlines
US9367340B2 (en) Resource management method and apparatus for virtual machine system, and virtual machine system
JP6125539B2 (en) Dynamic power management in real-time systems
KR101659705B1 (en) System and method for controlling central processing unit power with guaranteed transient deadlines
US9323559B2 (en) Reducing virtual machine suspension time in checkpoint system
WO2012103728A1 (en) Method for dispatching central processing unit of hotspot domain virtual machine and virtual machine system
WO2016082360A1 (en) Method and device for implementing cpu service migration
US20090198979A1 (en) Processor performance state optimization
Devadas et al. Real-time dynamic power management through device forbidden regions
KR101578336B1 (en) System and method for controlling central processing unit power with guaranteed transient deadlines
CN103345296A (en) Dynamic voltage frequency adjustment trigger device and method
CN107872480B (en) Big data cluster data balancing method and device
WO2016058149A1 (en) Method for predicting utilization rate of processor, processing apparatus and terminal device
JP6795827B1 (en) IaaS host energy saving method and its system
Kim et al. Neural Network Characteristics-aware Proactive Boost for Heterogeneous Computing to Improve Energy Efficiency
JP2019049844A (en) Control device and control method and control program
KR20220084900A (en) Apparatus and method for interrupt control
WO2020237728A1 (en) Method supporting performance guarantee and for assessing quantity of virtual machines in operating mode
Tambe et al. Virtual batching approach for green computing
Devadas System-Level Energy Management for Real-Time Systems
Aydin Real-Time Dynamic Power Management through Device Forbidden Regions

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

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

Country of ref document: EP

Kind code of ref document: A1