A task scheduling method, device and related equipment
Patent Information
- Application Number
- CN202611070951.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-11-03
AI Technical Summary
In a multi-core processor environment, existing technologies struggle to effectively schedule virtual processor threads in virtual machines, leading to decreased system performance and resource contention, and failing to guarantee the rationality and fairness of system operation.
By running tests on the target processor under super-resolution configuration, scheduling performance data is collected, a performance scheduling model is constructed, the performance change pattern of virtual machines is quantified, and the target super-resolution ratio corresponding to the target performance retention rate and the target average load is determined to optimize task scheduling.
This improved the accuracy of super-resolution ratio calculation, optimized system performance, and ensured the rationality and fairness of system operation.
Smart Images

Figure CN123030288A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a task scheduling method, apparatus, and related equipment. Background Technology
[0002] With the rapid development of information technology, the Linux operating system is widely used in servers, embedded devices, and high-performance computers. Moreover, in multi-core processor environments, in order to improve the overall utilization of hardware resources and facilitate the isolated operation of different workloads, virtualization technology can be used to divide the physical host into multiple virtual machines (VMs), with each VM sharing the underlying hardware resources.
[0003] However, task scheduling in a multi-core processor environment is complex because multiple processor cores share physical resources, and virtual processor (vCPU) threads from multiple virtual machines also compete for physical core resources. Therefore, how to perform task scheduling on multi-core processors to ensure the rationality and fairness of system operation and optimize system performance has become a pressing technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, embodiments of this application provide a task scheduling method, apparatus, and related equipment to achieve task scheduling for multi-core processors, ensure the rationality and fairness of system operation, and optimize system performance.
[0005] To achieve the above objectives, the embodiments of this application provide the following technical solutions.
[0006] In a first aspect, embodiments of this application provide a task scheduling method, including: Under super-resolution configuration, the target processor is tested and its scheduling performance data is collected; wherein the target processor includes multiple processor cores, and the processor cores are loaded with virtual processor threads of virtual machines; Based on the scheduling performance data, a performance scheduling model is constructed, which reflects the performance change pattern of the virtual machine during the operation of the target processor. Based on the performance scheduling model, the target performance retention rate and target average load of the virtual machine are determined, and the target super-resolution ratio is used to schedule the virtual processor threads of the target processor based on the target super-resolution ratio.
[0007] Optionally, the scheduling performance data includes: the average load and performance retention rate of virtual machines under different super-division configurations, and the number of parallel tests of the multiple processor cores; The step of constructing a performance scheduling model based on the scheduling performance data includes: A two-dimensional performance matrix is formed by taking the average load of the virtual machine as the row, the number of parallel tests of the multiple processor cores as the column, and the performance retention rate of the virtual machine as the value of the corresponding row and column. The performance two-dimensional matrix is fitted, and the model parameters are determined based on the fitting result of the performance two-dimensional matrix. The model parameters are used to reflect the performance change pattern of different numbers of processor cores, virtual machines, and virtual machines under super-resolution configuration. Based on the model parameters, a performance scheduling model is constructed.
[0008] Optionally, the fitting process of the performance two-dimensional matrix, and the determination of model parameters based on the fitting result of the performance two-dimensional matrix, includes: The performance two-dimensional matrix is transformed into a one-dimensional vector, and the one-dimensional vector uses the performance retention rate as the vector value. The performance retention rate corresponds to the average load. A graph showing the relationship between the performance retention rate and the average load is determined to establish a reference model that describes the performance variation pattern of the virtual machine. The reference model is fitted to determine the model parameters; The performance scheduling model is constructed based on the model parameters, specifically as follows: The performance scheduling model is constructed by substituting the model parameters into the structure of the reference model.
[0009] Optionally, determining the relationship graph between the performance retention rate and the average load to determine a reference model describing the performance change pattern of the virtual machine includes: Plot the relationship between the average load and the performance retention rate of the virtual machine as a function of the average load, with the average load as the horizontal axis and the performance retention rate as the vertical axis. The reference model is determined based on the changing trend reflected by the relationship curve.
[0010] Optionally, the relationship curve is a non-linear curve in which the performance retention rate decreases as the average load increases; The average load is associated with the super-resolution ratio under different super-resolution configurations, and the average load corresponds one-to-one with the number of parallel tests.
[0011] Optionally, the step of performing a runtime test on the target processor under the super-resolution configuration and collecting the scheduling performance data of the target processor includes: Different super-resolution test scenarios for the target processor are determined, and the running test of the target processor is started to collect the raw performance data of the target processor. The original performance data is preprocessed to obtain the scheduling performance data; The scheduling performance data is formatted uniformly and saved as a log file.
[0012] Optionally, before determining the target super-resolution ratio corresponding to the target performance retention rate and target average load of the virtual machine, the method further includes: The target performance retention rate and target average load of the virtual machine are validated for legality. When the target performance retention rate and target average load of the virtual machine are valid, the corresponding target super-resolution ratio is determined according to the performance scheduling model.
[0013] Secondly, embodiments of this application provide a task scheduling device, comprising: The data acquisition module is used to perform runtime tests on the target processor under super-resolution configuration and collect the scheduling performance data of the target processor; wherein, the target processor includes multiple processor cores, and the processor cores are loaded with virtual processor threads of virtual machines; The model building module is used to build a performance scheduling model based on the scheduling performance data. The performance scheduling model reflects the performance change pattern of the virtual machine during the operation of the target processor. The target output module is used to determine the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine according to the performance scheduling model, so as to perform task scheduling of the virtual processor threads of the target processor based on the target super-resolution ratio.
[0014] Optionally, the scheduling performance data includes: the average load and performance retention rate of virtual machines under different super-division configurations, and the number of parallel tests of the multiple processor cores; The data acquisition module includes: The test acquisition unit is used to determine different super-resolution test scenarios for the target processor, start the running test of the target processor, and acquire the raw performance data of the target processor. The data preprocessing unit is used to preprocess the raw performance data to obtain the scheduling performance data; The data persistence unit is used to standardize the format of the scheduling performance data and save it as a log file.
[0015] Thirdly, embodiments of this application also provide an electronic device, including at least one memory and at least one processor, wherein the memory stores one or more computer-executable instructions, and the processor invokes the one or more computer-executable instructions to execute the task scheduling method as described in the first aspect above.
[0016] Fourthly, embodiments of this application also provide a storage medium that stores one or more computer-executable instructions, which, when executed, implement the task scheduling method described in the first aspect above.
[0017] Fifthly, embodiments of this application also provide a computer program product, including one or more computer-executable instructions, which, when executed, implement the task scheduling method as described in the first aspect above.
[0018] In the task scheduling method provided in this application embodiment, a target processor is run and tested under super-resolution configuration, and scheduling performance data of the target processor is collected. The target processor includes multiple processor cores, each core carrying virtual processor threads of a virtual machine. Furthermore, a performance scheduling model can be constructed based on the scheduling performance data. This model reflects the performance variation pattern of the virtual machine during the operation of the target processor. Therefore, based on the performance scheduling model, the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine can be determined, and task scheduling of the virtual processor threads of the target processor can be performed based on the target super-resolution ratio.
[0019] As can be seen, the task scheduling method in this application constructs a performance scheduling model reflecting the performance change pattern of virtual machines by collecting the scheduling performance data of the target processor under super-resolution configuration. This enables the scheduling overhead characteristics of the virtual processor thread configuration and load level on the target processor to be quantified based on the performance scheduling model. Furthermore, by determining the target super-resolution ratio corresponding to the target performance retention rate and target average load of the virtual machine based on the performance scheduling model, the accuracy of super-resolution ratio calculation can be effectively improved compared to the method of configuring super-resolution ratio based on historical experience or using static numerical values. This allows for task scheduling of virtual processor threads on the target processor based on the target super-resolution ratio, ensuring the rationality and fairness of system operation and optimizing system performance. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the optional architectures for a multi-core processor system.
[0022] Figure 2This is an optional flowchart of the task scheduling method provided in the embodiments of this application.
[0023] Figure 3 This is an optional flowchart of step S200 provided in the embodiments of this application.
[0024] Figure 4 This is a schematic diagram of the performance retention rate versus average load provided in the embodiments of this application.
[0025] Figure 5 This is an optional flowchart of step S100 provided in the embodiments of this application.
[0026] Figure 6 This is a schematic diagram of the performance retention rate fitting surface model provided in the embodiments of this application.
[0027] Figure 7 This is a schematic diagram of an optional structure of the task scheduling device provided in the embodiments of this application.
[0028] Figure 8 This is a schematic diagram of an optional structure of the data acquisition module 71 provided in an embodiment of this application. Detailed Implementation
[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] As an optional example, Figure 1 A schematic diagram of the optional architectures for a multi-core processor system is shown. For example... Figure 1 As shown, a multi-core processor system may include: multiple processor cores (CPU core)1, host operating system2, cloud platform software3, and multiple virtual machines (VMs)4.
[0031] Processor core 1 is the computing and control core of the physical host, used to interpret computer instructions and process data in computer software. During the operation of processor core 1, it accesses memory to obtain relevant data resources. Host operating system 2 runs on processor core 1, such as Linux, and is used to manage and allocate corresponding hardware resources. Host operating system 2 can configure cloud platform software 3 for the cloud platform. In cloud service scenarios, the cloud platform can create one or more virtual machines 4 for users based on their needs and allocate corresponding memory resources to the virtual machines.
[0032] However, in multi-core processor systems in virtualization and cloud computing environments, multiple processor cores 1 share physical resources such as cache and memory. Furthermore, the virtual CPUs (i.e., vCPUs) of one or more virtual machines 4 are represented as one or more threads in the host operating system 2, and one or more threads of the virtual CPUs also participate in the competition for physical resources.
[0033] Therefore, to allocate processor time reasonably and ensure system fairness, responsiveness, and throughput, the scheduler in the host operating system schedules different virtual CPU threads to different processor cores for parallel execution, maximizing the performance utilization of multiple processor cores. In an optional implementation, a super-distribution configuration can be used, allocating more virtual CPUs to a limited number of physical CPUs. The ratio between virtual CPUs and physical CPUs is called the super-distribution ratio. For example, in a server with 32 physical CPUs, if the super-distribution ratio is 1:1, each virtual CPU has one physical CPU; if the super-distribution ratio is 4:1, four virtual CPUs have one physical CPU. Currently, the super-distribution ratio is usually determined by developers based on historical experience, or it is inferred from the overall system throughput, latency, or user feedback.
[0034] However, when the scheduler manages all virtual processor threads of all virtual machines and task processing processes of processor cores, it frequently performs operations such as task switching, load balancing, and priority determination. This inevitably introduces dynamic scheduling overhead, including context switching overhead, ready queue management overhead, and load balancing migration overhead. The super-resolution ratio inferred from historical experience, overall system throughput, latency, or user feedback is a static threshold that does not take into account scheduling overhead. This makes it difficult for a fixed static super-resolution ratio to adapt to the hardware architecture of different computer systems and the complex changes under different workloads. Moreover, as the number of tasks increases, the operating system's scheduling overhead accumulates during multi-threaded parallel processing, leading to increased virtual machine latency, intensified resource contention, and ultimately, a decline in overall system performance.
[0035] In view of this, embodiments of this application provide an improved task scheduling method. By collecting scheduling performance data of the target processor when executing virtual processor threads in parallel under super-resolution configuration, a performance scheduling model reflecting the performance change law of the virtual machine is constructed. This allows the scheduling overhead characteristics of the virtual machine's virtual processor thread configuration and load level on the target processor to be quantified based on the performance scheduling model. Furthermore, based on the performance scheduling model, the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine are determined. Compared with the method of configuring the super-resolution ratio based on historical experience or using static numerical configuration, embodiments of this application improve the calculation accuracy of the super-resolution ratio. This enables task scheduling of virtual processor threads on the target processor based on the target super-resolution ratio, ensuring the rationality and fairness of system operation and optimizing system performance.
[0036] Based on the above approach, as an optional implementation, Figure 2 An exemplary schematic diagram of an optional flow of a task scheduling method according to an embodiment of this application is shown. For example... Figure 2 As shown, the following steps may be included: Step S100: Under the super-resolution configuration, perform a runtime test on the target processor and collect the scheduling performance data of the target processor.
[0037] The target processor is the host processor running a virtual machine in a virtualization environment, and may include multiple processor cores. Moreover, in a virtualization environment, the processor cores may be loaded with virtual processor threads (hereinafter referred to as "vCPUs") of the virtual machine. Based on the implementation of super-resolution configuration, the number of vCPUs is much greater than the number of host processor cores.
[0038] The scheduling performance data refers to system metrics used to measure the effectiveness of virtual machine scheduling when the target processor manages and runs multiple vCPUs, based on the super-resolution ratio under different super-resolution configurations. Alternatively, the scheduling performance data can be obtained based on performance metrics such as task completion time and task execution score, as well as system operation metrics such as CPU utilization.
[0039] In an optional example, the execution testing of the target processor and the collection of scheduling performance data in this embodiment of the application can be implemented based on a testing toolset. A testing toolset is specialized software used to measure and compare the performance of computer systems, hardware, or software. It quantifies key indicators such as system processing speed, throughput, and stability by running a series of standardized, repeatable test tasks. Common testing toolsets include UnixBench.
[0040] In another alternative example, embodiments of this application can collect scheduling performance data with high accuracy based on the actual load of the system operation using kernel statistics tools (such as eBPF or perf tools).
[0041] Step S200: Construct a performance scheduling model based on the scheduling performance data.
[0042] The performance scheduling model can reflect the performance variation pattern of the virtual machine during the operation of the target processor.
[0043] Understandably, by constructing a performance scheduling model based on scheduling performance data, discrete performance data can be transformed into a predictive and operable systematic structural framework. This framework, through mathematical or logical means, reveals the inherent laws between scheduling performance data and influencing factors, quantifies scheduling overhead characteristics, and thus avoids over- or under-configuration of hardware resources. This provides a basis for achieving scientific and adaptive resource optimization, thereby maximizing the utilization of hardware resources, ensuring the rationality and fairness of system operation, and optimizing system performance.
[0044] Step S300: Based on the performance scheduling model, determine the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine.
[0045] The target super-resolution ratio can be a specific value, such as the minimum super-resolution ratio to achieve the target performance retention rate under the target average load, or it can be a super-resolution ratio curve. This application does not limit the specific form of the target super-resolution ratio.
[0046] When the performance scheduling model is built based on scheduling performance data, the embodiments of this application can determine the target super-resolution ratio corresponding to the target performance retention rate and target average load of the virtual machine according to the scheduling model. Compared with the method of manually configuring the super-resolution ratio based on experience, it can effectively improve the calculation accuracy of the super-resolution ratio. Based on the target super-resolution ratio, the virtual processor thread task scheduling is performed on the target processor to ensure the rationality and fairness of system operation and optimize system performance.
[0047] Average load is a core metric for measuring processor hardware resource stress. The target average load is the ratio of the number of vCPUs with continuous workloads to the total number of vCPUs in a virtualization environment.
[0048] Performance retention rate is an objective measure of a virtual machine's ability to retain performance under over-provisioning configurations. It is the ratio of the test performance of a virtual machine under over-provisioning configurations to the test performance without over-provisioning, usually expressed as a percentage. The target performance retention rate is the ratio of the expected virtual machine's actual performance after being interfered with by other parallel virtual machines to its performance when the processor core is exclusively used.
[0049] As can be seen, the task scheduling method in this application constructs a performance scheduling model reflecting the performance change pattern of virtual machines by collecting the scheduling performance data of the target processor under super-resolution configuration. This enables the scheduling overhead characteristics of the virtual processor thread configuration and load level on the target processor to be quantified based on the performance scheduling model. Furthermore, by determining the target super-resolution ratio corresponding to the target performance retention rate and target average load of the virtual machine based on the performance scheduling model, the accuracy of super-resolution ratio calculation can be effectively improved compared to the method of configuring super-resolution ratio based on historical experience or using static numerical values. This allows for task scheduling of virtual processor threads on the target processor based on the target super-resolution ratio, ensuring the rationality and fairness of system operation and optimizing system performance.
[0050] In some embodiments, based on a super-resolution configuration, a corresponding number of vCPU thread tasks are allocated to the processor cores. The scheduling performance data of this application may include the average load and performance retention rate of virtual machines under different super-resolution configurations, as well as the number of parallel tests of the multiple processor cores. Therefore, when constructing a performance scheduling model based on the scheduling performance data, it can be a performance scheduling model constructed based on the mathematical or statistical model embodied in the scheduling performance data. Figure 3 An exemplary schematic diagram of an optional process for step S200 is shown, such as... Figure 3 As shown, the following steps may be included: Step S201: Using the average load of the virtual machine as the row, the number of parallel tests of multiple processor cores as the column, and the performance retention rate of the virtual machine as the value of the corresponding row and column, a two-dimensional performance matrix is formed.
[0051] Where L represents the average load of the virtual machine, R represents the performance retention rate of the virtual machine, and C represents the number of parallel tests across multiple processor cores, the performance two-dimensional matrix can be represented as follows: ( [R00, R 01, R02, ..., R0n], [R10, R 11, R12, ..., R1n], [R20, R 21, R22,..., R2n], ...... [Rm0, R m1, Rm2,..., Rmn], ) Step S202: Fit the performance two-dimensional matrix and determine the model parameters based on the fitting result of the performance two-dimensional matrix.
[0052] The model parameters can be used to reflect the performance variation patterns of virtual machines with different numbers of processor cores, virtual machines, and super-resolution configurations.
[0053] As an optional implementation, when determining model parameters based on the performance change pattern of the virtual machine as reflected in the graph of the relationship between performance retention rate and average load (e.g., line graph, curve graph, etc.), the embodiments of this application can transform the two-dimensional performance matrix into a one-dimensional vector, wherein the one-dimensional vector can use the performance retention rate as the vector value, and the performance retention rate corresponds to the average load.
[0054] It should be noted that when converting a two-dimensional performance matrix into a one-dimensional vector, the elements of the performance matrix can be expanded in a row-major order (average load first) to obtain the one-dimensional vector. The one-dimensional vector converted from the above example performance two-dimensional matrix can be shown below: [R00, R10, R20,...Rm0, R01, R11, R21,...Rm1, R02, R12, R22,...Rm2,..., R0n, R1n, R2n,...Rmn] Furthermore, based on a one-dimensional vector, the relationship between performance retention rate and average load is determined, thereby establishing a reference model to describe the performance variation patterns of virtual machines. The reference model is then fitted to obtain the model parameters.
[0055] In further embodiments, the relationship graph can be a curve expressing the change of one variable (e.g., performance retention rate) with another variable (e.g., average load, super-resolution ratio). In a specific example, the relationship curve in this application embodiment can be a non-linear curve in which the performance retention rate decreases as the average load increases. Here, the average load is associated with the super-resolution ratio under different super-resolution configurations, and the average load corresponds one-to-one with the number of parallel tests on multiple processor cores.
[0056] In one alternative implementation, when determining a reference model describing the performance change pattern of a virtual machine based on the relationship graph between performance retention rate and average load, the embodiments of this application may plot a curve showing the relationship between the performance retention rate of the virtual machine and the average load, with the average load as the horizontal axis and the performance retention rate as the vertical axis. Then, the reference model is determined based on the trend reflected by the relationship curve.
[0057] As an application example, embodiments of this application can utilize performance data from target processor tests collected using a testing toolset to analyze and determine a reference model. Among these, Figure 4The diagram illustrating the performance retention rate versus average load provided in this application embodiment shows how the virtual machine's performance retention rate changes with average load on a specified processor model when the super-resolution ratio is 1 (no super-resolution), 1.5, 2, 2.5, and 3, respectively. Furthermore, based on the correlation between average load and super-resolution ratio, the performance retention rate can specifically change with variations in both average load and super-resolution ratio.
[0058] like Figure 4 As shown, it can be seen that with each increase in the super-resolution ratio, the performance retention rate of the virtual machine decreases non-linearly, meaning that the performance degradation of the virtual machine accelerates exponentially rather than decreasing linearly at equal intervals. Furthermore, the relationship curves for different super-resolution ratios show a clear correlation and can be fitted using a unified exponential model. Moreover, under high load conditions, the decrease in the performance retention rate of the virtual machine is more significant.
[0059] When using an exponential model to characterize the performance scheduling model of a virtual machine, it can be:
[0060] L represents the average load of the virtual machine; C represents the number of parallel tests on the processor cores; R(L,C) represents the performance retention rate associated with the average load and the number of parallel tests, with a value ranging from 0 to 1; k,m represent the model parameters, which can be obtained by fitting the exponential model using experimental data. Based on the performance retention rate obtained from the performance scheduling model, the probability of scheduling loss can be determined as: 1 - performance retention rate.
[0061] When optimizing the model parameters k and m using the nonlinear least squares method, the initial parameters can be set to k=0.4 and m=1.0. Then, through iterative calculation, the optimal solution for the parameters is obtained, minimizing the error between the predicted value output by the reference model and the actual experimental data. The obtained model parameters are: k=k fit , m=m fit .
[0062] Step S203: Construct the performance scheduling model based on the model parameters.
[0063] In a specific example of determining model parameters based on fitting the reference model, the performance scheduling model is constructed according to the model parameters. Specifically, the performance scheduling model is constructed by substituting the model parameters into the structure of the reference model. That is, the performance scheduling model is: .
[0064] In some embodiments, to obtain accurate scheduling performance data, Figure 5 An exemplary schematic diagram of an optional process for step S100 of an embodiment of this application is shown, such as... Figure 5As shown, the following steps may be included: Step S101: Determine different super-resolution test scenarios for the target processor, start the running test on the target processor, and collect the raw performance data of the target processor.
[0065] When running tests on a target processor using a testing toolset, the toolset can cover single-threaded, multi-threaded, and hyper-threaded test scenarios, using lightweight benchmarks as testing tools. Furthermore, it supports testing of a specified set of processor cores, binding test processes via taskset or numactl, and acquiring test data by gradually increasing the concurrency of processor cores, cyclically increasing the number of processes, and reducing random errors through multiple rounds of testing.
[0066] The raw performance data can be system metrics data collected during the testing of the target processor, including performance metrics (such as benchmark task completion time, benchmark task running score, etc.) and system operation metrics (such as CPU utilization), in order to comprehensively measure the target processor's computing performance, memory access performance, and process scheduling overhead.
[0067] Step S102: Preprocess the raw performance data to obtain scheduling performance data.
[0068] Preprocessing of the raw performance data may include noise filtering, outlier removal, and index averaging to improve the accuracy and stability of the data.
[0069] The noise filtering is used to filter out randomly generated, irrelevant, or misleading data in the original performance data in order to extract the true, stable, and interpretable performance signal.
[0070] Outlier removal is used to remove abnormal data points, such as those that are too large or too small, caused by measurement errors. When removing outliers from the original performance data, this can be done based on a standard deviation rule. In a specific example, the mean μ and standard deviation σ of the data sequence can be calculated to remove data points greater than μ + 3σ or less than μ - 3σ, and the mean and standard deviation of the removed data sequence can be recalculated.
[0071] The metric averaging process is used to summarize and average the same metric data obtained from multiple rounds of testing under the same number of parallel tests on multiple processor cores, so as to obtain a stable performance metric.
[0072] Step S103: Standardize the format of the scheduling performance data and save it as a log file.
[0073] In an optional example, the standardized scheduling performance data can be in CSV format, which may include basic fields such as timestamp (data acquisition time), concurrency_level (test concurrency level), cpu_cores_used (number of CPU cores used), test_bench: (benchmark used for testing), and test_score (test score using the benchmark). In this embodiment, the scheduling performance data may also include other system metric fields, such as scheduling latency and context switch counts. This embodiment does not impose any limitations on this, and it can be set according to actual needs. Furthermore, to facilitate the management and retrieval of scheduling performance data, the testing toolset can write the results of each round of testing to a CSV file in a specified directory. The file name can follow the format testdata_ <timestamp> _ <concurrency>Naming rules for .csv files.
[0074] Understandably, standardizing the format of scheduling performance data can balance readability and access efficiency. Furthermore, saving scheduling performance data as log files allows for long-term storage, facilitating subsequent analysis.
[0075] In some embodiments, the values of the virtual machine's average load and performance retention rate are both greater than 0 and less than or equal to 1. To ensure the accuracy of the super-splitting ratio, this application embodiment may perform a validity check on the virtual machine's target performance retention rate and target average load before determining the target super-splitting ratio corresponding to the virtual machine's target performance retention rate and target average load. If the virtual machine's target performance retention rate and target average load are valid, the corresponding target super-splitting ratio is determined according to the performance scheduling model. It should be noted that if the virtual machine's target performance retention rate and target average load are located in a boundary range not covered by the performance scheduling model, the target super-splitting ratio can be determined by rounding down to ensure the rationality of the target super-splitting ratio determined by the performance scheduling model.
[0076] To facilitate understanding of the task scheduling method in this application, we will take a server with dual sockets, each CPU having 64 physical CPU cores, and hyper-threading mode enabled. Each physical CPU core can execute 2 logical threads, resulting in a total of 256 threads that can be executed by 128 physical CPU cores. The server uses 752GB of memory and has 2TB of hard disk space as an example for explanation.
[0077] The test employed the standard Unix bench test suite, using a taskset approach to limit the server's test thread execution range to 16-19 cores and 144-147 cores. Performance data was collected under parallel testing with 1 to 8 CPU cores through a loop-based, multi-execution test. The collected Unix bench results were used as the test results, with each result time-stamped, and the test was repeated 12 times.
[0078] After noise filtering, outlier removal, and averaging of metrics, the test results are used as scheduling performance data. This data is saved in the `. / logs` folder as a `test.csv` file, which retains performance metrics such as timestamp, concurrency_level, `cpu_cores_used`, `test_bench`, and `test_score`. Here, `timestamp` represents the data acquisition time, which can be determined based on the specific timestamp of the test execution; `concurrency_level` represents the test parallelism, corresponding to the number of CPU cores tested (1 to 8); `cpu_cores_used` represents the number of CPU cores used (8); `test_bench` represents the benchmark used in the test (Unix bench); and `test_score` represents the test score using the benchmark, specifically the SystemBenchmarks Index Score output after the Unix bench test.
[0079] Based on reading the test.csv file, a two-dimensional performance matrix is obtained after parsing the scheduling performance data. This two-dimensional performance matrix can be specifically a performance retention rate data matrix, as shown in the table below: R_data = np.array([ [1, 0.9736, 0.9609, 0.8751, 0.8076, 0.7875, 0.8014, 0.7880], [1, 0.9800, 0.8843, 0.7877, 0.6823, 0.6080, 0.5410, 0.4870], [1, 0.8750, 0.7131, 0.5812, 0.4659, 0.4032, 0.3517, 0.3388], [1, 0.8148, 0.6011, 0.4669, 0.3527, 0.3077, 0.2769, 0.2842], [1, 0.7522, 0.5555, 0.4182, 0.3174, 0.2846, 0.2560, 0.2552] ]) By fitting the performance retention rate data matrix, we obtain... Figure 6 The performance retention rate fitting surface model is shown, and the model parameters k=0.4013 and m=0.987 are obtained by solving the model. Substituting the model parameters into the performance retention rate fitting surface model, the final performance scheduling model is obtained as follows:
[0080] Where R(L,C) represents the performance retention rate of the virtual machine, and the value of the performance retention rate ranges from 0 to 1; L represents the average load of the virtual machine; and C represents the super-resolution ratio.
[0081] If the target performance retention rate of the virtual machine is 80% and the target average load is 60%, since both 80% and 60% are less than 1 and greater than 0, the target performance retention rate and the target average load are valid. Therefore, by substituting the target performance retention rate of 80% and the target average load of 60% into the performance scheduling model and approximating the result of the performance scheduling model, we can obtain a target super-resolution ratio of 2. Based on this target super-resolution ratio, we can perform task scheduling of logical threads on the CPU core, that is, the number of logical threads that can be allocated to 1 CPU core is 2.
[0082] As can be seen, the task scheduling method in this application constructs a performance scheduling model reflecting the performance change pattern of virtual machines by collecting the scheduling performance data of the target processor under super-resolution configuration. This enables the scheduling overhead characteristics of the virtual processor thread configuration and load level on the target processor to be quantified based on the performance scheduling model. Furthermore, by determining the target super-resolution ratio corresponding to the target performance retention rate and target average load of the virtual machine based on the performance scheduling model, the accuracy of super-resolution ratio calculation can be effectively improved compared to the method of configuring super-resolution ratio based on historical experience or using static numerical values. This allows for task scheduling of virtual processor threads on the target processor based on the target super-resolution ratio, ensuring the rationality and fairness of system operation and optimizing system performance.
[0083] As an optional implementation Figure 7 This is a schematic diagram of an optional structure of the task scheduling device in an embodiment of this application. The method described above can be considered as the method steps required to determine the target super-resolution ratio based on the various logic components in the task scheduling device. The content described below can be referred to in correspondence with the content described above.
[0084] Reference Figure 7 The task scheduling device may include: a data acquisition module 71, a model building module 72, and a target output module 73.
[0085] The data acquisition module 71 is used to perform runtime tests on the target processor under super-resolution configuration and collect the scheduling performance data of the target processor; wherein the target processor includes multiple processor cores, and the processor cores are loaded with virtual processor threads of virtual machines.
[0086] The model building module 72 is used to build a performance scheduling model based on the scheduling performance data. The performance scheduling model reflects the performance change pattern of the virtual machine during the operation of the target processor.
[0087] The target output module 73 is used to determine the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine according to the performance scheduling model, so as to perform task scheduling of the virtual processor threads of the target processor based on the target super-resolution ratio.
[0088] In some embodiments, the scheduling performance data includes: the average load and performance retention rate of virtual machines under different super-division configurations, and the number of parallel tests of the multiple processor cores; The model building module 72 constructs a performance scheduling model based on the scheduling performance data, including the following steps: A two-dimensional performance matrix is formed by taking the average load of the virtual machine as the row, the number of parallel tests of the multiple processor cores as the column, and the performance retention rate of the virtual machine as the value of the corresponding row and column. The performance two-dimensional matrix is fitted, and the model parameters are determined based on the fitting result of the performance two-dimensional matrix. The model parameters are used to reflect the performance change pattern of different numbers of processor cores, virtual machines, and virtual machines under super-resolution configuration. Based on the model parameters, a performance scheduling model is constructed.
[0089] In some embodiments, the model building module 72 performs fitting processing on the performance two-dimensional matrix, and determines the model parameters based on the fitting result of the performance two-dimensional matrix, including: The performance two-dimensional matrix is transformed into a one-dimensional vector, and the one-dimensional vector uses the performance retention rate as the vector value. The performance retention rate corresponds to the average load. A graph showing the relationship between the performance retention rate and the average load is determined to establish a reference model that describes the performance variation pattern of the virtual machine. The reference model is fitted to determine the model parameters.
[0090] When the model building module 72 constructs the performance scheduling model based on the model parameters, it can specifically do the following: The performance scheduling model is constructed by substituting the model parameters into the structure of the reference model.
[0091] In some embodiments, the step of the model building module 72 determining a graph showing the relationship between the performance retention rate and the average load to determine a reference model describing the performance variation pattern of the virtual machine includes: Plot the relationship between the average load and the performance retention rate of the virtual machine as a function of the average load, with the average load as the horizontal axis and the performance retention rate as the vertical axis. The reference model is determined based on the changing trend reflected by the relationship curve.
[0092] In some embodiments, the relationship curve plotted by the model building module 72 is a non-linear curve in which the performance retention rate decreases as the average load increases; The average load is associated with the super-resolution ratio under different super-resolution configurations, and the average load corresponds one-to-one with the number of parallel tests.
[0093] In some embodiments, the scheduling performance data includes the average load and performance retention rate of virtual machines under different super-resolution configurations, as well as different dimensions of data regarding the number of parallel tests of the multiple processor cores. Figure 8 An exemplary schematic diagram of an optional structure for the data acquisition module 71 is shown. For example... Figure 8 As shown, the data acquisition module 71 may include: The test acquisition unit 711 is used to determine different super-resolution test scenarios for the target processor, start the running test of the target processor, and acquire the raw performance data of the target processor.
[0094] The data preprocessing unit 712 is used to preprocess the raw performance data to obtain the scheduling performance data.
[0095] The data persistence unit 713 is used to unify the format of the scheduling performance data and save it as a log file.
[0096] In some embodiments, before determining the target super-resolution ratio corresponding to the target performance retention rate and target average load of the virtual machine, the target output module 73 is further configured to: perform a validity check on the target performance retention rate and target average load of the virtual machine, so as to determine the target super-resolution ratio corresponding to the virtual machine according to the performance scheduling model when the target performance retention rate and target average load of the virtual machine are valid.
[0097] As can be seen, the task scheduling device in this embodiment constructs a performance scheduling model reflecting the performance change pattern of virtual machines by means of a model building module based on the scheduling performance data of the target processor under super-resolution configuration collected by the data acquisition module. This enables the scheduling overhead characteristics of the virtual processor thread configuration and load level on the target processor to be quantified based on the performance scheduling model. Furthermore, the target output module determines the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine based on the performance scheduling model. Compared with the method of configuring the super-resolution ratio based on historical experience or static values, this method can effectively improve the calculation accuracy of the super-resolution ratio. This allows for task scheduling of virtual processor threads on the target processor based on the target super-resolution ratio, ensuring the rationality and fairness of system operation and optimizing system performance.
[0098] This application also provides an electronic device, including at least one memory and at least one processor, wherein the memory stores one or more computer-executable instructions, and the processor invokes the one or more computer-executable instructions to execute the task scheduling method as described above.
[0099] This application embodiment also provides a storage medium that stores one or more computer-executable instructions, which, when executed, implement the task scheduling method described above.
[0100] This application also provides a computer program product, including one or more computer-executable instructions, which, when executed, implement the task scheduling method described above.
[0101] The foregoing describes multiple embodiment schemes provided by the embodiments of this application. The optional methods described in each embodiment scheme can be combined and cross-referenced with each other without conflict, thereby extending to a variety of possible embodiment schemes. These can all be considered as the embodiment schemes disclosed and published by the embodiments of this application.
[0102] While the embodiments disclosed above are described in this application, this application is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of this application; therefore, the scope of protection of this application should be determined by the scope defined in the claims.< / concurrency> < / timestamp>
Claims
1. A task scheduling method, characterized in that, include: Under super-resolution configuration, the target processor is tested and its scheduling performance data is collected; wherein the target processor includes multiple processor cores, and the processor cores are loaded with virtual processor threads of virtual machines; Based on the scheduling performance data, a performance scheduling model is constructed, which reflects the performance change pattern of the virtual machine during the operation of the target processor. Based on the performance scheduling model, the target performance retention rate and target average load of the virtual machine are determined, and the target super-resolution ratio is used to schedule the virtual processor threads of the target processor based on the target super-resolution ratio.
2. The task scheduling method according to claim 1, characterized in that, The scheduling performance data includes: the average load and performance retention rate of virtual machines under different super-resolution configurations, and the number of parallel tests of the multiple processor cores; The step of constructing a performance scheduling model based on the scheduling performance data includes: A two-dimensional performance matrix is formed by taking the average load of the virtual machine as the row, the number of parallel tests of the multiple processor cores as the column, and the performance retention rate of the virtual machine as the value of the corresponding row and column. The performance two-dimensional matrix is fitted, and the model parameters are determined based on the fitting result of the performance two-dimensional matrix. The model parameters are used to reflect the performance change pattern of different numbers of processor cores, virtual machines, and virtual machines under super-resolution configuration. Based on the model parameters, a performance scheduling model is constructed.
3. The task scheduling method according to claim 2, characterized in that, The process of fitting the performance two-dimensional matrix and determining the model parameters based on the fitting result includes: The performance two-dimensional matrix is transformed into a one-dimensional vector, and the one-dimensional vector uses the performance retention rate as the vector value. The performance retention rate corresponds to the average load. A graph showing the relationship between the performance retention rate and the average load is determined to establish a reference model that describes the performance variation pattern of the virtual machine. The reference model is fitted to determine the model parameters; The performance scheduling model is constructed based on the model parameters, specifically as follows: The performance scheduling model is constructed by substituting the model parameters into the structure of the reference model.
4. The task scheduling method according to claim 3, characterized in that, The step of determining the relationship graph between the performance retention rate and the average load to establish a reference model describing the performance variation pattern of the virtual machine includes: Plot the relationship between the average load and the performance retention rate of the virtual machine as a function of the average load, with the average load as the horizontal axis and the performance retention rate as the vertical axis. The reference model is determined based on the changing trend reflected by the relationship curve.
5. The task scheduling method according to claim 4, characterized in that, The relationship curve is a non-linear curve showing that the performance retention rate decreases as the average load increases; The average load is associated with the super-resolution ratio under different super-resolution configurations, and the average load corresponds one-to-one with the number of parallel tests.
6. The task scheduling method according to claim 1, characterized in that, The step of running a test on the target processor under the super-resolution configuration and collecting the scheduling performance data of the target processor includes: Different super-resolution test scenarios for the target processor are determined, and the running test of the target processor is started to collect the raw performance data of the target processor. The original performance data is preprocessed to obtain the scheduling performance data; The scheduling performance data is formatted uniformly and saved as a log file.
7. The task scheduling method according to claim 1, characterized in that, Before determining the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine, the method further includes: The target performance retention rate and target average load of the virtual machine are validated for legality. When the target performance retention rate and target average load of the virtual machine are valid, the target super-resolution ratio corresponding to them is determined according to the performance scheduling model.
8. A task scheduling device, characterized in that, include: The data acquisition module is used to perform runtime tests on the target processor under super-resolution configuration and collect the scheduling performance data of the target processor; wherein, the target processor includes multiple processor cores, and the processor cores are loaded with virtual processor threads of virtual machines; The model building module is used to build a performance scheduling model based on the scheduling performance data. The performance scheduling model reflects the performance change pattern of the virtual machine during the operation of the target processor. The target output module is used to determine the target performance retention rate and the target super-resolution ratio corresponding to the target average load of the virtual machine according to the performance scheduling model, so as to perform task scheduling of the virtual processor threads of the target processor based on the target super-resolution ratio.
9. The task scheduling device according to claim 8, characterized in that, The scheduling performance data includes: the average load and performance retention rate of virtual machines under different super-resolution configurations, and the number of parallel tests of the multiple processor cores; The data acquisition module includes: The test acquisition unit is used to determine different super-resolution test scenarios for the target processor, start the running test of the target processor, and acquire the raw performance data of the target processor. The data preprocessing unit is used to preprocess the raw performance data to obtain the scheduling performance data; The data persistence unit is used to standardize the format of the scheduling performance data and save it as a log file.
10. An electronic device, characterized in that, It includes at least one memory and at least one processor, the memory storing one or more computer-executable instructions, and the processor invoking the one or more computer-executable instructions to perform the task scheduling method as described in any one of claims 1 to 7.
11. A storage medium, characterized in that, The storage medium stores one or more computer-executable instructions, which, when executed, implement the task scheduling method as described in any one of claims 1 to 7.
12. A computer program product, characterized in that, It includes one or more computer-executable instructions, which, when executed, implement the task scheduling method as described in any one of claims 1 to 7.
