CN117311918A - Scheduling method, device and system - Google Patents

Scheduling method, device and system Download PDF

Info

Publication number
CN117311918A
CN117311918A CN202210709199.XA CN202210709199A CN117311918A CN 117311918 A CN117311918 A CN 117311918A CN 202210709199 A CN202210709199 A CN 202210709199A CN 117311918 A CN117311918 A CN 117311918A
Authority
CN
China
Prior art keywords
scheduling
bandwidth
value
target
waterline
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210709199.XA
Other languages
Chinese (zh)
Inventor
许轲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210709199.XA priority Critical patent/CN117311918A/en
Publication of CN117311918A publication Critical patent/CN117311918A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

The embodiment of the application discloses a scheduling method, a scheduling device and a scheduling system, and relates to the technical field of computers. The method comprises the following steps: acquiring a target QoS index of a target service; and when the target QoS index meets a preset first scheduling condition, adjusting a bandwidth waterline corresponding to the target QoS index according to a first scheduling strategy, wherein the bandwidth waterline is used for distributing memory bandwidth for the target service. The method is beneficial to more reasonably scheduling the memory bandwidth for the target service under the condition that the hardware is difficult to increase the memory bandwidth, so as to ensure the high-real-time service.

Description

Scheduling method, device and system
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a scheduling method, apparatus, and system.
Background
Currently, computational bottlenecks that affect high real-time traffic (e.g., autopilot traffic) include performance bottlenecks of central processing units (central processing unit, CPUs), neural network processors (natural processing unit, NPUs), and memory bandwidth. The cost of increasing the memory bandwidth is higher, so that the memory bandwidth gradually becomes a main bottleneck affecting the performance of the high-real-time service.
When different service nodes occupy too much memory bandwidth, the preemption of the memory bandwidth by different services is triggered, and the preempted services need to be queued, which can affect the performance of the services, for example, increase the time delay of the services. For high real-time service, the time delay is a very critical index, and the increase of the time delay can affect the safety and the comfort of the high real-time service.
Therefore, how to more reasonably schedule the memory bandwidth for the service under the condition that the hardware is difficult to increase the memory bandwidth, and ensure the service with high real-time performance is still an important problem to be solved.
Disclosure of Invention
The embodiment of the application provides a scheduling method, device and system, which are beneficial to scheduling the memory bandwidth for the service more reasonably under the condition that the hardware is difficult to increase the memory bandwidth, and guaranteeing the high-real-time service.
In a first aspect, embodiments of the present application provide a scheduling method that may be performed by a middleware layer of a computer system that may be running on a processor of the computer system. The method may include: acquiring a target QoS index of a target service; and when the target QoS index meets a preset first scheduling condition, adjusting a bandwidth waterline corresponding to the target QoS index according to a first scheduling strategy, wherein the bandwidth waterline is used for distributing memory bandwidth for the target service.
Through the method, the middleware layer can combine the target QoS index of the target service, flexibly allocate the memory bandwidth for the target service, and help to more reasonably schedule the memory bandwidth for the service under the condition that the hardware is difficult to increase the memory bandwidth, thereby guaranteeing the high real-time service.
With reference to the first aspect, in a possible implementation manner, the method may further include: and determining the reason of the performance degradation of the target service according to the target QoS index of the target service.
By the method, the middleware layer can determine the reasons of the performance degradation of the target service through analysis, for example, determine whether the service performance degradation is caused by memory bandwidth preemption, whether the service performance degradation is caused by thread preemption, and the like, so that the scheduling is performed according to solutions corresponding to practical reasons, and the realization of the target service is ensured.
With reference to the first aspect, in one possible implementation manner, the reasons for the performance degradation of the target service include: bandwidth preemption, the first scheduling condition includes: the value of the target QoS index is greater than a scheduling threshold, and the adjusting the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes: when the first value of the bandwidth waterline is smaller than a first threshold value, the first value of the bandwidth waterline is increased; or when the first value of the bandwidth waterline is equal to the first threshold value, keeping the first value of the bandwidth waterline unchanged and improving the process priority of the target service.
Through the method, the middleware layer can preset the scheduling conditions and the scheduling strategies, determines the satisfied scheduling conditions by analyzing the QoS index values of the target service, and performs scheduling based on the scheduling strategies corresponding to the satisfied scheduling conditions so as to ensure the performance of the target service.
With reference to the first aspect, in one possible implementation manner, the first scheduling policy includes a full fair scheduling CFS policy, and the method further includes: and determining the first process priority of the target service according to the CFS strategy.
Through the method, the middleware layer can also determine the first process priority of the target service by utilizing the CFS strategy so as to schedule the execution time of the process of the target service according to the first process priority, thereby ensuring the instantaneity of the high-instantaneity service.
With reference to the first aspect, in a possible implementation manner, the method for improving the process priority of the target service further includes: determining a second process priority of the target service according to the CFS strategy and an adjustment coefficient, wherein the adjustment coefficient meets the following expression:
wherein w is Q Represents the adjustment coefficient, w i Representing a first process priority, b, of the target traffic i (t) represents CPU time consumption, p of the CPU brought by memory bandwidth preemption i And (t) represents the CPU running time actually occupied by the process of the target service.
Through the method, the middleware layer can also adjust the first process priority of the target service according to the CFS strategy and the adjusting system to obtain the second process priority, so that the execution time of the process of the target service is scheduled by using the adjusted process priority, and the instantaneity of the real-time service is ensured.
With reference to the first aspect, in one possible implementation manner, the first scheduling condition includes: the value of the target QoS index is smaller than a scheduling threshold, and the adjusting the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes: when the first value of the bandwidth waterline is larger than a second threshold value, the first value of the bandwidth waterline is reduced; and when the first value of the bandwidth waterline is equal to the second threshold value, keeping the first value of the bandwidth waterline unchanged.
By the method, the middleware layer can schedule the abundant memory bandwidth of the target service to other services for use by reducing the bandwidth waterline of the target service when the value of the target QoS index is smaller than the scheduling threshold, so that the occupation of unnecessary resources by the target service is reduced, and the CPU resources of the computer system are fully utilized as much as possible.
With reference to the first aspect, in one possible implementation manner, the bandwidth waterline adjusting manner includes a proportional-integral-derivative PID control manner. It should be understood that the adjustment of the bandwidth waterline is merely illustrated herein and not limited in any way, and in other embodiments, the bandwidth waterline may be adjusted in other manners, which will not be described herein.
With reference to the first aspect, in a possible implementation manner, the method further includes: and when the updated value of the target QoS index does not belong to the allowable value range after the first scheduling strategy is adopted for scheduling, changing the first scheduling strategy into a second scheduling strategy, wherein the second scheduling strategy comprises a LinuxRT scheduling strategy.
By the method, the middleware layer can adjust the bandwidth waterline of the target service, and can also adjust the used scheduling strategy so as to achieve the expected service performance as much as possible through changing the scheduling strategy when the expected performance cannot be achieved after the adjustment is performed based on the first scheduling strategy.
With reference to the first aspect, in a possible implementation manner, the second scheduling policy has a lower usage priority than the first scheduling policy.
With reference to the first aspect, in one possible implementation manner, the target QoS index includes any one of the following: delay, jitter, or packet loss rate.
In a second aspect, an embodiment of the present application provides a scheduling apparatus, including: an obtaining unit, configured to obtain a target quality of service QoS indicator of a target service; and the scheduling unit is used for adjusting a bandwidth waterline corresponding to the target QoS index according to a first scheduling strategy when the target QoS index meets a preset first scheduling condition, wherein the bandwidth waterline is used for distributing the memory bandwidth for the target service.
With reference to the second aspect, in a possible implementation manner, the scheduling unit is further configured to: and determining the reason of the performance degradation of the target service according to the target QoS index of the target service.
With reference to the second aspect, in one possible implementation manner, the reasons for the performance degradation of the target service include: memory bandwidth preemption, the first scheduling condition includes: the value of the target QoS index is greater than a scheduling threshold, and the adjusting, by the first scheduling policy, the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes: when the first value of the bandwidth waterline is smaller than a first threshold value, the first value of the bandwidth waterline is increased; and when the first value of the bandwidth waterline is equal to the first threshold value, keeping the first value of the bandwidth waterline unchanged and improving the process priority of the target service.
With reference to the second aspect, in one possible implementation manner, the first scheduling policy includes a complete fair scheduling CFS policy, and the scheduling unit is configured to: and determining the first process priority of the target service according to the CFS strategy.
With reference to the second aspect, in one possible implementation manner, the scheduling unit is configured to: determining a second process priority of the target service according to the CFS strategy and an adjustment coefficient, wherein the adjustment coefficient meets the following expression:
wherein w is Q Represents the adjustment coefficient, w i Representing a first process priority, b, of the target traffic i (t) represents CPU time consumption, p of the CPU brought by memory bandwidth preemption i And (t) represents the CPU running time actually occupied by the process of the target service.
With reference to the second aspect, in one possible implementation manner, the first scheduling condition includes: the value of the target QoS index is smaller than a scheduling threshold, and the adjusting the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes: when the first value of the bandwidth waterline is larger than a second threshold value, the first value of the bandwidth waterline is reduced; and when the first value of the bandwidth waterline is equal to the second threshold value, keeping the first value of the bandwidth waterline unchanged.
With reference to the second aspect, in one possible implementation manner, the adjustment manner of the bandwidth waterline includes a proportional-integral-derivative PID control manner.
With reference to the second aspect, in a possible implementation manner, the scheduling unit is further configured to: and when the updated value of the target QoS index does not belong to the allowable value range after the first scheduling strategy is adopted for scheduling, changing the first scheduling strategy into a second scheduling strategy, wherein the second scheduling strategy comprises a LinuxRT scheduling strategy.
With reference to the second aspect, in a possible implementation manner, a usage priority of the second scheduling policy is lower than a usage priority of the first scheduling policy.
With reference to the second aspect, in one possible implementation manner, the target QoS index includes any one of the following: delay, jitter, or packet loss rate.
In a third aspect, an embodiment of the present application provides a scheduling apparatus, including a middleware layer, where the middleware layer includes a unit for implementing the method according to the first aspect and any possible implementation manner of the first aspect.
With reference to the third aspect, in one possible implementation manner, the scheduling apparatus may further include an APP layer, where the APP layer is located at an upper layer of the middleware layer, and the APP layer is configured to send a target QoS index of a target service to the middleware layer.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: a communication interface for communicating with other devices; a processor coupled with the communication interface to cause the communication device to perform the method as described in the first aspect and any possible implementation of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, which when run on a computer causes the computer to perform the method as described in the first aspect and any possible implementation manner of the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the method as described in the first aspect and any possible implementation manner of the first aspect.
In a seventh aspect, embodiments of the present application provide a chip, including a processor, where the processor is coupled to a memory, and configured to execute a computer program or instructions stored in the memory, where the computer program or instructions, when executed, implement a method as described in the first aspect and any possible implementation manner of the first aspect.
In an eighth aspect, embodiments of the present application provide a vehicle, including an apparatus for implementing the method according to the first aspect and any possible implementation manner of the first aspect.
Further combinations of the present application may be made to provide further implementations based on the implementations provided in the above aspects.
The technical effects that may be achieved by any one of the possible implementation manners of the second aspect to the eighth aspect may be correspondingly described with reference to the technical effects that may be achieved by any one of the possible implementation manners of the first aspect, and the descriptions will not be repeated.
Drawings
FIG. 1 shows a schematic diagram of a computer system architecture of an embodiment of the present application;
FIG. 2 shows a schematic diagram of scheduling principles of an embodiment of the present application;
FIG. 3 shows a flow diagram of a scheduling method of an embodiment of the present application;
FIG. 4 shows a flow diagram of a scheduling method of an embodiment of the present application;
FIG. 5 shows a flow diagram of a scheduling method of an embodiment of the present application;
FIG. 6 shows a schematic diagram of a communication device of an embodiment of the present application;
fig. 7 shows a schematic structural diagram of a communication device according to an embodiment of the present application.
Detailed Description
For ease of understanding, some of the terms referred to in the embodiments of the present application will be first described below.
1. Central processing unit (central processing unit, CPU): is a very large scale integrated circuit, is the operation core and control core of computer, and the CPU function is mainly used for explaining computer instruction and processing data in computer software.
2. Memory bandwidth: the data transfer capability provided by the memory bus depends on the memory chip and the memory module. In general, bandwidth=bus bandwidth×bus frequency×number of packets exchanged in one clock cycle.
3. Middleware (middleware): the lower layer of application software above the operating system, the network and the database has the general function of providing an operating and developing environment for the upper layer of the middleware layer, and helping users flexibly and efficiently develop and integrate complex application programs. Among the numerous definitions for middleware, the internet data center (internet data center, IDC) expression is more commonly accepted: middleware is a separate system software or service by means of which distributed application software shares resources between different technologies, the middleware residing on the operating system of the client server, managing computing resources and network communications.
4. Process (process): the method is a running activity of a program in a computer on a certain data set, is a basic unit for resource allocation and scheduling of a system, and is a basis of an operating system structure. In early process-oriented computer architectures, processes were the basic execution entities of programs. In contemporary thread-oriented computer architectures, the process is a container for the threads. In the embodiment of the application, the program is a description of instructions, data and an organization form thereof, and the process is an entity of the program.
5. Process priority: each process has a corresponding priority that determines when the process is running and how much CPU time is received. A smaller priority value indicates a higher priority of the process.
In some embodiments, processes may be divided into normal processes and real-time processes, and accordingly, the process priority is divided as follows:
(1) Static priority: the method is not changed due to time, the kernel (kernel) is not modified, and only the method area for changing the nice value can be modified through system call, and the value interval is generally [100 139], which corresponds to the common process.
(2) Real-time priority: only has significance to the real-time process, the value interval is [0,99], and the real-time process is corresponding to the value interval;
(3) Dynamic priority: the scheduler schedules the processes by increasing or decreasing the value of the static priority of the process, and the adjusted process priority is called dynamic priority. The value interval is the range [0,139].
It should be noted that this is merely an example of process priority and is not intended to be limiting in any way. In other embodiments, other values may be used to represent the process priority, which is not described herein.
6. Friendly (nice) value: the modified value of the priority with which the process can be executed is typically between [ -20-19 ], and in some embodiments the scheduler may modify the process priority by changing the nice value.
For example, when using CFS algorithm, the PRI represents the process priority, and when the scheduler schedules by nice value, the following is shown:
PRI(new)=PRI(old)+nice;
where PRI (new) represents the process priority of the new (new) after scheduling, PRI (old) represents the process priority of the old (old) before scheduling.
7. Scheduler (or scheduler): is a core part of the operating system. The scheduler may act as an administrator of CPU time, primarily responsible for selecting certain ready processes to execute. Different schedulers select the most suitable process to run according to different methods. Currently, linux supported schedulers include RT schedulers, DL schedulers, CFS schedulers, and the like.
8. Full fair scheduling (complete fair scheduling, CFS): a Linux scheduling algorithm, load process scheduling. After the Linux kernel (kernel) 2.6.23, the CPU resources responsible for the Linux system are allocated to the executing process, with the goal of: maximize program interaction performance and minimize overall CPU utilization.
Typically, the CFS scheduler of the Linux system sets a virtual clock to each process in the run queue (run queue) to record the virtual run time (vruntime) of the process, i.e., the time that the process has run. The magnitude of the virtual running time has a metering calculation relation with the process priority and the actual running time, and the metering calculation relation is shown in the following expression (1):
wherein p is i (t) CPU runtime actually occupied by process, w 0 Weight at nice value of 0, w i For process priority, v i (t) is the virtual run time of the process calculated in the CFS scheduling algorithm.
If a process is put into operation by the CFS scheduler, its virtual run time will increase over time, while the virtual clock of the process that is not being executed will not change. To ensure full fairness, the CFS scheduler ensures that the virtual run times of the processes are the same, and at the same time, processes with different priorities can actually occupy different CPU times according to the different priorities of the processes, and always select the process with the smallest virtual clock to run. In order to distinguish between processes of different priorities, the virtual run time of a process of high priority increases relatively slowly, so that more running opportunities are available.
9. Memory-aware full fair scheduling (memory-aware completely fair scheduler, mCFS): an improved algorithm for CFS scheduling algorithms. CFS schedulers employing mCFS scheduling algorithms may also be referred to as mCFS schedulers.
Generally, with the increase of memory read-write instructions, the CPU time period necessary for the service node itself to calculate will not increase, but the CPU waiting time period due to memory bandwidth preemption will gradually increase.
Aiming at the current memory bandwidth bottleneck problem, in some designs, CPU waiting time brought by the memory bandwidth bottleneck to a service node is considered by modifying a CFS scheduler of the Linux system, and the CPU waiting time is subtracted from the CFS scheduling time to execute mCFS scheduling, so that the mCFS scheduler of the Linux system can truly schedule according to a time slice actually calculated, and the influence of memory bandwidth preemption to the service node is weakened.
Wherein, the mCFS scheduler can calculate the CPU waiting time of the service node due to memory bandwidth preemption, expressed asFor characterising task i from time t 1 To t 2 The superscript m indicates the mCFS scheduling algorithm due to CPU latency caused by memory bandwidth preemption. The mCFS scheduler will add this +. >And feeding back to the actual CPU time scheduler (actualized CPU time calculator) so that the actual CPU time scheduler subtracts the CPU waiting time caused by memory bandwidth preemption from the CPU running time actually occupied by the process, and the calculation formula is shown in the following expression (2):
wherein p is i (t) CPU runtime actually occupied by process, w 0 Weight at nice value of 0, w i For process priority, v im (t) is the virtual run time of the process calculated in the mCFS scheduling algorithm.
However, the mCFS scheduling algorithm indirectly reduces the impact of memory bandwidth preemption by adjusting the process priority, does not reduce the preemption degree of the memory bandwidth, and also increases the duration of the preempted process occupying the CPU. This scheduling method increases the time delay of other nodes, and has a large side effect. In addition, the scheduling mode modifies the kernel scheduling mechanism of the computer system, so that programs originally using the CFS scheduling algorithm are affected, and the flexibility is poor. Therefore, how to more reasonably schedule the memory bandwidth for the service under the condition that the hardware is difficult to increase the memory bandwidth, and ensure the service with high real-time performance is still an important problem to be solved.
The embodiment of the application provides a scheduling method, a scheduling device and a scheduling system, wherein the scheme can allocate memory bandwidth and scheduling process priority for a target service according to target service quality (quality of service, qoS) indexes of the target service, is beneficial to scheduling the memory bandwidth for the service more reasonably under the condition that hardware is difficult to increase the memory bandwidth, and ensures high-real-time service. The method and the device are based on the same technical conception, and because the principle of solving the problems by the method and the device is similar, the implementation of the device and the method can be mutually referred to, and the repeated parts are not repeated.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a and b, a and c, b and c, or a and b and c, wherein a, b, c may be single or plural.
And, unless otherwise specified, ordinal terms such as "first," "second," "third," etc., in the embodiments of the present application are used for distinguishing a plurality of objects, and are not used for limiting the priority or importance of the plurality of objects. For example, the first device, the second device, and the third device are only for distinguishing between different devices, and are not intended to represent differences in priority or importance of the three devices.
The scheduling scheme of the embodiment of the application can be applied to a computer system scene which provides high real-time service and has difficult increase of memory bandwidth, for example, a middleware layer of an autopilot domain controller/mobile data center (mobile data center, MDC) is used for realizing autopilot service, and the embodiment of the application does not limit the scene specifically. For easy understanding, the following describes the scheduling schemes of the embodiments of the present application with reference to the drawings and embodiments, taking the autopilot service as a target service.
FIG. 1 shows a schematic diagram of a computer system architecture of an embodiment of the present application.
As shown in fig. 1, a computer system for implementing the scheduling method of the embodiment of the present application may be logically divided into 4 levels as a whole, such as a hardware (hardware) layer, an Operating System (OS) layer, a middleware (middleware) layer, and an Application (APP) layer.
The hardware layer is located at the bottom layer and may include, for example, a CPU, an artificial intelligence computing core (artificial intelligence core, AIC), a digital visual preprocessor (digital video pre-processor, DVPP), an image signal processor (image signal processor, ISP), a memory (memory), a memory controller (memory controller), and the like.
Among other things, CPU, AIC, DVPP, ISP can be used to provide computing power support for services that can be implemented by a computer system. For example, a CPU is a final execution unit for information processing and program execution as an operation and control core of a computer system. AIC, DVPP, ISP is an AI chip for handling the massive parallel computing demands of algorithms such as context awareness (persistence), sensor fusion (fusion) and path planning and control (planning and control) involved in autopilot traffic. The memory is also called an internal memory, and is used for temporarily storing operation data in the CPU (or other hardware) and data exchanged with an external memory such as a hard disk, and is a bridge for communicating with the CPU and the like from the outside. The memory controller is an important component for controlling the memory inside the computer system and responsible for data exchange between the memory and the CPU, and is used for determining important parameters such as the maximum memory capacity, the memory BANK number, the memory type and speed, the memory granule data depth and the data width, and the like which can be used by the computer system, and the memory controller determines the memory performance of the computer system, so that the overall performance of the computer system is also greatly influenced.
It should be understood that fig. 1 is only an illustration of functional modules of a hardware layer of a computer system, and not any limitation, and in other embodiments, the hardware layer may further include other hardware modules, which are not shown, such as a graphics processor (graphics processing unit, GPU), and will not be described herein.
The OS layer is located at an upper layer of the hardware layer and may include functional modules corresponding to computer programs that manage hardware and software resources of the computer system. Such as CFS schedulers (schedulers), qoS schedulers, performance monitoring unit (performance monitoring units, PMU) driven (driver) programs, etc. The CFS scheduler supports a CFS scheduling algorithm of Linux specifications and is compatible with the scheduling method of the embodiment of the application. The QoS scheduler supports the configuration of QoS parameters for different traffic and the scheduling method adapted to different QoS indicators. The PMU driver may collect various statistical information about the CPU (or other hardware) and memory, including but not limited to counting how long the CPU waits to preempt, etc., in order to monitor the performance of the computer system.
The middleware layer is positioned at the upper layer of the OS layer and the lower layer of the APP layer, can provide shared resources for different technologies of the APP layer and the OS layer, and assists in realizing corresponding services or functions. For example, the middleware layer may include a priority controller (priority controller), a quality of service controller (QoS controller). The priority controller can be used for carrying out decision control on the process priority of the target service of the APP layer, and carrying out parameter configuration on the new process priority after the scheduling of the target service through the CFS scheduler of the OS layer. The QoS controller can be used for carrying out decision control on the QoS index of the target service of the APP layer, and configuring the QoS parameters of the target service after scheduling through the QoS scheduler of the OS layer.
Specifically, as shown in fig. 2, if the performance of the target service is reduced, the QoS controller may receive the target QoS index of the target service from the APP layer, and perform performance analysis on the target service provided by the APP layer by using the target QoS index and the statistical information collected by the PMU driver, to determine the cause of the performance reduction of the target service. The reason for the performance degradation of the target service is as follows:
(1) if the thread preemption causes the performance of the target service to be reduced, the priority controller can be utilized to adjust the process priority of the target service.
(2) If the performance of the target service is reduced due to the preemption of the memory bandwidth, the QoS controller can adjust the bandwidth waterline corresponding to the target QoS index of the target service through the QoS scheduler of the OS layer so as to adjust the memory bandwidth allocated for the target service. If the performance of the target service can reach the expected value after the bandwidth waterline is adjusted (for example, the updated value of the target QoS index belongs to the allowed value range, the explanation of "reach the expected" in the following embodiment may refer to the explanation herein, which is not repeated herein), the scheduling process may be ended. The QoS controller may also adjust the process priority of the target traffic through the CFS scheduler of the OS layer if the performance of the target traffic still fails to meet expectations after the bandwidth waterline is adjusted.
(3) If the performance degradation of the target service is caused by the thread preemption and the memory bandwidth preemption, the QoS controller can simultaneously adopt the processing methods of the (1) aspect and the (2) aspect to jointly adjust the bandwidth waterline corresponding to the target QoS index of the target service and the process priority of the target service, so that the performance of the target service reaches the expected after adjustment.
In addition, if the performance of the target service is stable, the QoS controller may also receive the target QoS index of the target service from the APP layer, and perform performance analysis on the target service provided by the APP layer by using the target QoS index and the statistical information collected by the PMU driver, to determine whether the resources allocated for the target service are sufficient. For example, taking a memory bandwidth resource as an example, if the value of the target QoS index of the target service is smaller than the scheduling threshold and the current first value of the bandwidth waterline of the target service is not the minimum value, which indicates that the memory bandwidth resource of the target service is sufficient, the QoS controller may further reduce the first value of the bandwidth waterline corresponding to the target QoS index of the target service, so as to schedule the unused memory bandwidth resource of the target service for other service use, so as to reserve more sufficient bandwidth resources for other services. The details of the method flow chart will be described in the following, and are not repeated here.
The APP layer is located at the upper layer of the middleware layer, and can run a plurality of application programs to provide various services for users. For example, in a smart car scenario, the APP layer may include an application for implementing an autopilot service, which may be used to provide context awareness services, sensor fusion services, and path planning and control services for the vehicle, among others. It should be understood that, in practical applications, related services related to the autopilot service may be implemented by different subroutines of the same application program, or may be implemented by different application programs, which is not limited in this embodiment of the present application. The APP layer may also include a performance calculator (performance calculator) that may monitor relevant metrics, such as QoS metrics, for each service during the running of the APP layer's application. The performance calculator can send the monitored relevant indexes to the middleware layer in real time, periodically or in response to relevant instructions from the middleware layer, so that corresponding functional modules of the middleware layer manage computing resources and network communication between the APP layer and the OS layer according to the received data to realize performance optimization of target service.
It should be noted that, fig. 1 is only an example of an autopilot service, and is not intended to be limiting, and in other scenarios, the computer system may further include other services, and accordingly, the APP layer, the middleware layer, the OS layer, and the hardware layer of the computer system may further include other modules not shown, which are not described herein.
Fig. 3 shows a flow chart of a scheduling method according to an embodiment of the present application. Wherein the method may be performed by the relevant functional blocks of the middleware layer shown in fig. 1. As shown in fig. 3, the scheduling method may include the steps of:
s310: the middleware layer obtains a target QoS index of a target service.
In the embodiment of the application, the target service includes at least one service that can be provided by the computer system, for example, an automatic driving service. QoS metrics are one of the bases for evaluating the performance of a target service and may include, but are not limited to, delay, jitter, or packet loss rate. The target QoS index may include any of delay, jitter, or packet loss rate.
In an alternative embodiment, the target QoS index of the target traffic may be sent by the performance calculator of the APP layer to the QoS controller of the middleware layer.
For example, the performance calculator of the APP layer may monitor the performance of each service of the APP layer in real time, and when it is detected that the performance of the target service is stable or the related QoS index is normal, the bandwidth waterline corresponding to the target service may stay at a default value without any adjustment action, and the performance calculator may continue to monitor the performance of the target service without sending the target QoS index of the target service to the middleware layer.
For another example, when the performance calculator of the APP layer detects that the performance of the target service is reduced or the related QoS index is greater than the corresponding scheduling threshold, it is determined that the bandwidth waterline corresponding to the target QoS index or the process priority of the target service needs to be adjusted.
It should be noted that this is merely an example, and not any limitation, of the timing of transmitting the target QoS index of the target traffic between the APP layer and the middleware layer. In other embodiments, the performance calculator may send the monitored value of the relevant index to the QoS controller of the middleware layer in real time, periodically or in response to an acquisition instruction from the middleware layer, which in the embodiments of the present application does not limit the transmission timing and transmission manner of the target QoS index. It should be understood that, when implementing S310, the middleware layer may perform parallel computation, and the obtained target QoS index is not limited to one item, but is not limited to a QoS index of a service, which is not described herein.
S320: and when the target QoS index meets a preset first scheduling condition, the middleware layer adjusts a bandwidth waterline corresponding to the target QoS index according to a first scheduling strategy.
In the embodiment of the present application, the bandwidth waterline corresponding to the target QoS index is used to allocate the memory bandwidth for the target service. In general, the computer system may preset a default bandwidth watermark for various services, where the default bandwidth watermark may have a value greater than or equal to a minimum value of the configurable bandwidth watermark and less than or equal to a maximum value of the configurable bandwidth watermark. The bandwidth waterline is dynamically adjustable, with an adjustment interval between an allowable maximum and minimum.
In this embodiment, the bandwidth waterline corresponding to the target QoS index is positively related to the memory bandwidth allocated for the target service, and the computer system may, for example, be configured to: reasons for performance degradation of the target traffic include memory bandwidth preemption. The first scheduling condition may include: the value of the target QoS index is greater than a scheduling threshold, and the first scheduling policy may include: when the first value of the bandwidth waterline is smaller than a first threshold value, the first value of the bandwidth waterline is increased; or when the first value of the bandwidth waterline is equal to the first threshold value, keeping the first value of the bandwidth waterline unchanged and improving the process priority of the target service. The first threshold value may be less than or equal to a maximum value of the bandwidth waterline allowed to be configured. In implementing S320, the middleware layer may decide how to execute the first scheduling policy according to whether the target QoS index satisfies the first scheduling condition.
Before S320 is implemented, the middleware layer may determine a cause of performance degradation of the target service according to the target QoS index of the target service. If the performance of the target service is reduced due to the memory bandwidth preemption, according to the first scheduling policy, on the one hand, if the first value (which may be a default configured value or an up-regulated value) of the bandwidth waterline corresponding to the target QoS index is lower, for example, is smaller than the first threshold value, the middleware layer may increase the first value of the bandwidth waterline corresponding to the target QoS index and change the first value to the second value. Accordingly, the memory bandwidth resources allocated to the target service according to the second value of the bandwidth waterline will be improved, and sufficient memory bandwidth resources can be reserved for the target service. On the other hand, when the first value of the bandwidth watermark corresponding to the target QoS index is equal to the first threshold value, which indicates that more memory bandwidth cannot be allocated to the target service by adjusting the first value of the bandwidth watermark, other scheduling approaches need to be searched, for example, the first value of the bandwidth watermark is kept unchanged, and the process priority of the target service is improved.
And for the case when the performance of the target service is stable, the preset first scheduling condition may include: the value of the target QoS index is less than a scheduling threshold, and the first scheduling policy may include: when the first value of the bandwidth waterline is larger than a second threshold value, the first value of the bandwidth waterline is reduced; or when the first value of the bandwidth waterline is equal to the second threshold value, keeping the first value of the bandwidth waterline unchanged. That is, when the performance of the target service is stable, the middleware layer can decide whether to keep the first value of the bandwidth waterline unchanged or reduce the first value according to the specific value of the bandwidth waterline, so as to perform comprehensive scheduling of memory bandwidth resources among different services, schedule the memory bandwidth resources which cannot be used by the target service to other services, and reserve sufficient memory bandwidth resources for other services, thereby fully utilizing the memory bandwidth resources of the computer system.
Taking the target QoS index as an example of time delay, the middleware layer may perform performance analysis on the target service provided by the APP layer by using the target QoS index of the target service from the APP layer and the statistical information collected by the PMU driver, to determine the cause of performance degradation of the target service.
Taking an example of an ARM chip in a computer system, the statistical information collected by the PMU driver may correspond to an ARM PMU event list, which may be used to detect the length of a CPU stall period caused by memory bandwidth preemption, so that the middleware layer determines whether a performance degradation of the target service caused by the memory bandwidth preemption occurs.
The current ARM PMU event node is shown in Table 1 below:
TABLE 1
Event numbering Name of the name Description of the invention
0x0011 CPU_CYCLES CPU cycle
0x0023 STALL_FRONTEND Front-end stall CPU cycles
0x0024 STALL_BACKEND Back end stall CPU cycles
Table 2 shows a list of events associated with CPU stall cycles associated with memory bandwidth preemption. The basic expression (3) of the back-end stall CPU cycle is as follows:
in the above expression (3), b i (t 1 ,t 2 ) For counting the obtained value of STALL_BACKEND in Table 1 above, the value of STALL_BACKEND contains two parts, one is the program's own STALL period The other is the pause period caused by memory bandwidth preemption +.>The dwell period of the program itself can be estimated by the following expression (4): />
Wherein f represents the frequency of the chip,representing the coefficient, T s Represents a scheduling interval of the operating system, and k represents the number of scheduling times.
Using table 1 above, inUnder the condition that the size of the memory bandwidth is known, the size of the memory bandwidth preemption can be obtained. According to the size of the memory bandwidth preemption determined by calculation, the middleware layer can know whether the performance of the target service is reduced due to the memory bandwidth preemption. If so, the middleware layer may further adjust the bandwidth waterline corresponding to the target QoS index according to the flowchart shown in fig. 4. If not, e.g., thread preemption, the middleware layer may adjust the process priority of the target traffic according to the flow chart shown in fig. 5, referring to the scheduling principle shown in fig. 2.
For the degradation of the target service performance caused by the memory bandwidth preemption, as shown in fig. 4, the first threshold may be less than or equal to the maximum value of the bandwidth waterline allowed to be adjusted, and the second threshold may be greater than or equal to the minimum value of the bandwidth waterline allowed to be adjusted, where the first threshold is used as the adjustable lower limit of the bandwidth waterline. If the target QoS is the delay, when the value of the delay is smaller than the corresponding scheduling threshold, if the first value of the bandwidth waterline corresponding to the delay is the first threshold, the service performance is reduced due to normal delay or no QoS of the target service, the first value of the bandwidth waterline corresponding to the delay can be kept unchanged at the first threshold (i.e. the default state is kept), any adjustment action is not required to be performed on the first value of the bandwidth waterline, and the performance calculator of the APP layer can continuously monitor the service performance. If the first value of the bandwidth waterline of the delay is greater than the second threshold value, the middleware layer can reduce the first value of the bandwidth waterline through a QoS scheduler of the OS layer according to the first scheduling strategy, so that memory bandwidth resources which are not used by the target service are scheduled to other services for use, and sufficient memory bandwidth resources are reserved for other services. Subsequently, the performance calculator of the APP layer may still continue to monitor the performance of the target service.
And when the value of the time delay is larger than the corresponding scheduling threshold value, if the first value of the bandwidth waterline corresponding to the time delay is not smaller than the first threshold value, the middleware layer can allocate more memory bandwidth resources for the target service by improving the first value of the bandwidth waterline through the QoS scheduler of the OS layer according to the corresponding scheduling strategy, so that the memory bandwidth resources which can be occupied by the service flow are improved, the influence caused by memory bandwidth preemption is reduced, and the realization of the target service is ensured. Subsequently, the performance calculator of the APP layer may still continue to monitor the performance of the target traffic to determine whether the performance of the target traffic can be expected by adjusting the bandwidth watermark. If the first value of the bandwidth waterline corresponding to the time delay is equal to the first threshold value, the middleware layer cannot improve the performance of the target service by adjusting the first value of the bandwidth waterline, and the middleware layer can adjust the process priority of the target service through the CFS scheduler of the OS layer, so that the CPU occupation time is reduced, and the service time delay is reduced.
Therefore, the method embodiment can improve the performance problem caused by memory bandwidth preemption by combining the QoS index and directly modifying the QoS parameter, thereby effectively reducing the condition of CPU invalid occupation caused by waiting for the memory bandwidth preemption of a service node (such as an application program for realizing the service).
In this embodiment of the present application, the adjustment manner of the bandwidth waterline may include a conventional proportional-integral-derivative (PID) control manner, or an expert experience is used to adjust the bandwidth waterline by using a fuzzy control manner, which is not limited in this embodiment of the present application.
Taking a PID control method as an example, the PID control method may employ the following expression (5):
wherein e represents error, K p 、K i 、K d The proportional, integral and derivative parameters, u (t) represents the adjustment amount (i.e., the adjustment amplitude of each time).
Assuming that the delay target is 200ms, the actual measured delay is 300ms for the previous frame and 320ms for the current frame, the error is 100 ms and 120ms respectively, the integral value of the two frames is 220ms, the differential value of the error is 20ms, and the error is substituted into the expression (5) to obtain the adjustment value u (t) =k p 120+K i 220+K d 20. Assuming that the upper limit of the adjustable memory bandwidth is 100GB/s, the parameter K p 、K i 、K d And the adjustment value of the waterline of the current lifting band is 3.6GB/s. The actual parameters need to be determined experimentally. After the first value of the bandwidth waterline is raised, the expected end-to-end delay performance is reduced, and finally, the first value of the bandwidth waterline is not raised any more when the delay target is reached. When the first value of the bandwidth waterline is increased to 100GB/s, if the delay performance of the target service does not reach the delay target at this time, the middleware layer can further adjust the process priority of the target service so as to expect the delay performance to reach the delay target.
As shown in fig. 5, when confirming that the process priority of the target service needs to be adjusted, the QoS controller of the middleware layer triggers a corresponding request, so as to enter the next process flow of adjusting the process priority, thereby improving the performance of the target service. In this case, the QoS controller may first calculate/measure the size of memory bandwidth preemption based on the PMU driver tool and then adjust the process priority of the targeted traffic based on the size of memory bandwidth preemption.
In one example, the preset first scheduling policy may include a completely fair scheduling CFS policy, and according to the CFS policy, the adjustment manner of the process priority may include the following two examples:
example 1: according to the CFS strategy, determining the first process priority of the target service through a CFS scheduler.
The first process priority may be substituted into the aforementioned expression (1) so that the CFS scheduler may determine the CPU time actually occupied by the process of the target service based on the first process priority, completing the scheduling. Details regarding this may be found in the foregoing description and CFS strategy, and are not described in detail herein.
Example 2: and determining the second process priority of the target service according to the CFS strategy and the adjustment coefficient.
Wherein, it is assumed that the process priority is adjusted from the middleware level, so that at least the same effect as the mCFS scheduling algorithm is achieved at the adjustment granularity of the process priority, the following is expressed:
the method can make:
v im (t)=v iQ (t) (7)
substituting expression (2) and expression (6) into expression (7) yields the following expression (8):
the method can obtain:
wherein w is Q Represents the adjustment coefficient, w i Representing a first process priority of a target service, b i (t) represents CPU time consumption, p, due to memory bandwidth preemption i And (t) represents the CPU running time actually occupied by the process of the target service.
After the process priority of the target service is adjusted by adopting the first scheduling policy, the target QoS index of the target service can be continuously monitored, whether the target QoS index reaches the expectation or not is judged, and if so, the process priority adjustment process can be ended. If not, the middleware layer may further determine whether the scheduling policy can be changed, e.g., change the first scheduling policy to the second scheduling policy. If so, the middleware layer can change the first scheduling strategy into a second scheduling strategy, and further adjust the process priority of the target service according to the second scheduling strategy. If not, returning an optimization failure alarm to the APP layer. After further optimization according to the second scheduling policy, it is again determined whether the target QoS index reaches the expectations, and if so, the adjustment process may be ended. If not, the middleware layer returns an optimization failure alarm to the APP layer.
In this embodiment of the present application, the second scheduling policy may use a Linux real-time scheduling (real time scheduler, RT) policy, for example, including a Round Robin (RR) scheduling policy and a first-in first-out (first in first out, FIFO) scheduling policy, which may provide a higher scheduling priority for real-time tasks.
In an alternative embodiment, the middleware layer may be configured to modify the scheduling policy as shown in table 2 below:
TABLE 2
Usage priority Description of the invention
High height Allowing only CFS scheduling policies
In (a) Upgradeable to LinuxRT scheduling policy
Low and low Upgradeable to Xenomai scheduling policies
The use priority of the CFS scheduling policy is highest, and the middleware layer may adjust the process priority of the target service by using the CFS scheduling policy according to the description of the foregoing embodiment. When the target QoS index still cannot reach the expected value after adjustment, a scheduling policy for upgrading the target service, for example, a LinuxRT scheduling policy shown in table 2, may be determined according to a preset modification mode or a manual modification mode. If the linux rt scheduling policy still cannot enable the target QoS index to reach the expected value, the Xenomai scheduling policy can be used as an upgradeable real-time patch of the linux rt scheduling policy, and a special real-time kernel can provide stronger real-time scheduling capability.
It should be noted that, in the embodiment of the present application, only the LinuxRT scheduling policy and the Xenomai scheduling policy are described as examples of optional upgrade policies of the CFS scheduling policy, so as to provide a higher scheduling priority for the target service, and it is not limited whether the adopted scheduling policy is the LinuxRT scheduling policy or the Xenomai scheduling policy. And, the Xenomai scheduling policy is merely a name example of a scalable real-time patch package for the Linux RT scheduling policy, and is not limited to specific implementation details of the scheduling policy. In other words, any scheduling policy that can upgrade the CFS scheduling policy and the LinuxRT scheduling policy of the embodiments of the present application to provide a computer system with a stronger scheduling capability may be applied to the embodiments of the present application.
Therefore, through the embodiment, the middleware layer not only can improve the memory bandwidth occupied by the target service by directly modifying the bandwidth waterline corresponding to the QoS parameter, but also can reduce the ineffective occupation of the CPU caused by waiting for the memory bandwidth preemption of the service node of the target service. When the performance of the target service can not be improved after the first value of the bandwidth waterline is adjusted, the CPU occupation time of the service process can be continuously optimized by compensating the process priority of the target service. When the above adjustment cannot meet the requirement of the target QoS index of the target service, the process priority of the target service can be further optimized by further changing the scheduling strategy, so as to reduce the preemption of other services to the memory bandwidth of the target service.
It should be noted that, the above method embodiment is described taking time delay as a target QoS index as an example, when the target QoS index is replaced by other QoS indexes, for example, jitter, packet loss rate, and the like, the above method embodiment may also be adopted to adjust the value of the bandwidth waterline corresponding to the indexes, such as jitter, packet loss rate, and the like, or adjust the process priority of the target service, so as to optimize the CPU resource of the computer system and enhance the stability of the computer system. Details of the related implementations may be found in the related descriptions above, and are not described herein.
The embodiment of the present application further provides a communication device, which is configured to execute the method executed by the middleware layer in the above embodiment of the method, and related features may be referred to the above embodiment of the method, which is not described herein again.
As shown in fig. 6, in one example, the apparatus 600 may be a scheduling apparatus, including: an obtaining unit 601, configured to obtain a target quality of service QoS indicator of a target service; and the scheduling unit 602 is configured to adjust, according to a first scheduling policy, a bandwidth waterline corresponding to the target QoS index when the target QoS index meets a preset first scheduling condition, where the bandwidth waterline is used to allocate a memory bandwidth for the target service. For specific implementation, please refer to the detailed description in the embodiments shown in fig. 1 to 5, and the detailed description is omitted here.
It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice. The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or contributing part or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, random access memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In one possible implementation, the present application provides a computer-readable storage medium storing program code that, when executed on the computer, causes the computer to perform the above-described method embodiments.
In one possible implementation, the present application provides a computer program product, which when run on a computer causes the computer to perform the above-described method embodiments.
In a simple embodiment, a person skilled in the art will appreciate that the communication device in the above embodiment may take the form shown in fig. 7.
The apparatus 700, as shown in fig. 7, includes at least one processor 710 and a communication interface 730. In an alternative design, memory 720 may also be included.
The specific connection medium between the processor 710 and the memory 720 is not limited in the embodiments of the present application.
In the apparatus of fig. 7, processor 710 may communicate with other devices via communication interface 730 for data transmission.
When the communications device takes the form shown in fig. 7, the processor 710 of fig. 7 may cause the device 700 to perform any of the method embodiments described above by invoking computer-executable instructions stored in the memory 720.
The embodiments of the present application also relate to a chip system including a processor for invoking a computer program or computer instructions stored in a memory to cause the processor to perform the method of any of the embodiments described above.
In one possible implementation, the processor may be coupled with the memory through an interface.
In one possible implementation, the system on a chip may also directly include a memory having a computer program or computer instructions stored therein.
By way of example, the memory may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
The embodiments of the present application also relate to a processor for invoking a computer program or computer instructions stored in a memory to cause the processor to perform the method according to any of the embodiments described above.
Illustratively, in an embodiment of the present application, the processor is an integrated circuit chip having signal processing capabilities. For example, the processor may be a field programmable gate array (field programmable gate array, FPGA), a general purpose processor, a digital signal processor (digital signal processor, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, a system on chip (SoC), a central processing unit (central processor unit, CPU), a network processor (network processor, NP), a microcontroller (micro controller unit, MCU), a programmable controller (programmable logic device, PLD) or other integrated chip, may implement or perform the methods, steps and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
It should be appreciated that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to encompass such modifications and variations.

Claims (27)

1. A scheduling method, comprising:
acquiring a target QoS index of a target service;
and when the target QoS index meets a preset first scheduling condition, adjusting a bandwidth waterline corresponding to the target QoS index according to a first scheduling strategy, wherein the bandwidth waterline is used for distributing memory bandwidth for the target service.
2. The method according to claim 1, wherein the method further comprises:
and determining the reason of the performance degradation of the target service according to the target QoS index of the target service.
3. The method of claim 2, wherein the cause of the performance degradation of the target service comprises: memory bandwidth preemption, the first scheduling condition includes: the value of the target QoS index is greater than a scheduling threshold, and the adjusting the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes:
When the first value of the bandwidth waterline is smaller than a first threshold value, the first value of the bandwidth waterline is increased; or,
and when the first value of the bandwidth waterline is equal to the first threshold value, keeping the first value of the bandwidth waterline unchanged and improving the process priority of the target service.
4. The method of claim 3, wherein the first scheduling policy comprises a full fair scheduling CFS policy, and wherein the increasing the process priority of the target traffic comprises:
and determining the first process priority of the target service according to the CFS strategy.
5. The method of claim 4, wherein said increasing the process priority of the target traffic further comprises:
determining a second process priority of the target service according to the CFS strategy and an adjustment coefficient, wherein the adjustment coefficient meets the following expression:
wherein w is Q Represents the adjustment coefficient, w i Representing a first process priority, b, of the target traffic i (t) represents CPU time consumption, p of the CPU brought by memory bandwidth preemption i And (t) represents the CPU running time actually occupied by the process of the target service.
6. The method of claim 1, wherein the first scheduling condition comprises: the value of the target QoS index is smaller than a scheduling threshold, and the adjusting the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes:
When the first value of the bandwidth waterline is larger than a second threshold value, the first value of the bandwidth waterline is reduced; or,
and when the first value of the bandwidth waterline is equal to the second threshold value, keeping the first value of the bandwidth waterline unchanged.
7. The method of any of claims 1-6, wherein the bandwidth waterline adjustment mode comprises a proportional-integral-derivative PID control mode.
8. The method according to any one of claims 1-7, further comprising:
and when the updated value of the target QoS index does not belong to the allowable value range after the first scheduling strategy is adopted for scheduling, changing the first scheduling strategy into a second scheduling strategy, wherein the second scheduling strategy comprises a LinuxRT scheduling strategy.
9. The method of claim 8, wherein the second scheduling policy has a lower priority of use than the first scheduling policy.
10. The method according to any of claims 1-9, wherein the target QoS index comprises any of: delay, jitter, or packet loss rate.
11. A scheduling apparatus, comprising:
An obtaining unit, configured to obtain a target quality of service QoS indicator of a target service;
and the scheduling unit is used for adjusting a bandwidth waterline corresponding to the target QoS index according to a first scheduling strategy when the target QoS index meets a preset first scheduling condition, wherein the bandwidth waterline is used for distributing the memory bandwidth for the target service.
12. The apparatus of claim 11, wherein the scheduling unit is further configured to:
and determining the reason of the performance degradation of the target service according to the target QoS index of the target service.
13. The apparatus of claim 12, wherein the cause of the performance degradation of the target service comprises: memory bandwidth preemption, the first scheduling condition includes: the value of the target QoS index is greater than a scheduling threshold, and the adjusting, by the first scheduling policy, the bandwidth waterline corresponding to the target QoS index according to the first scheduling policy includes:
when the first value of the bandwidth waterline is smaller than a first threshold value, the first value of the bandwidth waterline is increased; or,
and when the first value of the bandwidth waterline is equal to the first threshold value, keeping the first value of the bandwidth waterline unchanged and improving the process priority of the target service.
14. The apparatus of claim 13, wherein the first scheduling policy comprises a full fair scheduling, CFS, policy, the scheduling unit to:
and determining the first process priority of the target service according to the CFS strategy.
15. The apparatus of claim 14, wherein the scheduling unit is configured to:
determining a second process priority of the target service according to the CFS strategy and an adjustment coefficient, wherein the adjustment coefficient meets the following expression:
wherein w is Q Represents the adjustment coefficient, w i Representing a first process priority, b, of the target traffic i (t) represents CPU time consumption, p of the CPU brought by memory bandwidth preemption i And (t) represents the CPU running time actually occupied by the process of the target service.
16. The apparatus of claim 11, wherein the first scheduling condition comprises: the value of the target QoS index is smaller than a scheduling threshold, and the first scheduling policy includes:
when the first value of the bandwidth waterline is larger than a second threshold value, the first value of the bandwidth waterline is reduced;
and when the first value of the bandwidth waterline is equal to the second threshold value, keeping the first value of the bandwidth waterline unchanged.
17. The apparatus of any of claims 11-16, wherein the bandwidth waterline adjustment means comprises a proportional-integral-derivative PID control means.
18. The apparatus according to any of claims 11-17, wherein the scheduling unit is further configured to:
and when the updated value of the target QoS index does not belong to the allowable value range after the first scheduling strategy is adopted for scheduling, changing the first scheduling strategy into a second scheduling strategy, wherein the second scheduling strategy comprises a LinuxRT scheduling strategy.
19. The apparatus of claim 18, wherein the second scheduling policy has a lower priority of use than the first scheduling policy.
20. The apparatus according to any of claims 11-19, wherein the target QoS index comprises any of: delay, jitter, or packet loss rate.
21. A communication device comprising a middleware layer comprising means for implementing the method of any of claims 1-10.
22. The apparatus of claim 21, further comprising an APP layer, the APP layer being located at an upper layer of the middleware layer, the APP layer configured to send a target QoS indicator of a target service to the middleware layer.
23. An electronic device, comprising:
a communication interface for communicating with other devices;
a processor coupled to the communication interface to cause the communication device to perform the method of any of claims 1-10.
24. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when run on a computer, causes the computer to perform the method according to any one of claims 1-10.
25. A computer program product, characterized in that the computer program product comprises a computer program which, when run on a computer, causes the computer to perform the method according to any of claims 1-10.
26. A chip comprising a processor coupled to a memory for executing a computer program or instructions stored in the memory, which when executed, implements the method of any of claims 1-10.
27. A vehicle comprising means for implementing the method of any one of claims 1-10.
CN202210709199.XA 2022-06-21 2022-06-21 Scheduling method, device and system Pending CN117311918A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210709199.XA CN117311918A (en) 2022-06-21 2022-06-21 Scheduling method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210709199.XA CN117311918A (en) 2022-06-21 2022-06-21 Scheduling method, device and system

Publications (1)

Publication Number Publication Date
CN117311918A true CN117311918A (en) 2023-12-29

Family

ID=89272483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210709199.XA Pending CN117311918A (en) 2022-06-21 2022-06-21 Scheduling method, device and system

Country Status (1)

Country Link
CN (1) CN117311918A (en)

Similar Documents

Publication Publication Date Title
WO2021233261A1 (en) Multi-task dynamic resource scheduling method
CN112162865B (en) Scheduling method and device of server and server
US8245232B2 (en) Software-configurable and stall-time fair memory access scheduling mechanism for shared memory systems
JP2940450B2 (en) Job scheduling method and apparatus for cluster type computer
CN109542603B (en) Multidimensional resource isolation system for improving isolation between tasks with different priorities
CN109697122B (en) Task processing method, device and computer storage medium
CN107145388B (en) Task scheduling method and system under multi-task environment
US11876731B2 (en) System and methods for sharing memory subsystem resources among datacenter applications
US20230229495A1 (en) Task scheduling method and apparatus
US9244733B2 (en) Apparatus and method for scheduling kernel execution order
WO2014155200A2 (en) Systems and methods for self-adaptive distributed systems
US20220195434A1 (en) Oversubscription scheduling
CN111488210B (en) Task scheduling method and device based on cloud computing and computer equipment
CN109117279B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
Yang et al. Performance-aware speculative resource oversubscription for large-scale clusters
CN110099083A (en) A kind of load equilibration scheduling method and device for server cluster
CN109039929A (en) Business scheduling method and device
CN110546612A (en) Directed optimized resource scheduling
CN109729113B (en) Method, server system and computer program product for managing dedicated processing resources
AU2007261607A2 (en) Resource-based scheduler
CN112925616A (en) Task allocation method and device, storage medium and electronic equipment
CN112506808B (en) Test task execution method, computing device, computing system and storage medium
CN116820784B (en) GPU real-time scheduling method and system for reasoning task QoS
CN117311918A (en) Scheduling method, device and system
CN107193631B (en) A kind of virtual time piece dispatching method and system based on the detection of Parallel application stage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication