WO2025201154A1 - 处理器的调度方法、装置、电子设备、存储介质和芯片 - Google Patents

处理器的调度方法、装置、电子设备、存储介质和芯片

Info

Publication number
WO2025201154A1
WO2025201154A1 PCT/CN2025/083638 CN2025083638W WO2025201154A1 WO 2025201154 A1 WO2025201154 A1 WO 2025201154A1 CN 2025083638 W CN2025083638 W CN 2025083638W WO 2025201154 A1 WO2025201154 A1 WO 2025201154A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor
parameter
storage resource
operating frequency
influencing
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
PCT/CN2025/083638
Other languages
English (en)
French (fr)
Inventor
罗志强
陈棚
蔡启烈
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Publication of WO2025201154A1 publication Critical patent/WO2025201154A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Definitions

  • Table 2 shows a mapping relationship between the frequency of the first processor, the first influencing parameter, and the target operating frequency when the storage resource is a processor cache.
  • the first processor can obtain a positive power consumption benefit only when the CPU obtains a sufficiently large power consumption benefit, such as an increase in power consumption greater than the increase in power consumption caused by increasing the operating frequency of the storage resources, thereby reducing the overall power consumption of the system where the first processor is located.
  • operating parameters of the first processor are obtained so as to determine whether increasing the operating frequency of the storage resource can produce positive power consumption benefits based on the operating parameters.
  • the first frequency and the first power consumption may be determined based on actual usage requirements, and their specific values will not be described in detail here.
  • the storage space allocated to the first processor in the processor cache is increased to further reduce the access delay of the first processor, thereby reducing the impact of storage resources on the computing performance of the first processor, thereby improving the overall power consumption of the first processor.
  • the storage space allocated to the first processor in the processor cache can be increased according to a fixed space size, or can be increased according to a fixed share of the processor cache. It can be selected according to actual usage needs, and its specific value will not be repeated here.
  • the operating frequency of the storage resource is increased, specifically including: obtaining a comparison result of the second influencing parameter and the second parameter threshold, the second influencing parameter being the degree to which the computing performance of the second processor is affected by the storage resource, and the second processor and the first processor are provided on the same chip; when the first influencing parameter is greater than or equal to the first parameter threshold, and the second influencing parameter is greater than or equal to the second parameter threshold, increasing the operating frequency of the storage resource; when the first influencing parameter is greater than or equal to the first parameter threshold, and the second influencing parameter is less than the second parameter threshold, keeping the operating frequency of the storage resource unchanged; when the first influencing parameter is less than the first parameter threshold, and the second influencing parameter is greater than or equal to the second parameter threshold, keeping the operating frequency of the storage resource unchanged.
  • the determination results based on the first processor and the second processor as reference are inconsistent. At this time, the operating frequency of the storage resource can be kept unchanged to ensure stable operation of the chip.
  • the flowchart of the processor scheduling method includes:
  • Step 406 The central processing unit of the core needs to increase the resource allocation of the processor cache. If the result of the judgment is yes, execute step 404; if the result of the judgment is no, execute step 408;
  • Step 408 The small-core CPU needs to increase the resource allocation of the processor cache. If the result is yes, execute step 404; if the result is no, end;
  • Step 410 The large-core CPU needs to increase the resource allocation of the main memory. If the result is yes, go to step 412; if the result is no, go to step 414;
  • Step 412 increasing the operating frequency of the main memory
  • Step 416 The small-core CPU needs to increase the resource allocation of the main memory. If the judgment result is yes, execute step 412; if the judgment result is no, end.
  • Step 502 Check whether the periodic count has overflowed or the periodic task has been completed. If the result is yes, go to step 504. If the result is no, end.
  • Step 514 If the operating power consumption and operating frequency exceed the set threshold, if the judgment result is yes, proceed to step 516; if the judgment result is no, end;
  • Step 516 increase the operating frequency of the main memory.
  • the scheduling method of the processor includes:
  • Step 602 Check whether the periodic count has overflowed or the periodic task has been completed. If the result is yes, proceed to step 604. If the result is no, the process ends.
  • Step 606 Check whether the first influencing parameter exceeds threshold 1. If the result is yes, proceed to step 608; if the result is no, end.
  • Step 612 Check whether the first influencing parameter exceeds threshold 2. If the result is yes, proceed to step 614; if the result is no, end.
  • Step 614 If the operating power consumption and operating frequency exceed the set threshold, if the result is yes, proceed to step 616; if the result is no, end;
  • Step 620 If the operating power consumption and operating frequency exceed the set threshold, if the judgment result is yes, execute step 622; if the judgment result is no, end;
  • Step 622 Increase the system cache connected to the central processing unit, and increase the allocation of the system cache to the central processing unit.
  • a processor scheduling device 700 including: an acquisition module 702, used to obtain a first influencing parameter of a first processor, the first influencing parameter being used to indicate the degree to which the computing performance of the first processor is affected by the storage resource; an adjustment module 704, used to adjust the operating frequency of the storage resource based on the first influencing parameter; wherein the storage resource includes one or more of a processor cache, a main memory, and a system cache connected to the first processor.
  • the acquisition module 702 is specifically used to: when the periodic count of the first processor overflows or the execution of the periodic task is completed, obtain the first count value and the second count value recorded by the event counter, the first count value is used to represent the first duration, and the second count value is used to represent the second duration.
  • the acquisition module 702 is further used to: obtain the operating parameters of the first processor, the operating parameters including the operating frequency or the operating power consumption; the adjustment module 704 is specifically used to: increase the operating frequency of the storage resource when the first influencing parameter is greater than or equal to the first parameter threshold and the operating frequency is greater than or equal to the first frequency; or increase the operating frequency of the storage resource when the first influencing parameter is greater than or equal to the first parameter threshold and the operating power consumption is greater than or equal to the first power consumption.
  • the adjustment module 704 when the operating frequency of the processor cache is increased, is also used to: increase the storage space allocated to the first processor in the processor cache; or increase the storage space allocated to the first thread in the processor cache; wherein the first thread is a thread running on the first processor.
  • the adjustment module 704 is specifically used to: obtain a comparison result between a second influencing parameter and a second parameter threshold, where the second influencing parameter is the degree to which the computing performance of the second processor is affected by the storage resource, and the second processor and the first processor are arranged on the same chip; when the first influencing parameter is greater than or equal to the first parameter threshold, and the second influencing parameter is greater than or equal to the second parameter threshold, increase the operating frequency of the storage resource; when the first influencing parameter is greater than or equal to the first parameter threshold, and the second influencing parameter is less than the second parameter threshold, keep the operating frequency of the storage resource unchanged; when the first influencing parameter is less than the first parameter threshold, and the second influencing parameter is greater than or equal to the second parameter threshold, keep the operating frequency of the storage resource unchanged.
  • the scheduling device 700 of the processor in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip.
  • the electronic device can be a terminal or other devices other than a terminal.
  • the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR)/virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc.
  • It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.
  • the processor scheduling device in the embodiment of the present application can be a device having an operating system.
  • the operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
  • the processor scheduling device provided in the embodiment of the present application can implement the various processes implemented by the processor scheduling method embodiment of Figure 3, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • an embodiment of the present application also provides an electronic device 800, including a processor 802 and a memory 804, and the memory 804 stores a program or instruction that can be run on the processor 802.
  • the program or instruction is executed by the processor 802
  • the various steps of the above-mentioned processor scheduling method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG9 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910.
  • the electronic device 900 may further include a power source (e.g., a battery) to power various components.
  • the power source may be logically connected to the processor 910 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption.
  • the electronic device structure shown in FIG9 does not limit the electronic device.
  • the electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently, which will not be described in detail here.
  • the processor 910 is used to: obtain a first impact parameter of the first processor, the first impact parameter being used to indicate the extent to which the computing performance of the first processor is affected by the storage resource; adjust the operating frequency of the storage resource based on the first impact parameter; wherein the storage resource includes one or more of a processor cache, a main memory, and a system cache connected to the first processor.
  • the first influencing parameter includes a ratio of a first duration to a second duration; wherein the first duration represents the working duration of the first processor, and the second duration is used to represent the stop duration of the first processor due to a first condition, and the first condition includes one of the following: front-end congestion caused by storage resource delay, back-end congestion caused by storage resource delay, front-end congestion caused by storage resource delay and back-end congestion caused by storage resource delay, front-end congestion caused by storage resource delay caused by cache miss, back-end congestion caused by storage resource delay caused by cache miss, front-end congestion caused by storage resource delay caused by cache miss, and back-end congestion caused by storage resource delay caused by cache miss.
  • the processor 910 is specifically used to: when the periodic count of the first processor overflows or the execution of the periodic task is completed, obtain the first count value and the second count value recorded by the event counter, the first count value is used to represent the first duration, and the second count value is used to represent the second duration.
  • the processor 910 is specifically used to: increase the operating frequency of the storage resource when the first influencing parameter is greater than or equal to the first parameter threshold; and maintain the operating frequency of the storage resource unchanged when the first influencing parameter is less than the first parameter threshold.
  • the processor 910 is also used to: obtain operating parameters of the first processor, the operating parameters including operating frequency or operating power consumption; when the first influencing parameter is greater than or equal to the first parameter threshold, increase the operating frequency of the storage resource.
  • the processor 910 is specifically used to: when the first influencing parameter is greater than or equal to the first parameter threshold and the operating frequency is greater than or equal to the first frequency, increase the operating frequency of the storage resource; or when the first influencing parameter is greater than or equal to the first parameter threshold and the operating power consumption is greater than or equal to the first power consumption, increase the operating frequency of the storage resource.
  • the processor 910 when the operating frequency of the processor cache is increased, is further used to: increase the storage space allocated to the first processor in the processor cache; or increase the storage space allocated to the first thread in the processor cache; wherein the first thread is a thread running on the first processor.
  • the processor 910 is also used to: obtain a comparison result between a second influencing parameter and a second parameter threshold, where the second influencing parameter is the degree to which the computing performance of the second processor is affected by the storage resource, and the second processor and the first processor are provided on the same chip; when the first influencing parameter is greater than or equal to the first parameter threshold, and the second influencing parameter is greater than or equal to the second parameter threshold, increase the operating frequency of the storage resource; when the first influencing parameter is greater than or equal to the first parameter threshold, and the second influencing parameter is less than the second parameter threshold, keep the operating frequency of the storage resource unchanged; when the first influencing parameter is less than the first parameter threshold, and the second influencing parameter is greater than or equal to the second parameter threshold, keep the operating frequency of the storage resource unchanged.
  • the first influencing parameter obtained can indicate the degree to which the computing performance of the first processor is affected by the storage resources, so the first influencing parameter can be used to adjust the operating frequency of the storage resources.
  • the operating frequency of the storage resources is adjusted to alleviate or improve the degree to which the computing performance is affected by the storage resources, thereby improving the energy efficiency of the first processor.
  • the input unit 904 may include a graphics processing unit (GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode.
  • the display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc.
  • the user input unit 907 includes a touch panel 9071 and at least one of the other input devices 9072.
  • the touch panel 9071 is also called a touch screen.
  • the touch panel 9071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 9072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
  • the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory may be random access memory (RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DRRAM).
  • RAM random access memory
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate synchronous DRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous link DRAM
  • DRRAM direct RAM
  • the memory 909 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
  • Processor 910 may include one or more processing units.
  • processor 910 integrates an application processor and a modem processor.
  • the application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 910.
  • An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored.
  • the program or instruction is executed by the processor, the various processes of the scheduling method embodiment of the above-mentioned processor are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
  • the processor is the processor in the electronic device in the above embodiment.
  • the readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
  • An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the scheduling method embodiment of the above-mentioned processor, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • processors mentioned in the embodiments of the present application can also be called a system-level processor, a system processor, a processor system, or a system-on-chip processor, etc.
  • An embodiment of the present application provides a computer program product, which is stored in a storage medium.
  • the program product is executed by at least one processor to implement the various processes of the scheduling method embodiment of the above-mentioned processor, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • the embodiments of the present application are essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
  • a storage medium such as ROM/RAM, magnetic disk, optical disk

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本申请公开了一种处理器的调度方法、装置、电子设备、存储介质和芯片,属于信息调度技术领域。处理器的调度方法,包括:获取第一处理器的第一影响参数,第一影响参数用于表示第一处理器的计算性能受到存储资源的影响程度;基于第一影响参数调整存储资源的工作频率;其中,存储资源包括处理器缓存、主存、与第一处理器对接的系统缓存中的一种或多种。

Description

处理器的调度方法、装置、电子设备、存储介质和芯片
相关申请的交叉引用
本申请要求享有于2024年03月25日提交的中国专利申请202410343144.0的优先权,该申请的全部内容通过引用并入本文中。
技术领域
本申请属于信息调度技术领域,具体涉及一种处理器的调度方法、装置、电子设备、存储介质和芯片。
背景技术
处理器调度是操作系统中一个重要的功能,通过动态地分配中央处理器(Central Processing Unit,CPU)的时间片,实现多个进程/线程的并发执行。
以Linux系统为例,其采用完全公平调度器(Completely Fair Scheduler,CFS)进行调度,其中,CFS采用时间片轮转的方式,为每个进程分配CPU时间片,保证进程间的公平竞争,提高系统的性能和响应速度。
其中,CFS会根据当前CPU的负载情况和设定的调频策略来决定CPU的运行频率。通常,当CPU处于高负载状态时会提高频率以提高计算能力,而在空闲状态下会降低频率以节省能量。用户也可以手动设置CPU的运行频率,以满足不同的性能和功耗需求。
而上述调度方案是以CPU的运行时间来做调度依据,无法识别CPU的性能受存储资源影响的情况,无法提升CPU的能效。
发明内容
本申请实施例的目的是提供一种处理器的调度方法、装置、电子设备、存储介质和芯片,能够解决以CPU的运行时间来做调度依据,无法识别CPU的性能受存储资源影响的情况,无法提升CPU的能效的问题。
第一方面,本申请实施例提供了一种处理器的调度方法,包括:获取第一处理器的第一影响参数,第一影响参数用于表示第一处理器的计算性能受到存储资源的影响程度;基于第一影响参数调整存储资源的工作频率;其中,存储资源包括处理器缓存、主存、与第一处理器对接的系统缓存中的一种或多种。
第二方面,本申请实施例提供了一种处理器的调度装置,包括:获取模块,用于获取第一处理器的第一影响参数,第一影响参数用于表示第一处理器的计算性能受到存储资源的影响程度;调整模块,用于基于第一影响参数调整存储资源的工作频率;其中,存储资源包括处理器缓存、主存、与第一处理器对接的系统缓存中的一种或多种。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤。
第五方面,本申请实施例提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面的方法的步骤。
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面的方法的步骤。
在本申请实施例中,获取得到的第一影响参数能够表示第一处理器的计算性能受到存储资源的影响程度,故可以利用第一影响参数来调整存储资源的工作频率,在此过程中,在第一处理器的计算性能受到存储资源的影响程度较大的情况下,通过调整存储资源的工作频率,以便缓解或改善计算性能受到存储资源的影响程度,进而提升第一处理器的能效。
附图说明
图1是本申请一些实施例中的芯片中CPU子系统的系统架构图之一;
图2是本申请一些实施例中的芯片中CPU子系统的系统架构图之二;
图3是本申请一些实施例中的处理器的调度方法的流程示意图之一;
图4是本申请一些实施例中在芯片包含大核中央处理器、中核中央处理器和小核中央处理器的情况下,芯片的调度方法的流程示意图;
图5是本申请一些实施例中的处理器的调度方法的流程示意图之二;
图6是本申请一些实施例中的处理器的调度方法的流程示意图之三;
图7是本申请实施例中的处理器的调度装置的示意框图;
图8是本申请实施例中的电子设备的示意框图;
图9是本申请实施例中的电子设备的硬件结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的实施例进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
处理器缓存是指处理器私有的缓存和共享的缓存,在本申请的实施例中,处理器缓存以三级缓存(L3 Cache)为例。
主存(Memory),即内存,也称之内存储器和主存储器,用于暂时存放处理器中的运算数据,以及与硬盘等外部存储器交互的数据,它是外存与处理器进行沟通的桥梁。
与第一处理器对接的系统缓存(System Level Cache),也即第一处理器所在的子系统与其他子系统所共用的缓存,其位于处理器缓存与主存之间。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的处理器的调度方法、装置、电子设备、存储介质和芯片进行详细地说明。
示例性地,图1示出了芯片中CPU子系统的系统架构图,如图1所示,芯片的系统包含三种类型的CPU核心,也即,大核中央处理器、中核中央处理器和小核中央处理器。
具体地,大核中央处理器,Big CPU,也即大核CPU,用于处理高性能任务,如运行大型游戏或高负载应用程序;中核中央处理器,Middle CPU,也即中核CPU,用于处理中等负载的任务,如日常应用程序和浏览器;小核中央处理器,Little CPU,也即小核CPU,用于处理低负载的任务,例如后台应用程序和系统维护任务。
其中,Big CPU+Middle CPU+Little CPU的分层设计可以满足性能需要的同时,可以最大程度的降低芯片的能耗。
在本申请中的一些实施例中,芯片的系统架构图是大核CPU,多个中核CPU,多个小核CPU的组合。
示例性地,可采用“1+3+4”的设计,也即是1个Big CPU+3Middle CPU+4Little CPU,或者采用“1+5+2”的设计,也即是1Big CPU+5Middle CPU+2Little CPU。
对于每一个CPU,每个CPU核都有私有的缓存(Cache)和共享的缓存(Cache)。一个典型的CPU Cache层次架构包含一级缓存(L1 Cache),二级缓存(L2 Cache),三级缓存(L3 Cache)。其中L1 Cache是最接近CPU的缓存,其主要作用是存储CPU正在处理的数据和指令,分成指令缓存(Instruction Cache,以i Cache表示)和数据缓存(Data Cache,以dCache表示)。L2 Cache位于L1和L3之间,可能是私有的,也可以是共享的,容量比L1 Cache大,目的是提高命中率和降低访问延时。
L3 Cache位于L2 Cache和主存之间,是CPU子系统共享的,提供更大容量的缓存,进一步降低CPU访问延时。L3 Cache享有独立的时钟域,可以根据各个CPU的需要调节工作的时钟频点。L3 Cache的工作时钟的确定可以根据各个CPU的投票来确定,也可以根据各个CPU工作频率来确定。另外,L3 Cache也可以根据各个CPU的实际需求,单独为某个CPU分配专用空间,提高某个CPU在L3 Cache的命中率,降低访问延时,从而提高CPU性能。
其中,架构图中的主存是系统的主存,位于L3 Cache之后,除服务于CPU之外,还可能为系统中其他子系统提供服务。主存的运行频率可以根据系统中各个子系统的带宽需求来确定,也可以根据各个子系统的投票来确定。
图2示出了芯片中CPU子系统的系统架构图,如图2所示,芯片中CPU子系统与其他子系统对接在System Level Cache后,也即本申请中的与第一处理器对接的系统缓存,再连接到主存。
其中,其他子系统可以是图形处理器(graphics processing unit,GPU)系统,神经网络处理器(Neural network Processing Unit,NPU)子系统,媒体(Media)子系统的一个或多个。
在其中一个实施例中,如图3所示,提出了一种处理器的调度方法,包括:
步骤302,获取第一处理器的第一影响参数,第一影响参数用于表示第一处理器的计算性能受到存储资源的影响程度;
步骤304,基于第一影响参数调整存储资源的工作频率。
其中,存储资源包括处理器缓存、主存、与第一处理器对接的系统缓存中的一种或多种。
在本申请实施例中,获取得到的第一影响参数能够表示第一处理器的计算性能受到存储资源的影响程度,故可以利用第一影响参数来调整存储资源的工作频率,在此过程中,在第一处理器的计算性能受到存储资源的影响程度较大的情况下,通过调整存储资源的工作频率,以便缓解或改善计算性能受到存储资源的影响程度,进而提升第一处理器的能效。
在本申请中的一些实施例中,处理器缓存也即本申请中的三级缓存。
在本申请中的一些实施例中,第一影响参数包括第一时长与第二时长的比值;其中,第一时长表示第一处理器的工作时长,第二时长用于表示因第一条件致使第一处理器停止运行的停止时长,第一条件包括以下之一:存储资源延时造成的前端阻塞、存储资源延时造成的后端阻塞、存储资源延时造成的前端阻塞和存储资源延时造成的后端阻塞、缓存未命中造成的存储资源延时致使的前端阻塞、缓存未命中造成的存储资源延时致使的后端阻塞、缓存未命中造成的存储资源延时致使的前端阻塞和缓存未命中造成的存储资源延时致使的后端阻塞。
在本申请中的一些实施例中,获取第一处理器的第一影响参数,具体包括:
在第一处理器周期性计数溢出或周期性任务执行结束的情况下,获取事件计数器记录的第一计数值和第二计数值,第一计数值用于表示第一时长,第二计数值用于表示第二时长。
在其中一个实施例中,事件计数器是性能监控计数寄存器(Performance Monitoring Counter,PMC)。
示例性地,表1记载了ARM CPU提供了部分性能事件的监控内容,例如事件号0x11记录CPU运行的Cycle数,又如事件号0x24记录CPU因后端而造成的流水线阻塞的Cycle数。
表1
其中,CPU_CYCLES事件记录CPU运行的Cycle数,以CPU实时运行的频率来计数,CPU_CYCLES也即本申请中的第一计数值,Cache miss表示缓存未命中,Memory表示内存,SOC,System on Chip,片上系统,Dispatch表示调度。
其中,STALL_BACKEND_MEM事件记录CPU因最后一级Cache Miss造成的后端阻塞的Cycle数。此事件是观测CPU因Memory Bound造成流水线停滞的最直接事件。第一影响参数Memory Bound可以基于以下公式来表达:
Memory Bound=STALL_FRONTEND_MEM/CPU_CYCLES×100%;或
Memory Bound=STALL_BACKEND_MEM/CPU_CYCLES×100%;或
Memory Bound=(STALL_BACKEND_MEM
+STALL_FRONTEND_MEM)/CPU_CYCLES×100%;或
Memory Bound=STALL_FRONTEND_MEMBOUND/CPU_CYCLES×100%;或
Memory Bound=STALL_BACKEND_MEMBOUND/CPU_CYCLES×100%;或
Memory Bound=(STALL_BACKEND_MEMBOUND
+STALL_FRONTEND_MEMBOUND)/CPU_CYCLES×100%。
由上可知,Memory Bound的指标可以是某个CPU的Performance Monitoring Counter的统计,也可以是某个线程或进程在多个CPU的Performance Monitoring Counter的统计。
在本申请中的一些实施例中,上文中的运行频率可以是实时频率,也可以是一段时间内的平均频率。
其中,第一计数值可以是基于第一中央处理器的实时频率统计得到的,也可以是基于第一中央处理器的平均频率统计得到的。
具体地,CNT_CYCLES事件记录CPU以一个固定频率计数运行的Cycle数。固定频率由SOC厂家决定,示例性地,固定频率以24MHz为例,周期为41.667ns,则平均频率CPU Average Frequency表达如下:
CPU Average Frequency=CPU_CYCLES/(CNT_CYCLES×41.667ns)。在本申请中的一些实施例中,基于第一影响参数调整存储资源的工作频率,具体包括:在第一影响参数大于或等于第一参数阈值的情况下,调高存储资源的工作频率;在第一影响参数小于第一参数阈值的情况下,保持存储资源的工作频率不变。
在该实施例中,通过设置第一参数阈值,以便利用第一参数阈值来衡量第一影响参数的大小,进而确定第一处理器的计算性能受到存储资源的影响程度的大小。
具体地,在第一影响参数大于或等于第一参数阈值的情况下,认为第一处理器的计算性能受到存储资源的影响程度比较大,此时,需要调高存储资源的工作频率,以便改善存储资源对第一处理器的计算性能的影响,以此来提升第一处理器的能效。
而对于第一影响参数小于第一参数阈值的情况下,认为第一处理器的计算性能受到存储资源的影响程度比较小,此时,保持存储资源的工作频率不变,以确保第一处理器的稳定运行。
在本申请中的一些实施例中,第一参数阈值可以根据实际使用需要进行设置,其具体取值,在此不再进行赘述。
在本申请中的一些实施例中,可以根据存储资源的不同,选取不同的第一参数阈值,进而根据第一影响参数与第一参数阈值的比较结果,对不同的存储资源的工作频率进行调整。
示例性地,在存储资源是处理器缓存的情况下,第一参数阈值选取为阈值1,则在第一影响参数大于或等于阈值1的情况下,调高处理器缓存的工作频率。
示例性地,在存储资源是主存的情况下,第一参数阈值选取为阈值2,则在第一影响参数大于或等于阈值2的情况下,调高主存的工作频率。
示例性地,在存储资源是与处理器对接的系统缓存的情况下,第一参数阈值选取为阈值3,则在第一影响参数大于或等于阈值3的情况下,调高与第一处理器对接的系统缓存的工作频率。
在本申请中的一些实施例中,预先构建第一处理器的频率、第一影响参数和目标工作频率的映射关系,进而在确定第一影响参数和第一处理器的频率之后,直接得到调高存储资源的工作频率。
表2示出了在存储资源是处理器缓存的情况下,第一处理器的频率、第一影响参数和目标工作频率的映射关系。
表2
表3示出了在存储资源是主存的情况下,第一处理器的频率、第一影响参数和目标工作频率的映射关系。
表3
表4示出了在存储资源是与第一处理器对接的系统缓存的情况下,第一处理器的频率、第一影响参数和目标工作频率的映射关系。
表4
在本申请中的一些实施例中,处理器的调度方法还包括:获取第一处理器的运行参数,运行参数包括运行频率或运行功耗;在第一影响参数大于或等于第一参数阈值的情况下,调高存储资源的工作频率,具体包括:在第一影响参数大于或等于第一参数阈值、且运行频率大于或等于第一频率的情况下,调高存储资源的工作频率;或在第一影响参数大于或等于第一参数阈值、且运行功耗大于或等于第一功耗的情况下,调高存储资源的工作频率。
在该实施例中,考虑到在提升存储资源的工作频率的同时,也会增加存储资源的功耗,通常情况下,需要保证CPU在获得足够大的功耗收益时,如大于提升存储资源的工作频率所产生的功耗增加,第一处理器才能得到正向的功耗收益,以此来降低第一处理器所在系统的整体功耗。
为了达成上述目标,在本申请的实施例中,通过获取第一处理器的运行参数,以便根据运行参数来判定提升存储资源的工作频率是否能够产生正向的功耗收益。
具体地,在运行频率大于或等于第一频率的情况下,认为第一处理器运行在较高频率的状态,此时,通过提升存储资源的工作频率能够产生正向的功耗收益,故在第一影响参数大于或等于第一参数阈值、且运行频率大于或等于第一频率的情况下,调高存储资源的工作频率,以便降低第一处理器的整体功耗。
同理,运行功耗大于或等于第一功耗的情况下,认为第一处理器运行在较高功耗的状态,此时,通过提升存储资源的工作频率能够产生正向的功耗收益,故在第一影响参数大于或等于第一参数阈值、且运行功耗大于或等于第一功耗的情况下,调高存储资源的工作频率,以便降低第一处理器的整体功耗。
在本申请中的一些实施例中,第一频率和第一功耗可以根据实际使用需要进行取值,其具体取值在此不再进行赘述。
在本申请中的一些实施例中,在调高处理器缓存的工作频率的情况下,处理器的调度方法还包括:增大处理器缓存中对第一处理器分配的存储空间;或增大处理器缓存中对第一线程分配的存储空间;其中,第一线程是运行在第一处理器的线程。
在该实施例中,通过增大处理器缓存中对第一处理器分配的存储空间,以便进一步降低第一处理器的访问延时,进而降低存储资源对第一处理器的计算性能的影响,以此来提升第一处理器的整体功耗。
在上述实施例中,在第一处理器中运行的线程为多个的情况下,不同线程所对应的优先级不同,第一线程的优先级高于第二线程的优先级,其中,第二线程是第一处理器中运行的线程中除了第一线程之外的线程。
在该实施例中,可以为高优先级的线程划分更多的处理器缓存,约束第一处理器所在系统或后台线程所占用的处理器缓存。
在本申请中的一些实施例中,处理器缓存中对第一处理器分配的存储空间可以是按照固定空间大小增加,也可以是按照处理器缓存的固定份额增加,其可以根据实际使用需要进行选取,其具体取值,在此不再进行赘述。
在本申请中的一些实施例中,在第一影响参数大于或等于第一参数阈值的情况下,调高存储资源的工作频率,具体包括:获取第二影响参数与第二参数阈值的比较结果,第二影响参数是第二处理器的计算性能受到存储资源的影响程度,第二处理器和第一处理器设于同一个芯片;在第一影响参数大于或等于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,调高存储资源的工作频率;在第一影响参数大于或等于第一参数阈值、且第二影响参数小于第二参数阈值的情况下,保持存储资源的工作频率不变;在第一影响参数小于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,保持存储资源的工作频率不变。
在该实施例中,在芯片包含的中央处理器为多个的情况下,存储资源的工作频率的增加,也会影响其他中央处理的功耗。
在本申请的实施例中,通过获取第二处理器的第二影响参数,以便基于第二影响参数与第二参数阈值的比较结果来确定以第二处理器作为参考,是否需要调整存储资源的工作频率,并在根据第一影响参数来调整存储资源的工作频率的过程中,将第二处理器下的判定结果作为参考,以便判定是否需要调整存储资源的工作频率。在此过程中,可以较为合理地对存储资源的工作频率进行调整,进而确保芯片的整体能效。
具体地,若在第一影响参数大于或等于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,则认为以第一处理器和第二处理器作为参考,都需要调高存储资源的工作频率,以此来确保芯片的整体能效。
对于在第一影响参数大于或等于第一参数阈值、且第二影响参数小于第二参数阈值的情况下,以及在第一影响参数小于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,以第一处理器和第二处理器作为参考的判定结果不一致,此时,可以保持存储资源的工作频率不变,以确保芯片的稳定运行。
在本申请中的一些实施例中,图4示出了在芯片包含大核中央处理器、中核中央处理器和小核中央处理器的情况下,芯片的调度方法的流程示意图。
如图4所示,在存储资源包括处理器缓存和主存的情况下,处理器的调度方法的流程示意图包括:
步骤402,大核中央处理器需要调高处理器缓存的资源分配,在判断结果为是,执行步骤404,在判断结果为否,执行步骤406;
步骤404,提高处理器缓存的工作频率,提高处理器缓存对该中央处理器的分配额度;
步骤406,中核中央处理器需要调高处理器缓存的资源分配,在判断结果为是,执行步骤404,在判断结果为否,执行步骤408;
步骤408,小核中央处理器需要调高处理器缓存的资源分配,在判断结果为是,执行步骤404,在判断结果为否,结束;
步骤410,大核中央处理器需要调高主存的资源分配,在判断结果为是,执行步骤412,在判断结果为否,执行步骤414;
步骤412,提高主存的工作频率;
步骤414,中核中央处理器需要调高主存的资源分配,在判断结果为是,执行步骤412,在判断结果为否,执行步骤416;
步骤416,小核中央处理器需要调高主存的资源分配,在判断结果为是,执行步骤412,在判断结果为否,结束。
其中,调高处理器缓存的资源分配可以是增大处理器缓存中对大核中央处理器、中核中央处理器和小核中央处理器分配的存储空间;或增大处理器缓存中对第一线程分配的存储空间;其中,第一线程是运行在大核中央处理器、中核中央处理器和小核中央处理器的线程。
在本申请中的一些实施例中,如图5所示,以图1示出的SOC为例,则处理器的调度方法,包括:
步骤502,周期性计数是否溢出或周期性任务是否完成,在判断结果为是,执行步骤504,在判断结果为否,结束;
步骤504,中央处理器采集PMC事件计算第一影响参数和运行频率;
步骤506,第一影响参数是否超过阈值1,在判断结果为是,执行步骤508,在判断结果为否,结束;
步骤508,运行功耗和运行频率超过设定阈值,在判断结果为是,执行步骤510,在判断结果为否,结束;
步骤510,提高处理器缓存的工作频率,提高处理器缓存对该中央处理器的分配额度;
步骤512,第一影响参数是否超过阈值2,在判断结果为是,执行步骤514,在判断结果为否,结束;
步骤514,运行功耗和运行频率超过设定阈值,在判断结果为是,执行步骤516,在判断结果为否,结束;
步骤516,提高主存的工作频率。
在本申请中的一些实施例中,如图6所示,以图2示出的SOC为例,则处理器的调度方法,包括:
步骤602,周期性计数是否溢出或周期性任务是否完成,在判断结果为是,执行步骤604,在判断结果为否,结束;
步骤604,中央处理器采集PMC事件计算第一影响参数和运行频率;
步骤606,第一影响参数是否超过阈值1,在判断结果为是,执行步骤608,在判断结果为否,结束;
步骤608,运行功耗和运行频率超过设定阈值,在判断结果为是,执行步骤610,在判断结果为否,结束;
步骤610,提高处理器缓存的工作频率,提高处理器缓存对该中央处理器的分配额度;
步骤612,第一影响参数是否超过阈值2,在判断结果为是,执行步骤614,在判断结果为否,结束;
步骤614,运行功耗和运行频率超过设定阈值,在判断结果为是,执行步骤616,在判断结果为否,结束;
步骤616,提高主存的工作频率;
步骤618,第一影响参数是否超过阈值3,在判断结果为是,执行步骤620,在判断结果为否,结束;
步骤620,运行功耗和运行频率超过设定阈值,在判断结果为是,执行步骤622,在判断结果为否,结束;
步骤622,提高与中央处理器对接的系统缓存,提高系统缓存对该中央处理器的分配额度。
本申请实施例提供的处理器的调度方法,执行主体可以处理器的调度装置。本申请实施例中以处理器的调度装置执行处理器的调度方法为例,说明本申请实施例提供的处理器的调度装置。
在本申请中的一些实施例中,如图7所示,提供了一种处理器的调度装置700,包括:获取模块702,用于获取第一处理器的第一影响参数,第一影响参数用于表示第一处理器的计算性能受到存储资源的影响程度;调整模块704,用于基于第一影响参数调整存储资源的工作频率;其中,存储资源包括处理器缓存、主存、与第一处理器对接的系统缓存中的一种或多种。
在本申请实施例中,获取得到的第一影响参数能够表示第一处理器的计算性能受到存储资源的影响程度,故可以利用第一影响参数来调整存储资源的工作频率,在此过程中,在第一处理器的计算性能受到存储资源的影响程度较大的情况下,通过调整存储资源的工作频率,以便缓解或改善计算性能受到存储资源的影响程度,进而提升第一处理器的能效。
在本申请中的一些实施例中,第一影响参数包括第一时长与第二时长的比值;其中,第一时长表示第一处理器的工作时长,第二时长用于表示因第一条件致使第一处理器停止运行的停止时长,第一条件包括以下之一:存储资源延时造成的前端阻塞、存储资源延时造成的后端阻塞、存储资源延时造成的前端阻塞和存储资源延时造成的后端阻塞、缓存未命中造成的存储资源延时致使的前端阻塞、缓存未命中造成的存储资源延时致使的后端阻塞、缓存未命中造成的存储资源延时致使的前端阻塞和缓存未命中造成的存储资源延时致使的后端阻塞。
在本申请中的一些实施例中,获取模块702,具体用于:在第一处理器周期性计数溢出或周期性任务执行结束的情况下,获取事件计数器记录的第一计数值和第二计数值,第一计数值用于表示第一时长,第二计数值用于表示第二时长。
在本申请中的一些实施例中,调整模块704,具体用于:在第一影响参数大于或等于第一参数阈值的情况下,调高存储资源的工作频率;在第一影响参数小于第一参数阈值的情况下,保持存储资源的工作频率不变。
在本申请中的一些实施例中,获取模块702,还用于:获取第一处理器的运行参数,运行参数包括运行频率或运行功耗;调整模块704,具体用于:在第一影响参数大于或等于第一参数阈值、且运行频率大于或等于第一频率的情况下,调高存储资源的工作频率;或在第一影响参数大于或等于第一参数阈值、且运行功耗大于或等于第一功耗的情况下,调高存储资源的工作频率。
在本申请中的一些实施例中,在调高处理器缓存的工作频率的情况下,调整模块704,还用于:增大处理器缓存中对第一处理器分配的存储空间;或增大处理器缓存中对第一线程分配的存储空间;其中,第一线程是运行在第一处理器的线程。
在本申请中的一些实施例中,调整模块704,具体用于:获取第二影响参数与第二参数阈值的比较结果,第二影响参数是第二处理器的计算性能受到存储资源的影响程度,第二处理器和第一处理器设于同一个芯片;在第一影响参数大于或等于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,调高存储资源的工作频率;在第一影响参数大于或等于第一参数阈值、且第二影响参数小于第二参数阈值的情况下,保持存储资源的工作频率不变;在第一影响参数小于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,保持存储资源的工作频率不变。
本申请实施例中的处理器的调度装置700可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的处理器的调度装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的处理器的调度装置能够实现图3的处理器的调度方法实施例实现的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
如图8所示,本申请实施例还提供一种电子设备800,包括处理器802和存储器804,存储器804上存储有可在处理器802上运行的程序或指令,该程序或指令被处理器802执行时实现上述处理器的调度方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述的移动电子设备和非移动电子设备。
图9为实现本申请实施例的一种电子设备的硬件结构示意图。
如图9所示,该电子设备900包括但不限于:射频单元901、网络模块902、音频输出单元903、输入单元904、传感器905、显示单元906、用户输入单元907、接口单元908、存储器909、以及处理器910等部件。
本领域技术人员可以理解,电子设备900还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器910逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图9中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
在本申请中的一些实施例中,处理器910用于:获取第一处理器的第一影响参数,第一影响参数用于表示第一处理器的计算性能受到存储资源的影响程度;基于第一影响参数调整存储资源的工作频率;其中,存储资源包括处理器缓存、主存、与第一处理器对接的系统缓存中的一种或多种。
在本申请中的一些实施例中,第一影响参数包括第一时长与第二时长的比值;其中,第一时长表示第一处理器的工作时长,第二时长用于表示因第一条件致使第一处理器停止运行的停止时长,第一条件包括以下之一:存储资源延时造成的前端阻塞、存储资源延时造成的后端阻塞、存储资源延时造成的前端阻塞和存储资源延时造成的后端阻塞、缓存未命中造成的存储资源延时致使的前端阻塞、缓存未命中造成的存储资源延时致使的后端阻塞、缓存未命中造成的存储资源延时致使的前端阻塞和缓存未命中造成的存储资源延时致使的后端阻塞。
在本申请中的一些实施例中,处理器910具体用于:在第一处理器周期性计数溢出或周期性任务执行结束的情况下,获取事件计数器记录的第一计数值和第二计数值,第一计数值用于表示第一时长,第二计数值用于表示第二时长。
在本申请中的一些实施例中,处理器910具体用于:在第一影响参数大于或等于第一参数阈值的情况下,调高存储资源的工作频率;在第一影响参数小于第一参数阈值的情况下,保持存储资源的工作频率不变。
在本申请中的一些实施例中,处理器910还用于:获取第一处理器的运行参数,运行参数包括运行频率或运行功耗;在第一影响参数大于或等于第一参数阈值的情况下,调高存储资源的工作频率,处理器910具体用于:在第一影响参数大于或等于第一参数阈值、且运行频率大于或等于第一频率的情况下,调高存储资源的工作频率;或在第一影响参数大于或等于第一参数阈值、且运行功耗大于或等于第一功耗的情况下,调高存储资源的工作频率。
在本申请中的一些实施例中,在调高处理器缓存的工作频率的情况下,处理器910还用于:增大处理器缓存中对第一处理器分配的存储空间;或增大处理器缓存中对第一线程分配的存储空间;其中,第一线程是运行在第一处理器的线程。
在本申请中的一些实施例中,处理器910还用于:获取第二影响参数与第二参数阈值的比较结果,第二影响参数是第二处理器的计算性能受到存储资源的影响程度,第二处理器和第一处理器设于同一个芯片;在第一影响参数大于或等于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,调高存储资源的工作频率;在第一影响参数大于或等于第一参数阈值、且第二影响参数小于第二参数阈值的情况下,保持存储资源的工作频率不变;在第一影响参数小于第一参数阈值、且第二影响参数大于或等于第二参数阈值的情况下,保持存储资源的工作频率不变。
在本申请实施例中,获取得到的第一影响参数能够表示第一处理器的计算性能受到存储资源的影响程度,故可以利用第一影响参数来调整存储资源的工作频率,在此过程中,在第一处理器的计算性能受到存储资源的影响程度较大的情况下,通过调整存储资源的工作频率,以便缓解或改善计算性能受到存储资源的影响程度,进而提升第一处理器的能效。
应理解的是,本申请实施例中,输入单元904可以包括图形处理器(Graphics Processing Unit,GPU)9041和麦克风9042,图形处理器9041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元906可包括显示面板9061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板9061。用户输入单元907包括触控面板9071以及其他输入设备9072中的至少一种。触控面板9071,也称为触摸屏。触控面板9071可包括触摸检测装置和触摸控制器两个部分。其他输入设备9072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
存储器909可用于存储软件程序以及各种数据。存储器909可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器909可以包括易失性存储器或非易失性存储器,或者,存储器909可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器909包括但不限于这些和任意其它适合类型的存储器。
处理器910可包括一个或多个处理单元;可选的,处理器910集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器910中。
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述处理器的调度方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,处理器为上述实施例中的电子设备中的处理器。可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。
本申请实施例另提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现上述处理器的调度方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的处理器还可以称为系统级处理器、系统处理器、处理器系统或片上系统处理器等。
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述处理器的调度方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的实施例本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (19)

  1. 一种处理器的调度方法,包括:
    获取第一处理器的第一影响参数,所述第一影响参数用于表示所述第一处理器的计算性能受到存储资源的影响程度;
    基于所述第一影响参数调整所述存储资源的工作频率;
    其中,所述存储资源包括处理器缓存、主存、与所述第一处理器对接的系统缓存中的一种或多种。
  2. 根据权利要求1所述的处理器的调度方法,其中,所述第一影响参数包括第一时长与第二时长的比值;
    其中,第一时长表示所述第一处理器的工作时长,所述第二时长用于表示因第一条件致使所述第一处理器停止运行的停止时长,所述第一条件包括以下之一:
    所述存储资源延时造成的前端阻塞、所述存储资源延时造成的后端阻塞、所述存储资源延时造成的前端阻塞和所述存储资源延时造成的后端阻塞、缓存未命中造成的所述存储资源延时致使的前端阻塞、缓存未命中造成的所述存储资源延时致使的后端阻塞、缓存未命中造成的所述存储资源延时致使的前端阻塞和缓存未命中造成的所述存储资源延时致使的后端阻塞。
  3. 根据权利要求2所述的处理器的调度方法,其中,所述获取第一处理器的第一影响参数,具体包括:
    在所述第一处理器周期性计数溢出或周期性任务执行结束的情况下,获取事件计数器记录的第一计数值和第二计数值,所述第一计数值用于表示所述第一时长,所述第二计数值用于表示所述第二时长。
  4. 根据权利要求1至3中任一项所述的处理器的调度方法,其中,所述基于所述第一影响参数调整所述存储资源的工作频率,具体包括:
    在所述第一影响参数大于或等于第一参数阈值的情况下,调高所述存储资源的工作频率;
    在所述第一影响参数小于第一参数阈值的情况下,保持所述存储资源的工作频率不变。
  5. 根据权利要求4所述的处理器的调度方法,所述调度方法还包括:
    获取所述第一处理器的运行参数,所述运行参数包括运行频率或运行功耗;
    所述在所述第一影响参数大于或等于第一参数阈值的情况下,调高所述存储资源的工作频率,具体包括:
    在所述第一影响参数大于或等于所述第一参数阈值、且所述运行频率大于或等于第一频率的情况下,调高所述存储资源的工作频率;或
    在所述第一影响参数大于或等于所述第一参数阈值、且所述运行功耗大于或等于第一功耗的情况下,调高所述存储资源的工作频率。
  6. 根据权利要求4所述的处理器的调度方法,在调高所述处理器缓存的工作频率的情况下,所述调度方法还包括:
    增大所述处理器缓存中对所述第一处理器分配的存储空间;或
    增大所述处理器缓存中对第一线程分配的存储空间;
    其中,所述第一线程是运行在所述第一处理器的线程。
  7. 根据权利要求4所述的处理器的调度方法,其中,所述在所述第一影响参数大于或等于第一参数阈值的情况下,调高所述存储资源的工作频率,具体包括:
    获取第二影响参数与第二参数阈值的比较结果,所述第二影响参数是第二处理器的计算性能受到存储资源的影响程度,所述第二处理器和所述第一处理器设于同一个芯片;
    在所述第一影响参数大于或等于所述第一参数阈值、且所述第二影响参数大于或等于所述第二参数阈值的情况下,调高所述存储资源的工作频率;
    在所述第一影响参数大于或等于所述第一参数阈值、且所述第二影响参数小于所述第二参数阈值的情况下,保持所述存储资源的工作频率不变;
    在所述第一影响参数小于所述第一参数阈值、且所述第二影响参数大于或等于所述第二参数阈值的情况下,保持所述存储资源的工作频率不变。
  8. 一种处理器的调度装置,包括:
    获取模块,用于获取第一处理器的第一影响参数,所述第一影响参数用于表示所述第一处理器的计算性能受到存储资源的影响程度;
    调整模块,用于基于所述第一影响参数调整所述存储资源的工作频率;
    其中,所述存储资源包括处理器缓存、主存、与所述第一处理器对接的系统缓存中的一种或多种。
  9. 根据权利要求8所述的处理器的调度装置,其中,所述第一影响参数包括第一时长与第二时长的比值;
    其中,第一时长表示所述第一处理器的工作时长,所述第二时长用于表示因第一条件致使所述第一处理器停止运行的停止时长,所述第一条件包括以下之一:
    所述存储资源延时造成的前端阻塞、所述存储资源延时造成的后端阻塞、所述存储资源延时造成的前端阻塞和所述存储资源延时造成的后端阻塞、缓存未命中造成的所述存储资源延时致使的前端阻塞、缓存未命中造成的所述存储资源延时致使的后端阻塞、缓存未命中造成的所述存储资源延时致使的前端阻塞和缓存未命中造成的所述存储资源延时致使的后端阻塞。
  10. 根据权利要求9所述的处理器的调度装置,其中,所述获取模块,具体用于:
    在所述第一处理器周期性计数溢出或周期性任务执行结束的情况下,获取事件计数器记录的第一计数值和第二计数值,所述第一计数值用于表示所述第一时长,所述第二计数值用于表示所述第二时长。
  11. 根据权利要求8至10中任一项所述的处理器的调度装置,其中,所述调整模块,具体用于:
    在所述第一影响参数大于或等于第一参数阈值的情况下,调高所述存储资源的工作频率;
    在所述第一影响参数小于第一参数阈值的情况下,保持所述存储资源的工作频率不变。
  12. 根据权利要求11所述的处理器的调度装置,所述获取模块,还用于:
    获取所述第一处理器的运行参数,所述运行参数包括运行频率或运行功耗;
    所述调整模块,具体用于:
    在所述第一影响参数大于或等于所述第一参数阈值、且所述运行频率大于或等于第一频率的情况下,调高所述存储资源的工作频率;或
    在所述第一影响参数大于或等于所述第一参数阈值、且所述运行功耗大于或等于第一功耗的情况下,调高所述存储资源的工作频率。
  13. 根据权利要求11所述的处理器的调度装置,在调高所述处理器缓存的工作频率的情况下,所述调整模块,还用于:
    增大所述处理器缓存中对所述第一处理器分配的存储空间;或
    增大所述处理器缓存中对第一线程分配的存储空间;
    其中,所述第一线程是运行在所述第一处理器的线程。
  14. 根据权利要求11所述的处理器的调度装置,其中,所述调整模块,具体用于:
    获取第二影响参数与第二参数阈值的比较结果,所述第二影响参数是第二处理器的计算性能受到存储资源的影响程度,所述第二处理器和所述第一处理器设于同一个芯片;
    在所述第一影响参数大于或等于所述第一参数阈值、且所述第二影响参数大于或等于所述第二参数阈值的情况下,调高所述存储资源的工作频率;
    在所述第一影响参数大于或等于所述第一参数阈值、且所述第二影响参数小于所述第二参数阈值的情况下,保持所述存储资源的工作频率不变;
    在所述第一影响参数小于所述第一参数阈值、且所述第二影响参数大于或等于所述第二参数阈值的情况下,保持所述存储资源的工作频率不变。
  15. 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至7中任一项所述的方法的步骤。
  16. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至7中任一项所述的方法的步骤。
  17. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1至7中任一项所述的方法的步骤。
  18. 一种计算机程序产品,所述程序产品被存储在存储介质中,所述程序产品被至少一个处理器执行以实现如权利要求1至7中任一项所述的方法的步骤。
  19. 一种电子设备,所述电子设备被配置成用于执行如权利要求1至7中任一项所述的方法的步骤。
PCT/CN2025/083638 2024-03-25 2025-03-20 处理器的调度方法、装置、电子设备、存储介质和芯片 Pending WO2025201154A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410343144.0 2024-03-25
CN202410343144.0A CN120704850A (zh) 2024-03-25 2024-03-25 处理器的调度方法、装置、电子设备、存储介质和芯片

Publications (1)

Publication Number Publication Date
WO2025201154A1 true WO2025201154A1 (zh) 2025-10-02

Family

ID=97119405

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/083638 Pending WO2025201154A1 (zh) 2024-03-25 2025-03-20 处理器的调度方法、装置、电子设备、存储介质和芯片

Country Status (2)

Country Link
CN (1) CN120704850A (zh)
WO (1) WO2025201154A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180088604A1 (en) * 2016-09-26 2018-03-29 Dell Products L.P. Systems and methods for reporting of excessive vibration conditions in a storage resource
CN111459682A (zh) * 2020-04-09 2020-07-28 Oppo广东移动通信有限公司 频率调整方法、装置、电子设备以及存储介质
CN115080209A (zh) * 2022-06-28 2022-09-20 北京百度网讯科技有限公司 系统资源调度方法、装置、电子设备及存储介质
CN116225632A (zh) * 2021-12-03 2023-06-06 华为技术有限公司 线程调度方法、设备及相关装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180088604A1 (en) * 2016-09-26 2018-03-29 Dell Products L.P. Systems and methods for reporting of excessive vibration conditions in a storage resource
CN111459682A (zh) * 2020-04-09 2020-07-28 Oppo广东移动通信有限公司 频率调整方法、装置、电子设备以及存储介质
CN116225632A (zh) * 2021-12-03 2023-06-06 华为技术有限公司 线程调度方法、设备及相关装置
CN115080209A (zh) * 2022-06-28 2022-09-20 北京百度网讯科技有限公司 系统资源调度方法、装置、电子设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
31 December 2012, MORGAN KAUFMANN, ISBN: 978-0-12-383872-8, article HENNESY JOHN L., PATTERSON, DAVID A.: "Computer Architecture - a quantitative approach ", XP093246779 *

Also Published As

Publication number Publication date
CN120704850A (zh) 2025-09-26

Similar Documents

Publication Publication Date Title
Usui et al. DASH: Deadline-aware high-performance memory scheduler for heterogeneous systems with hardware accelerators
CN102156665B (zh) 一种虚拟化系统竞争资源差异化服务方法
Ausavarungnirun et al. Staged memory scheduling: Achieving high performance and scalability in heterogeneous systems
CN102609312B (zh) 基于公平性考虑的短作业优先内存请求调度方法
WO2020073672A1 (zh) 资源调度方法和终端设备
US8838863B2 (en) Resource controlling with dynamic priority adjustment
CN106681830B (zh) 一种任务缓存空间监测方法和装置
Li et al. Inter-core locality aware memory scheduling
CN109117280B (zh) 电子装置及其限制进程间通信的方法、存储介质
US20240427704A1 (en) Allocation control for cache
Usui et al. Squash: Simple qos-aware high-performance memory scheduler for heterogeneous systems with hardware accelerators
CN108885587A (zh) 具有系统高速缓存和本地资源管理的功率降低存储器子系统
WO2024213010A1 (zh) 云服务器的资源分配方法、调度装置
CN109117279B (zh) 电子装置及其限制进程间通信的方法、存储介质
CN113312323B (zh) 并行文件系统中降低访问延迟的io请求调度方法及系统
CN110795323A (zh) 负载统计方法、装置、存储介质及电子设备
US20250321851A1 (en) Frequency adjustment method and apparatus, processor, chip, and computer device
WO2025201154A1 (zh) 处理器的调度方法、装置、电子设备、存储介质和芯片
CN118259739A (zh) 处理器调度方法、装置、电子设备、存储介质及程序产品
WO2024098795A1 (zh) 内存管理方法、装置和相关设备
CN116737338A (zh) 处理方法、装置、设备和存储介质
CN121116656B (zh) 专家模型预加载方法、装置、芯片、电子设备、存储介质及计算机程序产品
CN119739536B (zh) 缓存分配方法及电子设备
US12204941B2 (en) Preserving quality of service for client applications having workloads for execution by a compute core or a hardware accelerator
CN114780249B (zh) 一种缓存管理方法、系统、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25778435

Country of ref document: EP

Kind code of ref document: A1