WO2024037068A1 - 任务调度方法、电子设备及计算机可读存储介质 - Google Patents
任务调度方法、电子设备及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2024037068A1 WO2024037068A1 PCT/CN2023/093867 CN2023093867W WO2024037068A1 WO 2024037068 A1 WO2024037068 A1 WO 2024037068A1 CN 2023093867 W CN2023093867 W CN 2023093867W WO 2024037068 A1 WO2024037068 A1 WO 2024037068A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- task
- processor
- load
- level
- cpu
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
- G06F9/4893—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues taking into account power or heat criteria
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation 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/505—Allocation 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
- G06F9/5088—Techniques for rebalancing the load in a distributed system involving task migration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5094—Allocation of resources, e.g. of the central processing unit [CPU] where the allocation takes into account power or heat criteria
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the invention relates to the field of computer technology, and in particular to a task scheduling method, electronic equipment and computer-readable storage media.
- processor architectures such as the heterogeneous many-core architecture proposed for multi-core CPUs, which can be accessed through non-uniform memory.
- NUMA Memory Access
- AMP Asymmetric Multi-Processing
- the AMP architecture interconnects processors with different computing power through a bus. Since processors with different computing power levels have different energy efficiency ratios, the operating system (Operation System, OS) needs to perform tasks according to the real-time load characteristics of the task. to match a processor with corresponding computing power, and then schedule the task to the matched processor to continue running.
- OS Operating System
- embodiments of the present application provide a task scheduling method , electronic equipment and computer-readable storage media.
- inventions of the present application provide a task scheduling method applied to electronic devices.
- the method includes:
- the second level processor handles the second task.
- the task scheduling method calculates the required task load characteristic value corresponding to each task executed on the electronic device, and promptly schedules each task to run on an idle CPU with matching computing power level.
- the electronic device can be improved to dynamically schedule each task executed, and a CPU with matching computing power can be allocated to each task in a timely manner to process the corresponding task, which is conducive to improving the operating efficiency of each task.
- scheduling the corresponding tasks to the idle CPU for processing will also help improve the processing efficiency of each task, which is beneficial to To improve the processing performance of electronic equipment.
- the above-mentioned electronic device may be, for example, a server, a mobile phone, a PC, and other electronic devices, and is not limited here.
- the above-mentioned task load characteristic value includes the first load value corresponding to the above-mentioned first task and the second load value corresponding to the above-mentioned second task.
- the above-mentioned first-level processor and second-level processor may be, for example, the following specific implementation methods The macronucleus and micronucleus described in . In other embodiments, the above-mentioned first-level processor and second-level processor may also correspond to other level names, without any limitation.
- the above-mentioned first-level processor that processes the first task may be, for example, the first target CPU in the following specific embodiments.
- the above method further includes: calculating the third load value required to execute the first task, and determining the third load value required to execute the first task, and determining the third load value required to execute the first task. At least one third-level processor corresponding to the third load range to which the three load values belong;
- a third-level processor in an idle state among at least one third-level processor is used to process the first task; wherein the third-level processor and the first-level processor are processors of different levels, and the third-level processor and the first-level processor are processors of different levels.
- the second level processor is a processor of the same or a different level.
- the above task scheduling process may include a process of scheduling tasks during task processing.
- the electronic device may monitor the real-time task load characteristic value of the first task.
- the electronic device monitors that the task load characteristic value of the current first task is the third load value.
- the first task corresponding to the third load value may be more suitable for running on another level of processor, for example, more suitable for running on the third level processor. In this case, the first task can be scheduled to the third level. Processing continues on the processor.
- the above-mentioned third-level processor may be, for example, the second target CPU in the following detailed embodiments.
- the electronic device can monitor this change in time and schedule the running first task to the third-level processor whose computing power level is more matched and is idle to continue processing. In this way, it is helpful to improve the processing efficiency of the first task.
- the third level processor may be a second level processor that is different from the first level processor.
- the third level processor may be different from the second level processor, or may be the same level processor as the second level processor. There is no limitation here. .
- using an idle third-level processor among at least one third-level processor to process the first task includes: The process triggers an interrupt; removes the first task from the first task queue of the first-level processor and adds the first task to the second task queue of the third-level processor; uses the third-level processor to select the first task The first task in the second task queue continues to be processed.
- the process of scheduling the first task from the originally running first-level processor to the third-level processor for continued processing can be initiated through an interrupt mechanism. For example, an interrupt is first triggered when a first-level processor processes a first task, and then the first task is scheduled to a task queue of a third-level processor to wait for processing. It can be understood that the scheduled third-level processor is usually in an idle state, so the first task can continue processing soon after being scheduled to the third-level processor, which is beneficial to reducing the delay of the task scheduling process and allowing users to It is imperceptible and helps improve user experience.
- the process of scheduling the first task from the originally running first-level processor to the third-level processor for continued processing can also be done through a non-interrupt driven scenario.
- the task characteristic calculation module can sample the PMU related count value to calculate the task load characteristic value, and when it is determined that the first task needs to be scheduled, task scheduling is initiated.
- the task scheduling process in the above non-interrupt-driven scenario is a software implementation process, and there is no need to initiate an interrupt.
- the electronic device includes a first performance threshold and a second performance threshold preset corresponding to the first level processor, wherein the first performance threshold is greater than the second performance threshold, and, for The process of processing the first task by the first-level processor triggers an interrupt, including: detecting that the calculated third load value is greater than the first performance threshold or less than the second performance threshold, and interrupting the process of the first-level processor processing the first task. trigger an interrupt.
- the above-mentioned first performance threshold may, for example, be the upper threshold set correspondingly in MSR_PMU_MODEL_THRESHOLD_H defined for the MSR register of the CPU in Table 1 in the detailed implementation below.
- the above-mentioned second performance threshold may, for example, be the corresponding lower threshold set in MSR_PMU_MODEL_THRESHOLD_L defined for the MSR register of the CPU in Table 1 in the detailed implementation below. There are no restrictions here.
- the electronic device includes a correspondence relationship between a task characteristic identifier and a processor level identifier, and the processor level identifier includes at least a first-level processor and a second-level processor, and, Determining at least one first-level processor corresponding to the first load range to which the first load value belongs includes: converting the calculated first load value into the first first-level processor corresponding to the task characteristic identifier based on a preset identifier conversion rule. identification value;
- the first identification value belongs to the identification value range corresponding to the first task characteristic identifier, and determine at least one first-level processor based on the first correspondence between the first task characteristic identifier and the first-level processor.
- the task load characteristic value corresponding to the first task monitored by the electronic device in real time can be converted into the corresponding task characteristic identification value.
- the identification value can be, for example, a proportional conversion of the corresponding task load characteristic value. value.
- the correspondence between the identification value ranges corresponding to different task characteristic identifiers and processors with different computing power levels can be preset on the electronic device, or the identification value ranges corresponding to different task characteristic identifiers can also correspond to processing at different computing power levels.
- the computing power characteristic value range corresponding to the device In this way, it can be determined based on the real-time monitored task load characteristic value whether the computing power level corresponding to the processor currently running the first task matches.
- the electronic device includes a second corresponding relationship between the first load range and the identification value range corresponding to the first task characteristic identification, and determines the first load value to which the first load value belongs.
- At least one first-level processor corresponding to a load range includes: determining the first load range to which the first load value belongs, and determining the first task characteristic identifier corresponding to the first load value based on the second correspondence relationship; Based on the first corresponding relationship, at least one first-level processor is determined.
- the correspondence relationship between the range of task load characteristic values and the range of identification values corresponding to the corresponding task characteristic identifiers may also be preset on the electronic device. In this way, after determining the range of task load characteristic values to which the monitored task load characteristic value belongs, for example, after determining that the above-mentioned first load value belongs to the first load range, the first task characteristic identifier corresponding to the first load range can be used to correspond to The identification value range determines at least one first-level processor whose computing power level matches.
- the electronic device includes multiple processors, and the electronic device adds a processor level identification to each processor based on the computing power characteristic value of each processor, where each processor The computing power characteristic value is related to the frequency and micro-architecture computing power of each processor.
- the frequency of the processor includes the main frequency or operating frequency of the processor.
- the first load value is related to the instruction type related to the first-level processor acquiring and executing the first task, and the statistical results of the execution of the instruction;
- the second load value is related to the second load value.
- the level processor obtains and executes the instruction type related to the first task and the statistical results of the execution of the instruction.
- embodiments of the present application provide an electronic device, including: one or more processors; one or more memories; one or more memories store one or more programs. When one or more programs are When one or more processors are executed, the electronic device is caused to execute the task scheduling method provided in the first aspect.
- the above-mentioned electronic devices can be servers, mobile phones, PCs and other electronic devices, and are not limited here.
- embodiments of the present application provide a computer-readable storage medium. Instructions are stored on the storage medium, and the instructions are stored in the computer. When executed, the computer is caused to execute the task scheduling method provided by the first aspect.
- embodiments of the present application provide a computer program product, which includes a computer program/instruction.
- the computer program/instruction is executed by a processor, the task scheduling method provided in the first aspect is implemented.
- the task scheduling solution provided by the embodiments of the present application can effectively improve the efficiency of computing resource allocation to each CPU on the electronic device, and schedule the tasks to be run or currently running in a timely manner to the CPU with suitable computing power for efficient operation.
- Task scheduling can be performed without waiting for the system scheduling cycle, which is also beneficial to the scheduling and operating efficiency of each task.
- the solution of this application can not only determine the computing power and the corresponding computing power level for CPUs with the same microarchitecture, but also determine the computing power and the corresponding computing power level for CPUs with different microarchitectures, so the target task can be scheduled to Running on CPUs of the same or different micro-architectures with matching computing power levels means greater scene adaptability.
- Figure 1 shows a schematic diagram of an application scenario provided by an embodiment of the present application.
- Figure 2a shows a schematic diagram of the implementation process of a task scheduling solution.
- Figure 2b shows a schematic diagram of the implementation process of another task scheduling scheme.
- Figure 3 shows a schematic diagram of a server system architecture provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of the interaction flow between partial structures of the system shown in FIG. 3 during the implementation of a task scheduling method provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of the working principle of a load characteristic monitor for monitoring task load characteristic values provided by an embodiment of the present application.
- FIG. 6 is a schematic flowchart of an implementation process for triggering an interrupt by a load characteristic monitor provided by an embodiment of the present application.
- Figure 7 shows a schematic workflow diagram of a task characteristic calculation module initiating task scheduling in response to an interrupt provided by an embodiment of the present application.
- FIG. 8 shows a schematic workflow diagram of a large and small core scheduler performing task scheduling provided by an embodiment of the present application.
- Figure 9 shows an implementation flow chart for setting a load characteristic monitor after task scheduling provided by an embodiment of the present application.
- Figure 10 shows an implementation flow chart of another task scheduling method provided by an embodiment of the present application.
- FIG. 11 is a schematic diagram of the internal implementation process of a task scheduling method provided by an embodiment of the present application.
- Figure 12 shows a schematic diagram of the hardware structure of a server provided by an embodiment of the present application.
- FIG. 13 is a schematic diagram of the hardware structure of a mobile phone provided by an embodiment of the present application.
- Figure 14 shows a schematic system architecture diagram of a mobile phone provided by an embodiment of the present application.
- Large cores and small cores refer to multiple CPUs with different configurations in electronic devices.
- the system can evaluate the computing power based on the computing power and computing efficiency of each CPU, and divide the computing power in the electronic device based on the computing power.
- CPUs are divided into computing power levels such as large cores and small cores.
- CPUs with small computing power levels can handle tasks such as reading and outputting very large data from disk or memory, so this type of CPU is often called IO-intensive in the industry.
- Interrupt means that when certain unexpected situations occur during computer operation and require host intervention, the machine can automatically Stop the running program and switch to the program that handles the new situation. After the processing is completed, return to the original suspended program to continue running.
- Task load refers to the amount of computing resources consumed when running a task, as well as the size of storage resources consumed, etc. It can be understood that the more computing power resources are consumed when running a task, that is, the greater the task load, the greater the number of CPUs that need to be used when the computing power of each CPU is equal.
- Figure 1 shows a schematic diagram of an application scenario according to an embodiment of the present application.
- this scenario includes server 100.
- the multiple CPUs in the server 100 can be divided into computing power levels such as large cores and small cores according to the size of the computing power.
- some CPUs have a relatively intermediate computing power ranking and can also be divided into ordinary cores. There are no restrictions here.
- the target task that the server 100 needs to perform requires a large amount of computing power, for example, when the server 100 needs to run a data processing task or a computing task for a large-scale online game, a large core needs to be scheduled for execution.
- the target task that the server 100 needs to perform requires relatively small computing power, for example, when the server 100 needs to run a game scene loading task for a certain game application, or needs to run a calendar data update task for a calendar application, it does not have to be queued in the large core. In the processing task queue, small cores can be scheduled for execution, which is faster and more efficient.
- the server 100 responds to tasks with different computing power requirements and schedules processors with matching computing power to execute them, which is beneficial to avoiding the occupation of some tasks that require less computing resources.
- Task queue position for large core class processors Just imagine, if some tasks can be run on the small core, but the task cannot be scheduled to the corresponding small core for processing in time, the running rate of the task and other tasks in the task queue where the task is located will be reduced, that is, it may be As a result, some tasks that require more computing resources will have a longer queuing time, and it will also reduce the throughput rate of the entire system.
- effective task scheduling requires first effectively and timely detecting the load characteristics corresponding to each task to be processed, and then matching the CPU with appropriate computing power to perform corresponding task processing based on the load characteristics corresponding to each task.
- system or “operating system” refers to electronic devices such as servers that implement the data update method provided by the embodiments of the present application.
- the operating systems installed such as Linux, openEuler OS, Windows TM system, Mac TM system, Harmony OS, Android TM system or iOS TM system, etc., are not limited here.
- Figures 2a to 2b respectively illustrate a task scheduling scheme.
- a firmware on the electronic device of this scheme reads the CPU hardware information of different micro-architecture types and ranks the performance of the CPUs in each type.
- the CPU performance order in type 0 is CPU00, CPU01, and CPU02
- the CPU performance order in type 1 is CPU10, CPU11, and CPU12.
- the microarchitecture of the CPU of type 0 is different from that of the CPU of type 1. Then, let the task threads to be scheduled run on large-core CPUs and small-core CPUs in different micro-architecture types, and measure the performance data on each thread, such as the number of instructions executed by each CPU in a unit clock cycle (Instruction Per Clock, IPC).
- IPC Instruction Per Clock
- the corresponding IPC ratio of the task running on the large and small core CPUs in each micro-architecture type can be calculated and recorded.
- the OS scheduler reads the measured IPC ratio and other data, and schedules the task to run on a CPU of a type corresponding to a larger IPC ratio, for example, selecting a CPU with a higher performance ranking from this type. High CPU to run the task.
- this task scheduling solution needs to test the IPC value of the task to be scheduled when running on different types of CPUs, it needs to adapt to the operating system's fixed scheduling period for tasks or CPUs, resulting in longer scheduling periods for some tasks.
- this task scheduling solution can only be scheduled between CPUs of different micro-architecture types, and cannot be applied to task scheduling between large and small cores of the same micro-architecture, and its scope of application is also narrow.
- this scheme adds a task computing power requirement calculation module in the OS kernel, which is responsible for evaluating and grouping the computing power of the threads executing the task, so that different types of applications can be processed separately.
- the task computing power requirement calculation module uses the CPU utilization, scheduling delay and other information of each thread collected in real time by the OS task scheduler, and integrates the IO rate information to calculate the computing power of each thread according to the target time point configured by the system's application framework.
- the computing power requirements of the task and regroup the threads.
- the task scheduler can schedule the tasks that need to be scheduled based on the regrouping results to run on the target CPU with matching computing power corresponding to the new thread group.
- this task scheduling scheme also needs to adapt to the operating system's task scheduling cycle. At the same time, this task scheduling solution is not suitable for open computing scenarios supported by server operating systems and so on.
- this application provides a task scheduling method, which is applied to electronic devices with multiple processors. Specifically, this method determines the computing power of each CPU based on the configured hardware configuration information of multiple CPUs when the system of the electronic device is started and runs, and divides each CPU into different computing power levels according to the computing power. Among them, different computing power levels can correspond to tasks with different processing task loads. For example, a CPU with a higher computing power level can provide a larger range of computing power and more computing power resources, and can handle tasks with larger task loads. ; while a CPU with a lower computing power level can provide fewer computing power resources and can handle tasks with a smaller task load.
- this method can match the idler among the corresponding computing power levels according to the range of the task load size of each task before running the task or during the process of running the task. CPU, and schedule the task to run on the matching CPU.
- the above task load range corresponding to each computing power level can be determined by determining the current task load characteristic value for the target task that is about to be run or is running, and then add an identifier to the task according to the size of the task load characteristic value to mark the task.
- the identifier belongs to the task load range, which can be called the task characteristic identifier.
- the above-mentioned task load characteristic value can be dynamically determined based on the instruction type corresponding to each task and the execution status of the CPU running the instruction corresponding to the task, such as whether the corresponding instruction is successfully executed and the type of execution error.
- the target task may also have an initial task load characteristic value before running, and the initial value may be determined based on the task content and the execution parameters preset by the system for the task.
- the execution parameters may be, for example, the system designates to schedule some tasks to run on a CPU with a certain computing power level, or designates a certain task to run on a certain CPU, corresponding to the preset parameters, etc.
- the computing power of each CPU mentioned above can be determined based on the configuration information of each CPU, and the computing power range covered by the corresponding computing power level can also be reasonably determined based on the computing power distribution of all CPUs.
- the computing power of each CPU can be comprehensively measured based on the core frequency, microarchitecture and other aspects of each CPU. For example, it can be measured by the calculated characteristic value of the computing power.
- a rule for calculating the characteristic value of computing power can be preset in the system, and then CPUs with characteristic values of computing power in a higher range are identified as large cores, and CPUs with characteristic values of computing power in a smaller range are classified as large cores. Identified as a small core type.
- multiple CPUs in the electronic device can also be divided into three categories according to the calculated computing power characteristic values, namely, large cores, small cores, and computing power characteristic values between higher and lower ranges.
- the ordinary core is no longer limited here.
- the solution of this application can effectively improve the efficiency of computing resource allocation to each CPU on the electronic device, and timely schedule the tasks to be run or are currently running to the CPU with adapted computing power to run efficiently without waiting for the system scheduling cycle.
- Perform task scheduling which is also beneficial to the scheduling and operating efficiency of each task.
- the solution of this application can not only determine the computing power and the corresponding computing power level for CPUs with the same microarchitecture, but also determine the computing power and the corresponding computing power level for CPUs with different microarchitectures, so the target task can be scheduled to Running on CPUs of the same or different micro-architectures with matching computing power levels means greater scene adaptability.
- the task load characteristic value of the above target task during operation can be monitored through a preset load characteristic monitor.
- the above-mentioned load characteristic monitor may be, for example, a logic calculation circuit provided on each CPU working circuit.
- the load characteristic monitor can obtain the count values of multiple performance counters of the Performance Unit (PMU) in the CPU microarchitecture and the corresponding register parameters, and use the preset load characteristic calculation model to calculate the tasks running on each CPU. real-time task load characteristic values.
- PMU Performance Unit
- the system can call the preset load characteristic monitor corresponding to the CPU to obtain the parameter values in the corresponding registers on the CPU, and calculate the task load characteristic value of the target task in real time. Furthermore, the system can mark the task characteristic identifier in the current running state of the target task according to the task load characteristic value calculated by the load characteristic monitor to determine the relationship between the target task and the current running state of the target task. Whether the computing power level of the CPU of the task matches.
- the system can determine the computing power level that matches the changed task characteristic identifier, and then dynamically Schedule the target task to a relatively idle CPU in the corresponding computing power level to continue running.
- the above-mentioned preset load characteristic calculation models may include multiple and may be preset in the model library. It can be understood that the model library corresponding to the load characteristic monitor applicable to large cores and the model library corresponding to the load characteristic monitor applicable to small cores may be the same or different. Usually when performing logical calculations related to load characteristics, the load characteristic calculation models selected by the large-core load characteristic monitor and the small-core load characteristic monitor are different, and there is no restriction here.
- each CPU can be configured with a PMU, and the PMU can include multiple PMCs for counting the proportion of instructions that the CPU acquires, executes, or executes abnormally. .
- PMCs for counting the proportion of instructions that the CPU acquires, executes, or executes abnormally.
- the electronic devices applicable to the task scheduling method provided by this application may include but are not limited to the above-mentioned server 100, personal computer (PC) (including laptop computer, desktop computer, tablet computer, etc.), mobile phone, Wearable devices, head-mounted displays, mobile email devices, in-vehicle devices, portable game consoles, portable music players, reader devices, televisions with multiple processors embedded or coupled therein, or with multiple processors and other electronic equipment.
- the task scheduling method provided in this application can also be applied to electronic devices such as servers that have various heterogeneous processors to provide computing platforms, and are used to implement image processing units (image processing units) on the electronic devices such as servers.
- Image Processing Unit IPU
- DPU Deep Learning Processing Unit
- NPU Neural Network Processing Unit
- tasks suitable for running on a large core may be, for example, processing, calculation and analysis tasks of cloud big data
- tasks suitable for running on a small core may be, for example Page request task for cloud big data.
- the electronic device that performs the above task scheduling method is a PC
- the tasks suitable for running on the large core can be, for example, data calculation tasks based on various preset calculation formulas in the Excel application, etc.
- the tasks suitable for running on the small core For example, it can be tasks such as data import and storage of Excel applications.
- the tasks suitable for running on the large core may be, for example, the data processing tasks of certain large-scale online game applications; the tasks suitable for running on the small core may be, for example, a calendar application. Calendar data update task.
- Figure 3 shows a schematic system architecture diagram of a server 100 according to an embodiment of the present application.
- Server operating systems include Unix, Linux, Windows Server and Netware, etc.
- the embodiment of this application takes a Linux-based big data server as an example to exemplarily introduce the operating system architecture of the server 100 .
- the operating system of a Linux-based big data server can include the following three parts, namely the kernel layer, the system service and application framework layer, and the application service layer.
- the kernel layer is responsible for connecting all applications running in "user mode” to the physical hardware and allowing processes in the server to obtain information from each other using inter-process communication (IPC).
- the kernel layer is the core of the operating system and has many basic functions, such as managing the system's processes, memory, device drivers, files and network systems, and determining the performance and stability of the system.
- the kernel layer includes a task characteristic calculation module, a large and small core scheduler, a load characteristic monitor, and a monitor calling interface.
- the task characteristic calculation module is used to receive the CPU device identification sent by the large and small core scheduler, and select the CPU device Identifies the corresponding load signature monitor. It can be understood that in some embodiments, multiple CPUs of the same level can also be equipped with a load characteristic monitor, and the load characteristic monitor can establish a corresponding monitoring unit corresponding to the device identification of each CPU, etc., which is not limited here.
- the task characteristic calculation module can call the selected load characteristic monitor through the monitor call interface to monitor the load characteristics corresponding to the currently executed task. It can be understood that when the task characteristic calculation module calls the load characteristic monitor through the monitor call interface, it can also configure the load to the load characteristic monitor according to the task characteristics that currently need to be monitored and the scheduling policy set by the application scheduling policy service for the task. The selection parameters of the feature calculation model and the model parameters corresponding to the selected model.
- the task characteristic calculation module can also read the task load characteristic value monitored by the load characteristic monitor based on the interrupt notification sent by the load characteristic monitor, and generate a task based on the task load characteristic value and the system's configuration of the task. Feature ID. Furthermore, the task characteristic calculation module can determine that the task needs to be scheduled based on the generated task characteristic identifier, and then send a task scheduling notification to the large and small core scheduler. In other embodiments, the task characteristic calculation module can also send the generated task characteristic identifier to the large and small core schedulers, so that the large and small core schedulers can determine whether the task needs to be scheduled, which is not limited here. The specific process of generating task characteristic identifiers and scheduling tasks by the task characteristic calculation module will be described in detail below and will not be described in detail here.
- the large and small core scheduler is used to receive task scheduling notifications from the task characteristics calculation module, further confirm whether the currently executed task matches the CPU computing power executing the task, and then determine whether the task needs to be scheduled/scheduled to a location with more computing power. Execution continues on matching and idle CPUs. Therefore, the large and small core scheduler can determine whether the computing power of the CPU currently executing the task matches the task based on whether the task characteristic identifier corresponds to the level identifier marked on the CPU currently executing the task, and then determine whether the task needs to be scheduled.
- the large and small core scheduler can select an idle target CPU with matching computing power based on the correspondence between the task characteristic identifier and the CPU level identifier, so as to schedule the task to the target CPU to continue running. It can be understood that if the CPUs selected by the large and small core scheduler based on the task characteristic identifier are all running other tasks, the large and small core scheduler may not schedule the task at this time, that is, no task scheduling is performed. In other embodiments, the target CPU selected by the large and small core scheduler according to the task characteristic identifier can also suspend other tasks to prioritize the currently scheduled tasks, which is not limited here. The details will be described in detail below and will not be repeated here.
- the load characteristic monitor is used to calculate and monitor the real-time load characteristic value corresponding to the task currently processed by the corresponding CPU.
- the load characteristic monitor can be, for example, a logical calculation circuit set on each CPU working circuit. It can be set in the micro-architecture of the corresponding CPU device, the internal functional module of the CPU, or the external dedicated chip and some firmware.
- the task load characteristic value monitored by the load characteristic monitor can be sent to the task characteristic calculation module through the monitor call interface to determine whether the task characteristic identifier of the corresponding task matches the currently running CPU level identifier, and then decide whether to proceed with the task. Scheduling. The details will be described in detail below and will not be repeated here.
- CPU driver in the kernel layer can be used to drive corresponding CPU devices.
- One CPU driver can be used to drive multiple CPU devices, or one CPU driver can drive one CPU device.
- CPU driver 1 is used to drive CPU1
- CPU driver 2 is used to drive CPU2
- CPU driver 3 is used to drive CPU3, ...
- CPU driver n is used to drive CPUn.
- the above load characteristic monitors may respectively correspond to monitoring the load characteristics of tasks running on CPU1, CPU2, CPU3,...CPUn. The details will be described in detail below and will not be repeated here.
- the monitor calling interface is used to configure or call the load characteristic monitor on each CPU working circuit. It can be understood that the calling interface can include a variety of functional interfaces derived based on MSR registers. For example, corresponding register names and parameters can be defined for each MSR register in the CPU that is monitored by the load characteristic monitor to implement different functions.
- various functions of the calling interface can also be implemented based on system registers, which are not limited here.
- the system service and application framework layer can include MySQL database, big data processing engine, mathematics library (math library) and other parts.
- MySQL database is a relational database management system that stores data in different tables instead of placing all data in a large warehouse, which increases speed and flexibility.
- the big data processing engine is used to provide data cleaning, data loading, query and other services for large amounts of data input into the system.
- big data processing engines can include, for example, Phoenix, Stinger, Presto and other query engines, Apache Shark, Apache Flink and other distributed scene processing engines, Pig loading engines and analysis engines, etc.
- Apache Spark is a distributed open source processing system for big data workloads. It can provide a unified engine suitable for common data processing scenarios, such as batch processing, stream processing, interactive query, machine learning and other data processing scenarios.
- the mathematics library contains a large number of high-performance computing functions, providing a functional basis for big data processing and calculations. For example, you can implement machine learning and build AI algorithms with specific functions through the high-performance computing functions provided by the mathematics library.
- the application service layer can include some predefined tools or services.
- the application service layer may include web crawlers, search engines, data analysis services, application scheduling policy services, etc.
- web crawlers are used to read data on the network and store it in a MYSQL database.
- Search engines can collect information from the Internet according to certain strategies and using specific procedures. After organizing and processing the information, they can provide retrieval services to users, and can display the retrieved relevant information to users. For example, search engines can implement crawler data download and retrieval functions.
- the data analysis service is used to call data in the mathematics library for data analysis and statistical calculations, which generally requires a large amount of calculations. At some point, the data analysis service will also call relevant data in the Apache Spark computing engine for data analysis and statistical calculations.
- the operating system applied to the big data server shown in Figure 3 above can provide services in various aspects such as data processing, data calculation, and data analysis. Therefore, the operating system can run various types of data according to user needs.
- the applications that are run can also implement various functions according to user needs. Therefore, the operating system shown in Figure 3 that is applied to big data servers, etc., can also be called an open computing operating system.
- the application scheduling policy service is used to preset scheduling conditions for tasks of each application program running on the system according to system operation needs. For example, in order to ensure the rapid response of some system applications, the system can use the application scheduling policy service to limit each task of the system application to only run on the nucleolus.
- the task characteristic calculation module can comprehensively apply the above task scheduling strategies preset by the scheduling strategy service, and no longer schedule the corresponding tasks to run on the large core.
- the Linux operating system can divide itself into two parts during the process of running applications.
- One part is the core software, that is, the kernel, also called the kernel space, and the other part is the ordinary application program. This part called user space.
- the purpose of distinguishing user space and kernel space is to ensure system security.
- each process has its own kernel stack.
- a process When a process is executing the user's own code, it is said to be in the user running state (user state). That is, the processor is running in user code with the lowest privilege level (RING3 level).
- RING3 level When a user program is being executed and is suddenly interrupted by an interrupt program, the user program can also be symbolically said to be in the kernel state of the process. Because the interrupt handler will use the current process's kernel stack.
- the processor is always in one of the following states: 1 Kernel state, running in the process context, where the kernel represents the process running in the kernel space; 2 Kernel state, running in the interrupt Context; 3User mode, running in user space.
- system call That is, user space applications can enter the kernel space through system calls.
- the user space process needs to pass many variables and parameter values to the kernel.
- the kernel When the kernel is running, it also needs to save some register values, variables, etc. of the user process. Therefore, the above-mentioned "process context" refers to the parameters passed by the user process to the kernel, the variables and register values saved when the kernel is running, and the environment at runtime, etc.
- interruption That is, the hardware can trigger the signal to cause the kernel to call the interrupt handler and enter the kernel space.
- the network card sends a data packet or the hard drive provides an IO request.
- interrupt context is the parameters passed by the hardware and the process environment of the currently interrupted execution that the kernel needs to save.
- FIG. 4 shows a schematic diagram of the interaction flow between partial structures of the system shown in FIG. 3 during the implementation of a task scheduling method according to an embodiment of the present application.
- the process specifically includes the following steps:
- the large and small core scheduler 300 obtains the hardware configuration information of each CPU, calculates and determines the computing power level corresponding to each CPU, and adds a level identifier.
- the large and small core scheduler 300 can obtain the hardware configuration information of each CPU from the Basic Input Output System (BIOS), and then calculate each CPU based on preset calculation rules.
- BIOS Basic Input Output System
- This calculation rule can refer to the following calculation relationship, for example:
- CPU computing power characteristic value frequency * microarchitecture computing power.
- the frequency for calculating the CPU computing power characteristic value can be the core frequency of the CPU, that is, the main frequency; it can also be the working frequency of the CPU.
- the CPU computing power characteristic value calculated above can also be understood as calculating the energy efficiency of the CPU to a certain extent, and is not limited here. It can be understood that the calculated size of the computing power characteristic value corresponding to each CPU determined by the large and small core scheduler 300 can be used to determine the computing power level of the corresponding CPU, and then add a level identification to each CPU.
- the system can preset two computing power levels and two corresponding level identifiers. For example, CPUs with computing power characteristic values in the range [512, 1024] belong to the same computing power level. Large cores can be added to this type of CPU. Level identification. CPUs whose computing power characteristic values are in the range of [0, 512) belong to the same computing power level, and small core level identification can be added to this type of CPU.
- the system can also preset three types of computing power levels and corresponding three types of level identifiers. For example, CPUs with computing power characteristic values in the range of (512, 1024] should add large core level identifiers and computing power characteristics. CPUs with a value in the range of [0, 512) can add a small core level identifier, while CPUs with a computing power characteristic value of 512 can add a normal core level identifier. There is no restriction here.
- a CPU belonging to the large core level can be marked as "1”
- a CPU belonging to the small core level can be marked as "-1”
- a CPU belonging to the ordinary core level can be marked as "0”, etc., which are not discussed here. Make restrictions.
- the large and small core scheduler 300 sends the computing power classification result of the CPU to the task characteristic calculation module 200.
- the computing power level classification result at least includes: the identification information (ID) of each CPU, the level identification added to each CPU, and the computing power characteristic value range of the corresponding mark of each level identification.
- the large and small core scheduler 300 can send the identification information of each CPU and the level identifier added to each CPU to the task characteristic calculation module 200 .
- the task characteristic calculation module 200 can identify each CPU based on the identification information of the CPU, and can continue to perform the following step 403 to determine the correspondence between the task characteristic identifier to be processed and the received CPU level identifier.
- the task characteristic calculation module 200 sets the corresponding relationship between the task characteristic identifier and the CPU level identifier and the rules for generating the task characteristic identifier according to the received computing power level classification result.
- the corresponding relationship can be synchronized to the large and small core scheduler 300 for scheduling the initial target task.
- the task characteristic calculation module 200 may set the corresponding task characteristic identifier to correspond to the CPU level identifier based on the received computing power characteristic value range of the corresponding mark of each CPU level identifier.
- the task characteristic identifier is used to mark the task load characteristic value range that matches the computing power characteristic value range of the corresponding computing power level CPU. For example, in the above step 401, it is determined that the computing power characteristic value range corresponding to the large core level identifier is (512, 1024], then the task characteristic calculation module 200 can preset the task characteristic identifier corresponding to the large core level identifier, for example, A type tasks, and set the range of task load characteristic values corresponding to the type A tasks to be (512, 1024].
- the task characteristic calculation module 200 can preset the type B tasks corresponding to the above-mentioned small core level identification, And the range of the task load characteristic value corresponding to the Class B task is preset to be [0, 512); and the Class C task corresponding to the above-mentioned ordinary core level identifier is preset, and the task load characteristics corresponding to the Class C task are preset.
- the value is 512.
- the task characteristic identifier and the corresponding task load characteristic value range preset by the task characteristic calculation module 200 may also be other interval values that are different from the computing power characteristic range marked by the corresponding CPU level identifier.
- the task characteristic calculation module 200 can correspond to a preset task load characteristic value range of (50, 100] for the above-mentioned type A tasks, and can correspond to a preset task load characteristic value range of [0, 50) for type B tasks. Class tasks can correspond to a preset task load characteristic value of 50, and there is no limit here.
- the task characteristic calculation module 200 can also set rules for generating task characteristic identifiers.
- This rule can be based on the range to which the task load characteristic value belongs to generate the corresponding task characteristic identifier; it can also be based on the task load characteristic value and the task scheduling policy provided by the system's application scheduling policy service to generate the corresponding task characteristic identifier.
- the scheduling policy based on the task load characteristic value and the task provided by the system's application scheduling policy service
- the scheduling policy generates the corresponding task characteristic identifier.
- the corresponding task characteristic identifier can be generated by giving priority to the correspondence between the tasks defined by the task scheduling policy and the corresponding computing power level CPU.
- tasks determined to be large-core tasks can be marked as "1”
- tasks determined to be small-core tasks can be marked as "-1”, etc. There are no restrictions here.
- the task characteristics are identified as large-core tasks corresponding to large cores in the CPU computing power level, and the task characteristics are identified as small-core tasks corresponding to small cores in the CPU computing power level.
- the task load characteristic value and the generated task characteristic identifier are recorded in the task structure.
- the task structure includes: task load characteristic value, task characteristic identifier and other relevant parameters of the task, which are not limited here.
- the large and small core scheduler 300 obtains the target task and the initial task load characteristic value of the task.
- the scheduled target task can be a task executed on a process corresponding to a certain software or application program, or a task executed separately on multiple threads corresponding to the corresponding software or application program.
- the large and small core scheduler 300 may determine the task load characteristic value corresponding to the task based on the initial task parameters or related task information of the task.
- the above-mentioned initial task load characteristic value can be an initial load characteristic value, or it can be a load characteristic value set by the application scheduling policy service for the corresponding task according to the system operation needs.
- the application scheduling policy service can also be Add a task scheduling mark to the target task to schedule the task instead of the above-mentioned initial task load characteristic value. There is no restriction here.
- the above-mentioned application task scheduling tag may be, for example, a tag that assigns a certain task to a certain type of CPU or a certain CPU to run.
- the task characteristic calculation module 200 can determine which type or CPU the task is designated to execute based on the scheduling flag, instead of based on the load of the task. Characteristic values are dynamically scheduled.
- the load characteristic monitor 400 may no longer monitor changes in the load characteristic value of the task, and the large and small core scheduler 300 may allocate the task to a specified CPU for execution when the task is initially assigned, and no longer perform the task. Tasks are dynamically scheduled.
- the task scheduling policy set by the application scheduling policy service is to execute a certain task and run it on a large core.
- the large and small core scheduler 300 or the task characteristic calculation module 200 determines that the task is actually more suitable to run on the small core based on the load characteristic value at the initial moment of the task or during operation.
- the task scheduling set by the application scheduling policy service Based on the policy priority principle, the task will continue to run on the big core and will not be scheduled on the small core.
- the large and small core scheduler 300 sends the task load characteristic value of the target task to the task characteristic calculation module 200.
- the large and small core scheduler 300 may send a task structure corresponding to the target task to the task characteristic calculation module 200, and the task structure may include a task load characteristic value corresponding to the target task.
- the task characteristic calculation module 200 can determine the corresponding task characteristic identifier based on the task load characteristic value.
- the task structure can also be edited by the task characteristic calculation module 200.
- the task characteristic calculation module 200 can write the task characteristic identifier determined based on the task load characteristic value into the task structure, etc. The details will be described in detail below and will not be repeated here.
- the large and small core scheduler 300 may also send the obtained task load characteristic value corresponding to the target task to the task characteristic calculation module 200 through function calls, etc., which is not limited here. The specific process of determining the task characteristic identification will be introduced in detail in the corresponding steps below, and will not be described in detail here.
- task load characteristic value may be the initial load characteristic value of the target task, or it may be the task load characteristic value set for the target task by the system's application scheduling policy service, which is not limited here.
- the task characteristic calculation module 200 obtains the task load characteristic value of the target task based on the task structure sent by the large and small core scheduler 300, which is not limited here.
- the task characteristic calculation module 200 receives the task load characteristic value sent by the large and small core scheduler 300, and generates task characteristics based on The identified rules generate task feature identification corresponding to the target task.
- the task characteristic calculation module 200 can generate a corresponding task characteristic identifier for the received task load characteristic value based on the rule for generating the task characteristic identifier set in step 403. It can be understood that if the rule for generating a task characteristic identifier presupposes that the task scheduling policy provided by the application scheduling policy service takes precedence, then when generating the task characteristic identifier, the task characteristic calculation module 200 also needs to comprehensively apply the scheduling policy service to set the target task. task scheduling strategy. For the specific process of generating the task feature identifier, please refer to the relevant description in step 403 above, and will not be described again here.
- the task characteristic calculation module 200 can add a Class B task characteristic identifier to the task. If the application scheduling policy service of the system sets that the target task needs to be executed by a large core, the task characteristic calculation module 200 can add a class A task characteristic identifier to the task. In this way, the task characteristic calculation module 200 can generate a task characteristic identifier with the tag according to the task scheduling tag and return it to the large and small core scheduler 300 .
- the generated task feature identifier is recorded in the task structure of the task, which is not limited here.
- the large and small core scheduler 300 when the large and small core scheduler 300 recognizes the task scheduling mark on the target task, it can also directly schedule the target task to be executed on the CPU without determining the corresponding task characteristic calculation module 200.
- the task characteristic identifier is not limited here.
- the task characteristic calculation module 200 sends the generated task characteristic identifier to the large and small core scheduler 300.
- the task characteristic calculation module 200 can add the generated task characteristic identifier to the corresponding task structure, and send the task structure to the large and small core scheduler 300 .
- the large and small core scheduler 300 can read the task feature identifier corresponding to the target task from the received task structure and perform task scheduling.
- the task characteristic calculation module 200 may also pass the generated task characteristic identifier to the large and small core scheduler 300 through function calls, etc., which is not limited here.
- the large and small core scheduler 300 selects the first target CPU corresponding to the computing power level according to the received task characteristic identifier.
- the large and small core scheduler 300 can match the task characteristic identifier according to the corresponding relationship synchronized after the task characteristic calculation module 200 performs the above step 403.
- the CPU level identifier corresponds to a type of CPU marked, that is, a type of CPU with matching computing power.
- the large and small core scheduler 300 can select an idle CPU from the matched CPUs of this type as the first target CPU for task scheduling.
- the idle CPU may be, for example, a task queue that is idle, or a CPU that is not currently executing a task, which is not limited here.
- the large and small core scheduler 300 can match each CPU marked by the large core level identification based on the correspondence between the type A task and the large core level identification. . Furthermore, the large and small core scheduler 300 can select the currently idle first target CPU among the CPUs under the matched large core computing power level.
- the large and small core scheduler 300 schedules the target task into the running queue of the first target CPU and waits for execution.
- the large and small core scheduler 300 schedules the target task into the running queue of the first target CPU and waits for execution.
- the large and small core scheduler 300 sends the identification information of the first target CPU running the target task to the task characteristic calculation module 200.
- the identification information of the selected first target CPU can be written into the task structure and sent to the task characteristic calculation module 200 .
- the task characteristic calculation module 200 may determine the first target CPU to which the target task is currently scheduled based on the received task structure.
- the above identification information may be, for example, the device ID of the first target CPU, etc., which is not limited here.
- the task characteristic calculation module 200 configures the load characteristic monitor 400 for the CPU through the monitor call interface.
- the task characteristic calculation module 200 selects the corresponding CPU load characteristic monitor 400 based on the identification of the first target CPU sent by the large and small core scheduler 300, and calls the monitor call interface.
- the monitor call interface of this application can realize the selection of load characteristic calculation model, model setting and acceptance of interruption notification.
- the communication between the task characteristic calculation module 200 and the load characteristic monitor 400 is implemented through the monitor call interface.
- the task characteristic calculation module 200 matches the corresponding load characteristic calculation model for the target task running on the first target CPU and sets relevant model parameters.
- the task characteristic calculation module 200 can match a suitable load characteristic calculation model for the target task based on the running scenario of the target task running on the first target CPU. Specifically, the task characteristic calculation module 200 selects the value of the register MSR_PMU_MODEL_ID defined in Table 1. The value of the register MSR_PMU_MODEL_ID represents which load characteristic calculation model formula is selected. The register MSR_PMU_MODEL_ID determines what is needed based on the determined load characteristic calculation model. The number of counters. The task characteristic calculation module 200 determines a matching load characteristic calculation model, and sets initial calculation parameters for the model based on the initial task load feature value of the task or the historical task load feature value of the task. The initial calculation parameters may be, for example, in the model. The weight coefficient of each variable, etc.
- the selection of the load characteristic calculation model can be based on the operating scenario and task characteristic identification of the corresponding task.
- the task characteristic calculation module 200 can select an appropriate load characteristic calculation model for the corresponding task based on what application the server 100 runs and what tasks the application performs.
- the task characteristic calculation module 200 can select a load characteristic calculation model suitable for the task based on the software program running on the PC and the task characteristic identifier corresponding to the task of executing the software.
- the corresponding selected load characteristic calculation models can be different, and there is no restriction here.
- the system can also select the default load characteristic calculation model for the first target CPU according to the model parameters corresponding to each load characteristic calculation model when the task characteristic calculation module is initialized, and complete the calculation of the first target CPU. Settings of relevant parameters of each MSR register corresponding to the target CPU. Furthermore, when the task running on the first target CPU is switched, for example, when switching from other tasks originally running to the target task, the register MSR_PMU_MODEL_RESET only needs to be set to trigger the load characteristic monitor 400 to recalculate using the corresponding load characteristic calculation model. Load characteristic value.
- the selection of the above-mentioned load characteristic calculation model is related to the type of each task instruction executed by the first target CPU executing the target task and the execution statistics results.
- the specific process of selecting the load characteristic calculation model and setting the relevant model parameters will be explained in detail below with reference to the corresponding drawings, and will not be described in detail here.
- the task characteristic calculation module 200 sends the matched load characteristic calculation model calling parameters and related model parameters to the load characteristic monitor 400.
- the task characteristic calculation module 200 can send the matched load characteristic calculation model calling parameters and the set related model parameters to the called load characteristic monitor 400 through the monitor calling interface.
- the task characteristic calculation module 200 when the task characteristic calculation module 200 sends the matched load characteristic calculation model calling parameters and related model parameters to the load characteristic monitor 400, it can also notify the large and small core scheduler 300 to start running the task.
- the large and small core scheduler 300 can control the scheduled first target CPU to select the target task from the task queue to start running.
- the first target CPU can perform context switching according to the task queue and start running with the selected target task, which will not be described in detail in this application.
- the load characteristic monitor 400 calls the corresponding load characteristic calculation model and completes the configuration of the relevant model parameters.
- the load characteristic monitor 400 can determine the calling parameters of the load characteristic calculation model from the preset multiple load characteristic calculation models according to the received calling parameters and related model parameters sent by the task characteristic calculation module 200. Load characteristics corresponding to parameters The calculation model is called, and the relevant parameters in the model are configured based on the received relevant model parameters.
- the configuration process may include: configuring the number of relevant counters, setting corresponding definitions and corresponding parameter values for each counter, etc., which are not limited here.
- the load characteristic monitor 400 monitors the task load characteristic value during the running process of the target task.
- the load characteristic monitor 400 can read data such as the count value of the register logic unit corresponding to the first target CPU, and the combinational logic circuit automatically inputs the read data to In the logical computing unit, automatic calculation is performed based on the configured load characteristic calculation model.
- the load characteristic monitor 400 uses the load characteristic calculation model with configured model parameters, and can calculate according to the calculation period corresponding to the model setting in the register MSR_PMU_MODEL_INTERVAL defined in Table 1, and save the calculated current task load characteristic value in in the register MSR_PMU_MODEL_STATUS defined in Table 1.
- the specific load characteristic calculation model process will be explained in detail below with reference to the corresponding drawings, and will not be described in detail here.
- the load characteristic monitor 400 determines whether the real-time task load characteristic value exceeds the load characteristic threshold. If the judgment result is yes, it indicates that the target task may need to be scheduled, and the following step 416 is executed to initiate an interrupt; if the judgment result is no, it indicates that the target task does not need to be scheduled and can continue to run on the currently running first target CPU.
- the above-mentioned load characteristic threshold may be, for example, the load characteristic threshold in the corresponding register based on the model parameter configuration in the above-mentioned step 414, or the load characteristic included in the model parameters corresponding to the selected load characteristic calculation model in the above-mentioned step 411. threshold. If the calculated task load characteristic value exceeds the threshold, it indicates that the target task may need to be scheduled and an interrupt needs to be triggered for further confirmation. On the contrary, if the calculated task load characteristic value does not exceed the threshold, the target task continues to run on the first target CPU.
- the task characteristic calculation module 200 executes the above step 411, it can set the upper threshold corresponding to the register "MSR_PMU_MODEL_THRESHOLD_H" defined in the above Table 1. . Furthermore, when the task load characteristic value monitored by the load characteristic monitor 400 is greater than the upper bound threshold, it can be determined that the target task may be more suitable for running on a large core, and the following step 416 may need to be executed to trigger an interrupt and schedule the target task. Continue running on the big core.
- the task characteristic calculation module 200 when the task characteristic calculation module 200 executes the above step 411, it can set the lower bound threshold corresponding to the register "MSR_PMU_MODEL_THRESHOLD_L" defined in the above Table 1. Furthermore, when the task load characteristic value monitored by the load characteristic monitor 400 is less than the lower bound threshold, it can be determined that the target task may be more suitable to run on the small core, and an interrupt may need to be triggered to schedule the target task to the small core to continue running.
- the specific process by which the load characteristic monitor 400 calculates the real-time load characteristic value corresponding to the target task based on the load characteristic calculation model will be described in detail below and will not be described in detail here.
- the load characteristic monitor 400 sends an interruption notification and the current task load characteristic value of the target task to the task characteristic calculation module 200.
- the load characteristic monitor 400 may send an interrupt notification to the task characteristic calculation module 200 to initiate an interrupt. Furthermore, when the load characteristic monitor 400 sends an interruption notification to the task characteristic calculation module 200, it may also send the calculated current task load characteristic value of the target task to the task characteristic calculation module 200. The specific process of the load characteristic monitor 400 initiating an interrupt will be described in detail below, and will not be described in detail here.
- the load characteristic monitor 400 can initiate an interrupt by calling an interrupt function, which is not limited here.
- the task characteristic calculation module 200 responds to the interrupt, obtains the current task load characteristic value of the target task, and generates a corresponding task characteristic identifier.
- the task characteristic calculation module 200 receives an interruption notification from the load characteristic monitor 400, and may respond to the interruption, Read the current task load characteristic value recorded in the register MSR_PMU_MODEL_STATUS through the monitor call interface, and combine it with the task scheduling policy corresponding to the target task to generate the current task characteristic identifier of the target task.
- the task characteristic calculation module 200 determines whether the level identifier corresponding to the first target CPU currently executing the target task matches the task characteristic identifier. If the judgment result is yes, that is, there is a match, there is no need to schedule the target task, and you can return to the above step 412 to keep monitoring the task load characteristic value of the target task. If the judgment result is no, that is, there is no match, the target task needs to be scheduled, and the following step 420 can be continued to send the scheduling request and the generated task characteristic identifier to the large and small core scheduler 300 .
- the task characteristic calculation module 200 can determine the computing power characteristics provided by the first target CPU on which the target task is currently running based on the corresponding relationship between the task characteristic identifier and the CPU level identifier stored in it. Whether the value matches the task load characteristic value, thereby determining whether the target task needs to be scheduled. If necessary, the task characteristic calculation module 200 can perform the following step 420 to generate a scheduling request and a task characteristic identifier, and send them to the large and small core scheduler 300 .
- the task characteristic calculation module 200 may further determine the reason why scheduling is not required.
- the reason why the task does not need to be scheduled may be that the user changes the task scheduling policy through the operating system management interface while the task is running. For example, if a task runs on a small core, the task characteristic calculation module 200 determines that the task needs to be scheduled to run on a large core, but the user changes the task scheduling policy to limit the task to run on a small core. At this time, the task does not need to be mobilized. Continue Run on small cores.
- the reason why tasks do not need to be scheduled may be that when the task characteristic calculation module 200 sets the corresponding preset threshold of the load characteristic calculation model, the threshold is set too low.
- the reason why the task does not need to be scheduled may be that the application scheduling policy service setting requires the load characteristic monitor 400 to monitor the task load characteristic value at the beginning. After periodic monitoring, the application scheduling policy service instructs to close the task. Monitoring of load characteristic values, tasks do not need to be scheduled at this time. There are no restrictions here.
- the task characteristic calculation module 200 may send the task characteristic identifier generated based on the current task load characteristics of the target task to the large and small core scheduler 300 for the large and small core scheduler 300 to determine whether task scheduling is required.
- the task characteristic calculation module 200 sends the scheduling request for the target task and the generated task characteristic identifier to the large and small core scheduler 300.
- the task characteristic calculation module 200 may send a scheduling request for the target task and an updated task structure corresponding to the target task to the large and small core scheduler 300.
- the task structure may include the above The newly generated task feature identifier in step 418.
- the task characteristic calculation module 200 may also send the above-mentioned scheduling request and the newly generated task characteristic identifier to the large and small core scheduler 300 through function calls, etc., which is not limited here.
- the large and small core scheduler 300 responds to the scheduling request, selects the second target CPU corresponding to the computing power level according to the received task characteristic identifier, and schedules the task to the second target CPU.
- the large and small core scheduler 300 matches a type of CPU marked by the CPU level identifier corresponding to the task characteristic identifier, that is, computing power matching.
- a type of CPU the large and small core scheduler 300 can select an idle CPU from the matched CPUs of this type as the second target CPU for task scheduling.
- the idle CPU may be, for example, a task queue that is idle, or a CPU that is not currently executing a task, which is not limited here.
- the large and small core scheduler 300 can match each CPU marked by the large core level identification based on the correspondence between the type B task and the large core level identification. . Furthermore, the large and small core scheduler 300 can select an idle second target CPU among the CPUs under the matched large core computing power level. And schedule the task to the second target CPU.
- the specific scheduling implementation steps are described in another flow chart and will not be described again here.
- the large and small core scheduler 300 may only receive the task characteristic identifier sent from the task characteristic calculation module 200, and then determine whether the target task needs to be scheduled based on the received task characteristic identifier. Furthermore, when the target task needs to be scheduled, the large and small core scheduler 300 can select the second target CPU corresponding to the computing power level according to the task characteristic identifier and complete the scheduling.
- the system of the server 100 can repeat the above steps 411 to 414, call the load characteristic monitor of the second target CPU, and select the load characteristic calculation model used for the load characteristic monitor based on the target task information. , and set relevant model parameters, etc.
- the relevant descriptions in the above steps 411 to 414 please refer to the relevant descriptions in the above steps 411 to 414, which will not be described again here.
- the load characteristic monitor can continue to monitor the task load characteristic value of the target task executed on the second target CPU.
- the load characteristic monitor 400 can continuously monitor and calculate the task load characteristic value. Moreover, when the load characteristic monitor 400 finds that the current task load characteristic value exceeds the corresponding threshold, it can trigger an interrupt and notify the task characteristic calculation module 200 to determine whether the task needs to be scheduled. When scheduling is not required, it continues to run on the current CPU after resetting the load characteristic monitor 400. If scheduling is required, the large and small core scheduler 300 is notified to schedule the task, thereby realizing real-time large and small core migration of tasks and ensuring real-time tasks. responding speed.
- the load characteristic monitor 400 corresponding to each CPU can preset multiple optional load characteristic calculation models, and provide a monitor call interface to support load characteristic calculation model selection and parameter configuration as well as interrupt trigger condition configuration. Therefore, the task scheduling of this application The method is suitable for a variety of scenarios.
- the task scheduling method provided by the embodiment of the present application can be applied not only to the server 100 but also to electronic devices such as mobile phones and PCs.
- the task scheduling method provided by the embodiments of this application can not only ensure the real-time response speed of tasks, but also be able to adapt to more task scheduling scenarios on various electronic devices, increasing the diversity of applicable scenarios.
- step 415 The process of calculating the task load characteristic value based on the load characteristic calculation model with completed parameter configuration involved in step 415 is described in detail below.
- parameters such as w 1 to w 7 represent the weight coefficients of data items such as A, B,..., G under the "index" field in Table 2 below.
- w 0 corresponds to the value of the register MSR_PMU_PARAM defined in Table 1
- w For the values of parameters such as 0 to w 7 , please refer to the corresponding values under the "value” field in Table 2 below.
- A For the meaning of the data items corresponding to A, B,..., G, etc., please refer to the corresponding description of the "Description" field in Table 2 below.
- A represents "the proportion of instruction acquisition blocked due to memory access delay", etc., which are not enumerated here.
- FIG. 5 shows a schematic diagram of the working principle of a load characteristic monitor for monitoring task load characteristic values according to an embodiment of the present application. The following describes the working contents of each register in the load characteristic monitor during the implementation process of this application in conjunction with the implementation process of this application.
- the load feature calculation model based on which the load feature monitor calculates the task load feature value can be determined based on the value of the register MSR_PMU_MODEL_ID corresponding to the model calculation logic unit shown in Figure 5.
- the corresponding model calculation logic unit calculates the task.
- the number of PMU counters on which the load characteristic value is based can be determined by the value of the register MSR_PMU_MODEL_ID.
- the load characteristic monitor 400 on the CPU can calculate according to the load characteristic calculation model selected by the task characteristic calculation module 200 and the register MSR_PMU_MODEL_INTERVAL defined in Table 1. cycle is calculated. For example, the load characteristic value is calculated using formula (1) corresponding to the above load characteristic calculation model. Then, the load characteristic monitor 400 can compare the calculation result with a preset load characteristic threshold corresponding to the adopted load characteristic calculation model, for example, with the corresponding upper bound threshold set in the register "MSR_PMU_MODEL_THRESHOLD_H" in the above Table 1, or "MSR_PMU_MODEL_THRESHOLD_L" is compared with the set lower threshold.
- the load characteristic monitor 400 can send the interrupt notification to the task characteristic calculation module 200 through the monitor call interface, and the task characteristic calculation module 200 can read the task load characteristic value stored in the register "MSR_PMU_MODEL_STATUS" in Table 1 , generate task characteristic identification. Furthermore, the task characteristic calculation module 200 can determine whether the target task needs to be scheduled based on the generated task characteristic identifier.
- the task characteristic calculation module 200 may notify the large and small core scheduler 300 to schedule the target task.
- the large and small core scheduler 300 can match the current task load characteristic value of the target task with a suitable CPU computing power level based on the above task characteristic identifier, and select an idle second target CPU for task scheduling.
- the task characteristic calculation module 200 may write the task characteristic identifier of the target task into the register MSR_PMU_PARAM corresponding to the second target CPU, and then notify the task characteristic calculation module 200 to select the load characteristic monitor 400 corresponding to the second target CPU. Suitable load characteristic calculation model.
- the load characteristic monitor 400 can reset the data on the load characteristic monitor 400 by setting the value of the register MSR_PMU_MODEL_RESET in Table 1. For example, the PMC data obtained in the historical monitoring task can be cleared so that the count data monitoring target can be reacquired. The task executes the corresponding task load characteristic value on the current second target CPU.
- the load characteristic calculation model is reset and the operation of the target task is resumed.
- the specific scheduling process has been described in step 421 above, and will not be described again here.
- FIG. 6 shows a schematic flowchart of an implementation process for triggering an interrupt by a load characteristic monitor according to an embodiment of the present application. It can be understood that the execution subject of each step in the process shown in FIG. 6 can all be the load characteristic monitor 400, and the description of the execution subject of each step will not be repeated in the following description of each step.
- the process includes the following steps:
- 601 Use the configured load characteristic calculation model to calculate the current task load characteristic value.
- the load characteristic monitor 400 can read data such as the count value of each counter, input the read data into the model calculation logic unit, and calculate the model according to the configured load characteristic.
- the load characteristic calculation model is calculated according to the calculation period set by the register MSR_PMU_MODEL_INTERVAL.
- the load characteristic monitor triggers an interrupt, the current task load characteristic value is saved in the register MSR_PMU_MODEL_STATUS.
- step 602 Determine whether the calculated task load characteristic value exceeds the preset load threshold. If the judgment result is yes, the task load When the characteristic value does not exceed the load threshold, you can return to the above step 601 to continue calculating the task load characteristic value at the next monitoring moment; if the judgment result is no, that is, when the task load characteristic value exceeds the load characteristic threshold, then continue to perform the following step 603 , triggering an interrupt.
- the load characteristic calculation model used by the load characteristic monitor 400 may correspond to a preset load threshold of appropriate size.
- the threshold may be, for example, the upper bound threshold corresponding to the register "MSR_PMU_MODEL_THRESHOLD_H" defined in Table 1 above, etc.
- MSR_PMU_MODEL_THRESHOLD_H the register "MSR_PMU_MODEL_THRESHOLD_H” defined in Table 1 above, etc.
- 603 Send an interruption notification to the task characteristic calculation module 200.
- Figure 7 shows a schematic workflow diagram of a task characteristic calculation module initiating task scheduling in response to an interrupt according to an embodiment of the present application. It can be understood that the execution subject of each step in the process shown in FIG. 7 can all be the task characteristic calculation module 200. In order to simplify the description, the execution subject of each step will not be repeatedly described when introducing the following steps.
- the process includes the following steps:
- the task characteristic calculation module 200 can access the register of the corresponding load characteristic monitor and read the current task load characteristic value stored in the register MSR_PMU_MODEL_STATUS.
- the task load characteristic value may be a task load characteristic value calculated by the load characteristic monitor based on the currently adopted load characteristic calculation model.
- the task characteristic calculation module 200 can suspend the calculation of the task load characteristic value by clearing the relevant value of the register MSR_PMU_MODEL_ENABLE.
- step 418 For the specific process of obtaining the current task load characteristic value by the task characteristic calculation module 200, please refer to the relevant description in step 418 above, and will not be described in detail here.
- step 704 Determine whether the generated task characteristic identifier matches the level identifier on the CPU currently running the target task. If the judgment result is yes, that is, there is a match, then there is no need to schedule the target task, and the following step 706 can be performed to reconfigure the model parameters. If the judgment result is no, that is, there is no match, the target task needs to be scheduled, and the following step 705 can be continued to send the scheduling request and the generated task characteristic identifier to the large and small core scheduler.
- the task characteristic calculation module 200 may refer to the relevant description in step 419 above, and will not be described in detail here.
- the task characteristic calculation module 200 sends a task scheduling request and a task characteristic identifier to the large and small core scheduler 300 based on the judgment result of step 705 .
- the large and small core scheduler 300 will select the core according to the task characteristic identifier of the target task, the stored large and small core level identifiers corresponding to each CPU, and the degree of idleness. Large and small core scheduler 300 selection, etc. After level identification matches the target CPU, the task will be scheduled from the current CPU to the target CPU. The following is a detailed description of the workflow of task scheduling performed by the large and small core scheduler in conjunction with Figure 8.
- Figure 8 shows a schematic workflow diagram of a large and small core scheduler performing task scheduling according to an embodiment of the present application. It can be understood that the execution subject of each step in the process shown in FIG. 8 can be the large and small core scheduler 300. To simplify the description, the execution subject of each step will not be repeatedly described when introducing the following steps.
- the process includes the following steps:
- CPU1 selects the next task from the task queue to wait for running.
- CPU1 selects the next task from the task queue and may mark it as ready to run, waiting to be run. In other embodiments, if there is no task in the running queue of CPU1 that needs to be run, CPU1 is marked as an idle state, which is not limited here.
- the target task to be scheduled is removed from CPU1, and the idle degree information of CPU1 after the task is removed is updated.
- the large and small core scheduler 300 schedules the target task to CPU3, and CPU3 can update the task queue related information after transferring the target task.
- CPU3 can update the task queue related information after transferring the target task.
- CPU1 starts running the task selected in step 801 above.
- CPU3 selects the target task in the task queue to start running.
- Figure 9 shows an implementation flow chart for setting a load characteristic monitor after task scheduling according to an embodiment of the present application.
- the execution subject of each step in the process shown in FIG. 9 may all be the load characteristic monitor 400. To simplify the description, the description of the execution subject of each step will not be repeated when introducing the following steps.
- the process includes the following steps:
- the calling request is received, and the load characteristic calculation model calling parameters and related model parameters of the corresponding new task are obtained.
- the load characteristic calculation model calling parameters and related model parameters of the corresponding new task are obtained.
- the load characteristic calculation model corresponding to the calling parameter is determined from a plurality of preset load characteristic calculation models and called, And complete the configuration of relevant model parameters.
- the specific model calling process please refer to the relevant description in step 414 above, and will not be described in detail here.
- the load characteristic monitor 400 performs monitoring and calculation on the new task, and performs task load characteristic value calculation on the new task according to the calculation period.
- the specific calculation process please refer to the relevant description in step 415 above, and will not be described again here.
- Figure 10 shows an implementation flow chart of another task scheduling method according to an embodiment of the present application.
- the execution subject of each step of the process shown in Figure 10 can be an electronic device such as the server 100. To avoid repetition, the execution subject of each step will not be described in the following description of specific steps. In other embodiments, the execution subject of each step shown in Figure 10 may also be Therefore, the above-mentioned electronic devices such as PCs or mobile phones are not restricted here.
- the process includes the following steps:
- 1001 Select the target CPU according to the task characteristic identifier corresponding to the target task.
- the system of the server 100 has a level identifier added to the CPU in advance, and a preset corresponding relationship between the task feature identifier and the CPU level identifier. Then, the level identifier and the task feature can be selected based on the task feature identifier corresponding to the target task. Identifies the corresponding target CPU.
- a level identifier added to the CPU in advance
- the level identifier and the task feature can be selected based on the task feature identifier corresponding to the target task. Identifies the corresponding target CPU.
- 1002 Place the target task schedule in the task queue of the target CPU and prepare to run.
- the server 100 selects the target CPU corresponding to the level identifier according to the task characteristic identifier, and schedules the task to the target CPU to prepare for execution.
- the specific preparation process please refer to the relevant description in step 409 above, and will not be described again here.
- 1003 Set the load characteristic monitor for the target task, select the characteristic calculation model corresponding to the task, and set the parameters of the model.
- the server 100 calls the corresponding monitor call interface according to the selected target CPU, selects a feature calculation model corresponding to the task according to the task feature identifier, and sets the parameters of the model.
- the selection of the load characteristic calculation model can be based on the operating scenario and task characteristic identification of the corresponding task.
- the corresponding selected load characteristic calculation models may be different, and there is no restriction here.
- For the specific process of selecting and setting the load characteristic calculation model please refer to the above steps 401 to 414, which will not be described again here.
- the target task can be started to run on the target CPU, and the task load of the target task can be monitored in real time.
- the specific process of running the target task and monitoring the task load of the target task please refer to the relevant descriptions in the above steps 411 to 415, and will not be described in detail here.
- step 1005 Determine whether the monitored task load characteristic value exceeds the threshold. If the judgment result is yes, it indicates that the target task may need to be scheduled, and the following step 1006 is executed to determine the current task characteristic identifier of the target task. If the judgment result is no, it indicates that the target task does not need to be scheduled, and the target task can continue to be run on the target CPU. .
- the load characteristic monitor 400 corresponding to the target task setting in the server 100 can calculate and calculate the Monitor task load characteristic values. When the calculated task load characteristic value exceeds the corresponding threshold, an interrupt may be triggered, and the following step 1006 may be continued. If the task load characteristic value does not exceed the corresponding threshold, the target task can continue to be run on the target CPU.
- the corresponding threshold may be, for example, the upper threshold corresponding to the register "MSR_PMU_MODEL_THRESHOLD_H" defined in Table 1 above, or the lower threshold corresponding to the register "MSR_PMU_MODEL_THRESHOLD_L" defined in Table 1 above.
- step 1005 For the specific judgment process performed in step 1005, please refer to the relevant description in step 416 above, and will not be described again here.
- the server 100 determines that the task load characteristic value exceeds the corresponding threshold and triggers an interrupt. Furthermore, the server 100 can respond to the triggered interrupt and generate the task characteristic identifier based on the monitored task load characteristic value according to the preset rules for generating the task characteristic identifier.
- the above rules can be to generate corresponding task characteristic identifiers based on the range to which the task load characteristic value belongs; or they can be to generate corresponding task characteristic identifiers based on the task load characteristic value and the task scheduling policy provided by the system's application scheduling policy service. , there is no restriction here.
- the specific process of responding to the interrupt and generating the current task feature identifier of the target task please refer to the relevant descriptions in the above steps 417 to 418, and will not be described in detail here.
- 1007 Determine whether the target task needs to be scheduled. If the judgment result is yes, the task needs to be scheduled, and the execution step 1001 needs to be returned to select an appropriate target CPU for the task; if the judgment result is no, the task does not need to be scheduled, and the reason why scheduling is not needed can be further determined.
- the server 100 may determine whether the task needs to be scheduled based on the task characteristic identifier corresponding to the current task load of the target task determined in step 1006. For example, if the server 100 determines the level identifier corresponding to the target CPU running the current target task based on the task characteristic identifier, and if it does not match the current task characteristic identifier of the target task, it may be determined that the target task needs to be scheduled. At this time, the server 100 can reselect a target CPU with a matching level identifier for the target task, and schedule the target task to continue running on the newly selected target CPU. The server 100 returns to the above steps 1000 to 1004, and after setting the load characteristic monitor for the target CPU running the target task, causes the target task to continue running on the newly selected target CPU.
- the server 100 If it is determined that the task does not need to be scheduled, you can further determine the reason why scheduling is not required. Based on the found cause, the server 100 resets the load characteristic calculation model selected in the load characteristic monitor 400 by running the task characteristic calculation module 200, and the task continues to run on the current CPU. For specific reasons for non-scheduling, please refer to the relevant description in step 419 above, and will not be described again here.
- Figure 11 shows a schematic diagram of the internal implementation process of a task scheduling method according to an embodiment of the present application.
- an interrupt notification that is, the "interruption" in Figure 11
- the task characteristic calculation module 200 responds to the interrupt after receiving the interrupt notification, reads the interrupt information, generates a task characteristic identifier according to the task load characteristic value in the interrupt information, and then determines whether the task needs to be scheduled.
- the task characteristic calculation module 200 determines that the task needs to be scheduled, and initiates a scheduling request to the large and small core scheduler 300, that is, "initiating scheduling" in Figure 11.
- the large and small core scheduler 300 based on the received scheduling request and task information Select the CPU corresponding to the level identifier and the task characteristic identifier to perform task scheduling.
- the task characteristic calculation module 200 determines that scheduling is not required, it may further determine the reason why scheduling is not required. Furthermore, according to the found cause, the task characteristic calculation module 200 resets the load characteristic calculation model of the load characteristic monitor 400 through the monitoring call interface, and the task continues to run. For the specific reasons for not scheduling, please refer to the relevant description in step 419 above, and will not be described again here.
- the task scheduling policy configured by the application scheduling policy service is mainly used.
- the user can configure the task scheduling policy through the application scheduling policy service.
- the task characteristic calculation module 200 can calculate the task scheduling policy according to the task scheduling policy. Change to change the operating status of the load characteristics monitor. For example, as described in step 419 above, in other embodiments, applying the task scheduling policy set by the scheduling policy service initially requires the load characteristic monitor 400 to monitor the task load characteristic value. After periodic monitoring, the application scheduling policy service indicates Turn off the monitoring of the task load characteristic value. At this time, it is necessary to take corresponding measures in a timely manner according to the changes in the task scheduling policy, and turn off the monitoring of the task by the load characteristic monitor 400.
- the task scheduling policy configured by the user through the application scheduling policy service stipulates that the task is a large core task, and the task characteristic calculation module 200 synchronizes the task scheduling flag generated by the task scheduling policy for the task to the large and small core scheduler 300 , and the load characteristic monitor 400, the task will be run on the large core according to the configured task scheduling policy.
- Figure 12 shows a schematic diagram of the hardware structure of a server 100 according to an embodiment of the present application.
- server 100 may include one or more processors 1204, system control logic 1208 coupled to at least one of the processors 1204, system memory 1212 coupled to the system control logic 1208, and system control logic 1208 coupled to the system control logic 1208.
- non-volatile memory (NVM) 1216 and a network interface 1220 connected to the system control logic 1208.
- processor 1204 may include one or more single-core or multi-core processors. In some embodiments, processor 1204 may include any combination of general-purpose processors and special-purpose processors (eg, graphics processors, applications processors, baseband processors, etc.). In an embodiment in which the system 1200 adopts an eNB (Evolved Node B, enhanced base station) 101 or a RAN (Radio Access Network, radio access network) controller 102, the processor 1204 may be configured to perform various conforming embodiments.
- eNB evolved Node B, enhanced base station
- RAN Radio Access Network
- system control logic 1208 may include any suitable interface controller to provide any suitable interface to at least one of processors 1204 and/or any suitable device or component in communication with system control logic 1208 .
- system control logic 1208 may include one or more memory controllers to provide an interface to system memory 1212 .
- System memory 1212 may be used to load and store data and/or instructions.
- memory 1212 of system 1200 may include any suitable volatile memory, such as suitable dynamic random access memory (DRAM).
- DRAM dynamic random access memory
- NVM/memory 1216 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions.
- NVM/memory 1216 may include any suitable non-volatile memory such as flash memory and/or any suitable non-volatile storage device, such as HDD (Hard Disk Drive), CD (Compact Disc) , CD) drive, DVD (Digital Versatile Disc, Digital Versatile Disc) drive at least one.
- NVM/storage 1216 may comprise a portion of storage resources on the device on which system 1200 is installed, or it may be accessed by the device but is not necessarily part of the device. For example, NVM/storage 1216 may be accessed over the network via network interface 1220.
- system memory 1212 and NVM/memory 1216 may include temporary and permanent copies of instructions 1224, respectively.
- Instructions 1224 may include instructions that, when executed by at least one of processors 1204, cause system 1200 to implement the methods illustrated in Figure 4 or Figure 10.
- instructions 1224, hardware, firmware, and/or software components thereof may additionally/alternatively be placed in system control logic 1208, network interface 1220, and/or processor 1204.
- Network interface 1220 may include a transceiver for providing a radio interface for system 1200 to communicate with any other suitable devices (eg, front-end modules, antennas, etc.) over one or more networks.
- network interface 1220 may be integrated with other components of system 1200.
- network interface 1220 may be integrated with at least one of processor 1204, system memory 1212, NVM/storage 1216, and a firmware device (not shown) with instructions that when at least one of processor 1204 executes said When instructed, the system 1200 implements the method shown in Figure 4.
- Network interface 1220 may further include any suitable hardware and/or firmware to provide a multiple-input multiple-output radio interface.
- network interface 1220 may be a network adapter, a wireless network adapter, a telephone modem, and/or a wireless modem.
- At least one of the processors 1204 may be packaged with logic for one or more controllers of the system control logic 1208 to form a system in package (SiP). In one embodiment, at least one of the processors 1204 may be integrated on the same die with logic for one or more controllers of the system control logic 1208 to form a system on a chip (SoC).
- SiP system in package
- SoC system on a chip
- System 1200 may further include input/output (I/O) devices 1232 .
- I/O device 1232 may include a user interface that enables a user to interact with system 1200; peripheral component interfaces are designed to enable peripheral components to also interact with system 1200.
- system 1200 also includes sensors for determining at least one of environmental conditions and location information associated with system 1200 .
- the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and/or video camera), a flashlight (e.g., LED flash) and keyboard.
- a display e.g., a liquid crystal display, a touch screen display, etc.
- a speaker e.g., a speaker
- a microphone e.g., a microphone
- one or more cameras e.g., a still image camera and/or video camera
- a flashlight e.g., LED flash
- peripheral component interfaces may include, but are not limited to, non-volatile memory ports, audio jacks, and power interfaces.
- sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units.
- the positioning unit may also be part of or interact with the network interface 1220 to communicate with components of the positioning network. (e.g., Global Positioning System (GPS) satellites) to communicate.
- GPS Global Positioning System
- Figure 13 shows a schematic hardware structure diagram of a mobile phone 600 according to an embodiment of the present application.
- the mobile phone 600 may include a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (USB) interface 630, a charging management module 620, a power management module 621, a battery 622, an antenna 1, an antenna 2, Mobile communication module 650, wireless communication module 660, audio module 670, speaker 670A, receiver 670B, microphone 670C, headphone interface 670D, sensor module 680, button 610, motor 691, indicator 692, camera 693, display screen 694, and user Identification module (subscriber identification module, SIM) card interface 695, etc.
- SIM subscriber identification module
- the sensor module 680 may include a pressure sensor 680A, a gyro sensor 680B, an air pressure sensor 680C, a magnetic sensor 680D, an acceleration sensor 680E, a distance sensor 680F, a proximity light sensor 680G, a fingerprint sensor 680H, a temperature sensor 680J, a touch sensor 680K, and ambient light. Sensor 680L etc.
- the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 600.
- the mobile phone 600 may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
- the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
- the processor 610 may include one or more processing units.
- the processor 610 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
- image signal processor image signal processor, ISP
- controller video codec
- digital signal processor digital signal processor
- DSP digital signal processor
- baseband processor baseband processor
- neural network processor neural-network processing unit, etc.
- different processing units can be independent devices or integrated in one or more processors.
- the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
- the processor 610 may also be provided with a memory for storing instructions and data.
- the memory in processor 610 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 610 . If the processor 610 needs to use the instructions or data again, it can be directly called from the above-mentioned memory. Repeated access is avoided and the waiting time of the processor 610 is reduced, thus improving the efficiency of the system.
- the processor 610 can obtain the data and instructions in the memory for executing the task scheduling method provided by the embodiment of the present application, and implement the task scheduling solution provided by the embodiment of the present application.
- the specific implementation process please refer to the above-mentioned figures 4 to 10 and related descriptions, and will not be described again here.
- processor 610 may include one or more interfaces.
- Interfaces may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver and transmitter (universal asynchronous receiver/transmitter (UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and /or universal serial bus (USB) interface, etc.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- UART universal asynchronous receiver and transmitter
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB universal serial bus
- the USB interface 630 is an interface that complies with the USB standard specifications. Specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
- the USB interface 130 can be used to connect a charger to charge the mobile phone 600, and can also be used to transmit data between the mobile phone 600 and peripheral devices. It can also be used to connect headphones to play audio through them. This interface can also be used to connect other electronic devices, such as AR devices, etc.
- the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic explanation and does not constitute a structural limitation on the mobile phone 600.
- the mobile phone 600 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
- the charging management module 620 is used to receive charging input from the charger.
- the power management module 621 is used to connect the battery 622, the charging management module 620 and the processor 610.
- the power management module 621 receives input from the battery 622 and/or the charging management module 620, and supplies power to the processor 610, the internal memory 621, the display screen 694, the camera 693, the wireless communication module 660, and the like.
- the wireless communication function of the mobile phone 600 can be realized through the antenna 1, the antenna 2, the mobile communication module 650, the wireless communication module 160, the modem processor and the baseband processor.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in mobile phone 600 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
- the mobile communication module 650 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 600.
- the wireless communication module 660 can provide applications on the mobile phone 600 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite systems. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
- WLAN wireless local area networks
- Wi-Fi wireless fidelity
- Bluetooth bluetooth, BT
- global navigation satellite systems global navigation satellite system, GNSS
- FM frequency modulation
- NFC near field communication technology
- infrared technology infrared, IR
- the antenna 1 of the mobile phone 600 is coupled to the mobile communication module 650, and the antenna 2 is coupled to the wireless communication module 660, so that the mobile phone 600 can communicate with the network and other devices through wireless communication technology.
- the mobile phone 600 implements display functions through the GPU, the display screen 694, and the application processor.
- the GPU is an image processing microprocessor and is connected to the display screen 694 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
- Processor 610 may include one or more GPUs that execute program instructions to generate or alter display information.
- the display screen 694 is used to display images, videos, etc.
- the mobile phone 600 can realize the shooting function through the ISP, camera 693, video codec, GPU, display screen 694 and application processor.
- the ISP is used to process the data fed back by the camera 693.
- Camera 693 is used to capture still images or video.
- the external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 600.
- the external memory card communicates with the processor 610 through the external memory interface 620 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
- Internal memory 621 may be used to store computer executable program code, which includes instructions.
- the internal memory 621 may include a program storage area and a data storage area.
- the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
- the storage data area can store data created during the use of the mobile phone 600 (such as audio data, phone book, etc.).
- the internal memory 621 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
- the processor 610 executes various functional applications and data processing of the mobile phone 600 by executing instructions stored in the internal memory 621 and/or instructions stored in a memory provided in the processor.
- the mobile phone 600 can implement audio functions through the audio module 670, the speaker 670A, the receiver 670B, the microphone 670C, the headphone interface 670D, and the application processor. Such as music playback, recording, etc.
- the audio module 670 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 670 may also be used to encode and decode audio signals. In some embodiments, the audio module 670 may be disposed in the processor 610, or some functional modules of the audio module 670 may be disposed in the processor 610.
- Receiver 670B also called “earpiece” is used to convert audio electrical signals into sound signals.
- the voice can be heard by bringing the receiver 670B close to the human ear.
- Microphone 670C also known as “microphone” and “microphone”, is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 670C with the human mouth and input the sound signal to the microphone 670C.
- the mobile phone 600 can be provided with at least one microphone 670C. In other embodiments, the mobile phone 600 can be provided with two microphones 670C, which in addition to collecting sound signals, can also implement a noise reduction function. In other embodiments, the mobile phone 600 can also be equipped with three, four or more microphones 670C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
- the headphone interface 670D is used to connect wired headphones.
- the headphone interface 670D can be a USB interface 630, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA Cellular Telecommunications Industry Association of the USA
- the pressure sensor 680A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
- Fingerprint sensor 680H is used to collect fingerprints.
- the mobile phone 600 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
- Touch sensor 680K also known as "touch device”.
- the touch sensor 680K can be disposed on the display screen 694.
- the touch sensor 680K and the display screen 694 form a touch screen, which is also called a "touch screen”.
- Touch sensor 680K is used to detect a touch operation on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
- Visual output related to the touch operation may be provided through display screen 694.
- the touch sensor 680K may also be disposed on the surface of the mobile phone 600 in a position different from that of the display screen 694 .
- the user when applying the scheduling policy service to configure the task scheduling policy, the user inputs the task scheduling policy on the mobile phone 600, and the touch sensor can pass the detected user touch operation to the application processor to determine the touch event type, and the input The task scheduling strategy is recorded in the task characteristic calculation module 200 of this application.
- the buttons 610 include a power button, a volume button, etc.
- Key 610 may be a mechanical key. It can also be a touch button.
- the mobile phone 600 can receive key input and generate key signal input related to user settings and function control of the mobile phone 600 .
- Motor 691 can produce vibration prompts.
- Motor 691 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
- touch operations for different applications can correspond to different vibration feedback effects.
- Acting on touch operations in different areas of the display screen 694, the motor 691 can also correspond to different vibration feedback effects.
- Different application scenarios (such as time reminders, receiving information, alarm clocks, games, etc.) can also correspond to different vibration feedback effects.
- the touch vibration feedback effect can also be customized.
- the indicator 692 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
- the SIM card interface 695 is used to connect a SIM card.
- the SIM card can be connected to and separated from the mobile phone 600 by inserting it into the SIM card interface 695 or pulling it out from the SIM card interface 695 .
- the mobile phone 600 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
- SIM card interface 695 can support Nano SIM card, Micro SIM card, SIM card, etc.
- the same SIM card interface 695 can insert multiple cards at the same time. The types of the above-mentioned multiple cards can be the same or different.
- the SIM card interface 695 is also compatible with different types of SIM cards.
- the SIM card interface 695 is also compatible with external memory cards.
- the mobile phone 600 interacts with the network through the SIM card to realize functions such as call and data communication.
- the mobile phone 600 uses an eSIM, that is, an embedded SIM card.
- the eSIM card can be embedded in the mobile phone 600 and cannot be separated from the mobile phone 600.
- Figure 14 shows a schematic system architecture diagram of a mobile phone 600 according to an embodiment of the present application.
- the software system of mobile phone 600 can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
- This embodiment of the present invention takes the Android system with a layered architecture as an example to illustrate the software structure of the mobile phone 600 .
- the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
- the layers communicate through software interfaces.
- the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system libraries, as well as the kernel layer.
- the application layer may include a series of application packages.
- the application package may include WeChatTM , browser, video, calendar, call, map, navigation, WLAN, Bluetooth, music, SMS and other applications.
- the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
- API application programming interface
- the application framework layer includes some predefined functions.
- the application framework layer can include window managers, content providers, view systems, phone managers, resource managers, notification managers, etc.
- the window manager is used to manage window programs.
- the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
- Content providers are used to store and retrieve data and make this data accessible to applications.
- This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
- the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
- a view system can be used to build applications.
- the display interface can be composed of one or more views.
- a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
- the phone manager is used to provide communication functions of the mobile phone 600. For example, call status management (including connected, hung up, etc.).
- the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
- the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction.
- the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
- the application framework layer may also include an application scheduling policy service, which is used to preset scheduling conditions for tasks of each application program run by the system according to system operation needs.
- an application scheduling policy service which is used to preset scheduling conditions for tasks of each application program run by the system according to system operation needs.
- the system can use the application scheduling policy service to limit each task of the system application to run only on small cores.
- the task characteristic calculation module can comprehensively apply the above task scheduling strategies preset by the scheduling strategy service, and no longer schedule the corresponding tasks to run on the large core.
- Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
- the core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.
- the application layer and application framework layer run in virtual machines.
- the virtual machine executes the java files of the application layer and application framework layer into binary files.
- the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
- System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing libraries (for example: OpenGL ES), 2D graphics engines (for example: SGL), etc.
- the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
- 2D Graphics Engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer at least includes various hardware drivers, such as CPU drivers, as well as display drivers, camera drivers, audio drivers, sensor drivers, etc. not shown in Figure 14.
- the kernel layer also includes the above-mentioned task characteristic calculation module, large and small core scheduler, load characteristic monitor, and monitor calling interface.
- the above-mentioned task characteristic calculation module, large and small core scheduler, load characteristic monitor, and monitor calling interface for specific functions performed by the above-mentioned task characteristic calculation module, large and small core scheduler, load characteristic monitor, and monitor call interface in the process of implementing the task scheduling method provided by the embodiment of the present application, please refer to the relevant figures in Figure 3 and Figure 4 above. Description, no details will be given here.
- the applicable electronic devices for the task scheduling method and device may include but are not limited to mobile phones, tablet computers, desktops, laptops, handheld computers, netbooks, and augmented reality.
- AR virtual reality
- VR virtual reality
- smart TVs smart watches and other wearable devices
- servers mobile email devices
- car equipment portable game consoles
- portable music players portable reader devices
- embedded in them a television coupled to one or more processors, or other electronic device capable of accessing the network.
- the present disclosure also relates to means for performing the operations described herein.
- This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer.
- Such computer programs may be stored on a computer-readable medium such as, but not limited to, any type of disk including floppy disk, optical disk, CD-ROM, magneto-optical disk, read-only memory (ROM), random access memory (RAM) , EPROM, EEPROM, magnetic or optical card, application specific integrated circuit (ASIC), or any type of medium suitable for storing electronic instructions, and each may be coupled to a computer system bus.
- the computers referred to in the specification may include a single processor or may employ an architecture involving multiple processors for increased computing power.
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)
- Hardware Redundancy (AREA)
- Stored Programmes (AREA)
Abstract
Description
speedup=w0+w1*A+w2*B+w3*C+w4*D+w5*E+w6*F+w7*G (1)
Claims (10)
- 一种任务调度方法,应用于电子设备,其特征在于,所述方法包括:计算出执行第一任务需要的第一负载值,并确定与第一负载值所属的第一负载范围所对应的至少一个第一等级处理器;采用所述至少一个第一等级处理器中的处于空闲状态的第一等级处理器处理所述第一任务;计算出执行第二任务需要的第二负载值,并确定与第二负载值所属的第二负载范围所对应的至少一个第二等级处理器;采用所述至少一个第二等级处理器中的处于空闲状态的第二等级处理器处理所述第二任务。
- 根据权利要求1所述的方法,其特征在于,在采用所述第一等级处理器处理所述第一任务的过程中,所述方法还包括:计算出执行第一任务需要的第三负载值,并确定与第三负载值所属的第三负载范围所对应的至少一个第三等级处理器;采用所述至少一个第三等级处理器中的处于空闲状态的第三等级处理器处理所述第一任务;其中,所述第三等级处理器与所述第一等级处理器为不同等级的处理器,所述第三等级处理器与所述第二等级处理器为相同或者不同等级的处理器。
- 根据权利要求2所述的方法,其特征在于,所述采用所述至少一个第三等级处理器中的处于空闲状态的第三等级处理器处理所述第一任务,包括:对第一等级处理器处理所述第一任务的过程触发中断;将所述第一任务从所述第一等级处理器的第一任务队列中移除,并将所述第一任务添加到所述第三等级处理器的第二任务队列中;采用所述第三等级处理器选中所述第二任务队列中的第一任务继续处理。
- 根据权利要求3所述的方法,其特征在于,所述电子设备包括对应于第一等级处理器预设的第一性能阈值和第二性能阈值,其中所述第一性能阈值大于所述第二性能阈值,并且,所述对第一等级处理器处理所述第一任务的过程触发中断,包括:检测到计算出的第三负载值大于所述第一性能阈值、或者小于所述第二性能阈值,对第一等级处理器处理所述第一任务的过程触发中断。
- 根据权利要求2所述的方法,其特征在于,所述电子设备包括任务特征标识与处理器等级标识之间的对应关系,所述处理器等级标识至少包括所述第一等级处理器和所述第二等级处理器,并且,所述确定与第一负载值所属的第一负载范围所对应的至少一个第一等级处理器,包括:基于预设的标识转换规则,将计算出的所述第一负载值转换为对应所述任务特征标识的第一标识值;确定所述第一标识值属于第一任务特征标识对应的标识值范围,并基于所述第一任务特征标识与第一等级处理器之间的第一对应关系,确定至少一个第一等级处理器。
- 根据权利要求5所述的方法,其特征在于,所述电子设备包括第一负载范围与所述第一任务特征标识对应的标识值范围之间的第二对应关系,并且,所述确定与第一负载值所属的第一负载范围所对应的至少一个第一等级处理器,包括:确定第一负载值所属的第一负载范围,并基于所述第二对应关系确定与第一负载值相对应的第一任务特征标识;基于所述第一对应关系,确定至少一个第一等级处理器。
- 根据权利要求5所述的方法,其特征在于,所述电子设备包括多个处理器,并且,所述电子设备基于各处理器的算力特征值,对各处理器添加所述处理器等级标识,其中,所述各处理器的算力特征值与各处理器的频率和微架构算力相关,所述处理器的频率包括所述处理器的主频或者工作频率。
- 根据权利要求1至7中任一项所述的方法,其特征在于,所述第一负载值与所述第一等级处理器获取及执行所述第一任务相关的指令类型、以及所述指令的执行情况统计结果相关;所述第二负载值与所述第二等级处理器获取及执行所述第一任务相关的指令类型、以及所述指令的执行情况统计结果相关。
- 一种电子设备,其特征在于,包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个程序,当所述一个或者多个程序被所述一个或多个处理器执行时,使得所述电子设备执行权利要求1至8中任一项所述的任务调度方法。
- 一种计算机可读存储介质,其特征在于,所述存储介质上存储有指令,所述指令在计算机上执行时使所述计算机执行权利要求1至8中任一项所述的任务调度方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP23853975.3A EP4575781A4 (en) | 2022-08-19 | 2023-05-12 | TASK PLANNING METHOD, ELECTRONIC DEVICE AND COMPUTER-READABLE STORAGE MEDIA |
| US19/055,849 US20250190252A1 (en) | 2022-08-19 | 2025-02-18 | Task scheduling method, electronic device, and computer-readable storage medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211001547.4A CN117632400A (zh) | 2022-08-19 | 2022-08-19 | 任务调度方法、电子设备及计算机可读存储介质 |
| CN202211001547.4 | 2022-08-19 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/055,849 Continuation US20250190252A1 (en) | 2022-08-19 | 2025-02-18 | Task scheduling method, electronic device, and computer-readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024037068A1 true WO2024037068A1 (zh) | 2024-02-22 |
Family
ID=89940595
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/093867 Ceased WO2024037068A1 (zh) | 2022-08-19 | 2023-05-12 | 任务调度方法、电子设备及计算机可读存储介质 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20250190252A1 (zh) |
| EP (1) | EP4575781A4 (zh) |
| CN (1) | CN117632400A (zh) |
| WO (1) | WO2024037068A1 (zh) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117873735A (zh) * | 2024-03-11 | 2024-04-12 | 湖南马栏山视频先进技术研究院有限公司 | 一种虚拟化环境下gpu调度系统 |
| CN118349362A (zh) * | 2024-06-14 | 2024-07-16 | 浪潮电子信息产业股份有限公司 | 资源分配方法、装置及设备、存储介质和计算机程序产品 |
| CN119212105A (zh) * | 2024-09-03 | 2024-12-27 | 北京交通大学 | 一种面向融合网络的任务感知与智能调度方法 |
| CN119292783A (zh) * | 2024-10-24 | 2025-01-10 | 中国南方电网有限责任公司 | openEuler操作系统内核优化方法、装置、设备和介质 |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119248466B (zh) * | 2024-03-27 | 2025-12-05 | 荣耀终端股份有限公司 | 一种控制方法及电子设备 |
| CN119088574B (zh) * | 2024-11-05 | 2025-04-04 | 阿里云计算有限公司 | 资源调度方法、设备、存储介质及程序产品 |
| CN119597306B (zh) * | 2024-11-20 | 2026-02-10 | 广东电网有限责任公司 | 多核处理器自适应部署方法、装置、终端设备和存储介质 |
| CN119938245B (zh) * | 2024-12-02 | 2025-09-30 | 鹏城实验室 | 基于智算集群的任务处理方法、装置、设备及存储介质 |
| CN120762376A (zh) * | 2025-07-08 | 2025-10-10 | 惠州市宏大自动化涂装系统工程有限公司 | 基于嵌入式实时操作系统的工业控制数据处理系统及方法 |
| CN121210071B (zh) * | 2025-11-21 | 2026-04-21 | 上海壁仞科技股份有限公司 | 任务调度方法、装置、芯片、设备和存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103646006A (zh) * | 2013-11-26 | 2014-03-19 | 乐视致新电子科技(天津)有限公司 | 一种处理器的调度方法、装置和系统 |
| CN111597042A (zh) * | 2020-05-11 | 2020-08-28 | Oppo广东移动通信有限公司 | 业务线程运行方法、装置、存储介质及电子设备 |
| CN112948066A (zh) * | 2019-12-10 | 2021-06-11 | 中国科学院深圳先进技术研究院 | 一种基于异构资源的Spark任务调度方法 |
| CN113656177A (zh) * | 2021-08-19 | 2021-11-16 | 联想(北京)有限公司 | 控制方法及电子设备 |
| US11275623B1 (en) * | 2019-05-30 | 2022-03-15 | Snap Inc. | Core targeting in heterogeneous multiprocessor systems |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9785481B2 (en) * | 2014-07-24 | 2017-10-10 | Qualcomm Innovation Center, Inc. | Power aware task scheduling on multi-processor systems |
| US10628214B2 (en) * | 2015-06-01 | 2020-04-21 | Samsung Electronics Co., Ltd. | Method for scheduling entity in multicore processor system |
-
2022
- 2022-08-19 CN CN202211001547.4A patent/CN117632400A/zh active Pending
-
2023
- 2023-05-12 WO PCT/CN2023/093867 patent/WO2024037068A1/zh not_active Ceased
- 2023-05-12 EP EP23853975.3A patent/EP4575781A4/en active Pending
-
2025
- 2025-02-18 US US19/055,849 patent/US20250190252A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103646006A (zh) * | 2013-11-26 | 2014-03-19 | 乐视致新电子科技(天津)有限公司 | 一种处理器的调度方法、装置和系统 |
| US11275623B1 (en) * | 2019-05-30 | 2022-03-15 | Snap Inc. | Core targeting in heterogeneous multiprocessor systems |
| CN112948066A (zh) * | 2019-12-10 | 2021-06-11 | 中国科学院深圳先进技术研究院 | 一种基于异构资源的Spark任务调度方法 |
| CN111597042A (zh) * | 2020-05-11 | 2020-08-28 | Oppo广东移动通信有限公司 | 业务线程运行方法、装置、存储介质及电子设备 |
| CN113656177A (zh) * | 2021-08-19 | 2021-11-16 | 联想(北京)有限公司 | 控制方法及电子设备 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4575781A4 |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117873735A (zh) * | 2024-03-11 | 2024-04-12 | 湖南马栏山视频先进技术研究院有限公司 | 一种虚拟化环境下gpu调度系统 |
| CN117873735B (zh) * | 2024-03-11 | 2024-05-28 | 湖南马栏山视频先进技术研究院有限公司 | 一种虚拟化环境下gpu调度系统 |
| CN118349362A (zh) * | 2024-06-14 | 2024-07-16 | 浪潮电子信息产业股份有限公司 | 资源分配方法、装置及设备、存储介质和计算机程序产品 |
| CN119212105A (zh) * | 2024-09-03 | 2024-12-27 | 北京交通大学 | 一种面向融合网络的任务感知与智能调度方法 |
| CN119292783A (zh) * | 2024-10-24 | 2025-01-10 | 中国南方电网有限责任公司 | openEuler操作系统内核优化方法、装置、设备和介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4575781A4 (en) | 2026-01-07 |
| CN117632400A (zh) | 2024-03-01 |
| US20250190252A1 (en) | 2025-06-12 |
| EP4575781A1 (en) | 2025-06-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20250190252A1 (en) | Task scheduling method, electronic device, and computer-readable storage medium | |
| CN106874168A (zh) | 确定应用程序运行性能的方法、装置和移动终端 | |
| CN115562878B (zh) | Gpu计算资源的管理方法、装置、电子设备及可读存储介质 | |
| CN109992400A (zh) | 资源分配方法、装置、移动终端及计算机可读存储介质 | |
| WO2017129022A1 (zh) | 一种终端数据库的并行执行方法和装置 | |
| CN110119305B (zh) | 任务执行方法、装置、计算机设备及存储介质 | |
| CN116578422B (zh) | 资源分配方法和电子设备 | |
| CN115017002B (zh) | 频率预测方法和频率预测装置 | |
| US20200301731A1 (en) | Information Processing Method and Device, Computer Device and Computer Readable Storage Medium | |
| CN115629884A (zh) | 一种线程调度方法、电子设备及存储介质 | |
| CN113495787B (zh) | 资源分配方法、装置、存储介质及电子设备 | |
| CN111813541A (zh) | 一种任务调度方法、装置、介质和设备 | |
| WO2022194190A1 (zh) | 调整触摸手势的识别参数的数值范围的方法和装置 | |
| WO2025044435A1 (zh) | 内存管理方法、电子设备及计算机可读介质 | |
| CN118567800A (zh) | 任务的调度方法、装置、电子设备及可读存储介质 | |
| CN117407133A (zh) | 一种任务处理方法、装置及计算机可读存储介质 | |
| CN108647127A (zh) | 应用耗电监控方法及装置 | |
| CN115525554A (zh) | 模型的自动化测试方法、系统及存储介质 | |
| CN116737352A (zh) | 一种垃圾回收gc的管控方法及终端 | |
| CN116361013A (zh) | 任务处理方法和电子设备 | |
| CN115437776A (zh) | 绘图线程排程方法、装置及计算机设备 | |
| CN115599475A (zh) | 刷新用户界面的方法和电子设备 | |
| CN113760540B (zh) | 一种任务处理方法和相关装置 | |
| CN119248431B (zh) | 任务调度的方法、电子设备及计算机可读存储介质 | |
| CN111382335B (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: 23853975 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2023853975 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2023853975 Country of ref document: EP Effective date: 20250319 |
|
| WWP | Wipo information: published in national office |
Ref document number: 2023853975 Country of ref document: EP |