Method and device for scheduling process

By updating the process wake-up frequency under the NUMA architecture and scheduling it to nodes with significant wake-up relationships, the problem of failure to fully utilize node resources in the existing technology is solved, and system performance and cache affinity are improved.

CN113296934BActive Publication Date: 2024-10-25ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011193840.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2024-10-25
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

Under the NUMA architecture, the existing process scheduling strategy fails to fully utilize the internal resources of the node, resulting in system performance that needs to be improved.

Method used

By using process wake-up data to update the wake-up frequency, determine whether the preset scheduling conditions are met, and schedule the process to be executed on a node with a significant wake-up relationship, thereby reducing cross-node information transfer and making full use of cache affinity.

Benefits of technology

It effectively improves the overall performance of the system, reduces cross-node memory access communication overhead, and optimizes the process scheduling strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113296934B_ABST
    Figure CN113296934B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a method and device for scheduling processes, wherein the method for scheduling processes is applied to a kernel scheduler under a NUMA architecture, including: in response to a first process being awakened by a process on a first node, updating the wake-up frequency of the first process corresponding to the first node using wake-up data of previous awakenings of the first process by the first node; determining whether the wake-up frequency meets a preset scheduling condition; and if so, scheduling the first process to the CPU of the first node for execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and more particularly to a method for scheduling a process. One or more embodiments of this specification also relate to an apparatus for scheduling a process, a computing device, and a computer-readable storage medium. Background Art

[0002] The NUMA (Uniform Memory Access Architecture) architecture includes multiple nodes, each of which has multiple CPUs. A shared memory controller is used inside the node, and nodes are connected and exchange information through interconnect modules. In the NUMA architecture, when a process is awakened, it means that the process changes from a blocked state to a ready state. At this time, the kernel scheduler needs to select a CPU for the process and schedule the process to the selected CPU for execution.

[0003] Currently, the process scheduling strategy generally considers the CPU load to determine the CPU recommended to the awakened process. However, these scheduling strategies do not fully utilize the internal resources of the node, and the overall system performance needs to be improved. Summary of the invention

[0004] In view of this, the present specification provides a method for scheduling a process. One or more embodiments of the present specification also relate to a device for scheduling a process, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of the present specification, a method for scheduling processes is provided, which is applied to a kernel scheduler under a NUMA architecture, including: in response to a first process being awakened by a process on a first node, updating the wake-up frequency of the first process corresponding to the first node using wake-up data of previous awakenings of the first process by the first node; determining whether the wake-up frequency meets a preset scheduling condition; and if so, scheduling the first process to the CPU of the first node for execution.

[0006] Optionally, updating the wake-up frequency of the first process corresponding to the first node by using the wake-up data of all the times the first process is awakened by the first node includes: obtaining a score of the first process corresponding to the first node by using the wake-up data of all the times the first process is awakened by the process on the first node; obtaining a total score of the first process by using the total wake-up data of all the times the first process is awakened by each node under the NUMA architecture; and calculating the ratio of the score of the first process corresponding to the first node to the total score of the first process to obtain the wake-up frequency.

[0007] Optionally, the determining whether the wake-up frequency satisfies a preset scheduling condition includes: determining whether the total score of the first process is greater than a preset total score threshold and the ratio is greater than a preset ratio threshold.

[0008] Optionally, the method further includes: when the first process is scheduled to be executed by the CPU of the first node, resetting the wakeup data used to update the wakeup frequency of the first process corresponding to the first node to an initial state.

[0009] Optionally, the method also includes: when the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions, updating the previous wake-up data according to an update rule in which the wake-up data shows a decaying trend from near to far from the current time.

[0010] Optionally, the updating rule according to which the wake-up data of all previous wake-up times show a decaying trend from near to far from the current time comprises: multiplying each wake-up data in the wake-up data of all previous wake-up times by a corresponding weight to obtain updated wake-up data of all previous wake-up times, wherein the weight is taken according to the decaying trend from near to far from the corresponding wake-up time to the current time; or, deleting the wake-up data whose corresponding wake-up time in the wake-up data is longer than a preset effective time from the current time from the wake-up data of all previous wake-up times.

[0011] Optionally, the previous wake-up data includes: a record of the number of wake-ups or the wake-up time corresponding to each wake-up.

[0012] According to a second aspect of the embodiments of this specification, a device for scheduling processes is provided, which is configured in a kernel scheduler under a NUMA architecture, and includes: a wake-up frequency update module, configured to respond to a first process being awakened by a process on a first node, and update the wake-up frequency of the first process corresponding to the first node using the wake-up data of the first process being awakened by the first node. A scheduling judgment module, configured to judge whether the wake-up frequency meets a preset scheduling condition. A scheduling execution module, configured to schedule the first process to the CPU of the first node for execution if yes.

[0013] According to a third aspect of an embodiment of this specification, a computing device is provided, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions: in response to a first process being awakened by a process on a first node, updating the awakening frequency of the first process corresponding to the first node using the awakening data of previous awakenings of the first process by the first node; determining whether the awakening frequency meets a preset scheduling condition; if so, scheduling the first process to the CPU of the first node for execution.

[0014] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the method for scheduling a process described in any embodiment of this specification are implemented.

[0015] An embodiment of the present specification provides a method for scheduling processes. Since the method responds to a first process being awakened by a process on a first node, the method uses the wake-up data of the first process being awakened by the first node to update the wake-up frequency of the first process corresponding to the first node, and judges whether the wake-up frequency meets the preset scheduling conditions, thereby judging whether the first process has a significant wake-up relationship on the first node through the wake-up frequency. Since a significant wake-up relationship often implies information exchange between subsequent processes, scheduling the process to run on a node with a significant wake-up relationship can reduce cross-node information transmission, and can also make full use of internal resources of a node equal to cache affinity, saving communication overhead such as cross-node memory access. Therefore, when it is determined that the wake-up frequency meets the preset scheduling conditions, the first process can be scheduled to the CPU of the first node for execution, thereby effectively improving the overall performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a method for scheduling a process provided by an embodiment of this specification;

[0017] Figure 2 This is a schematic diagram of a process wake-up relationship provided by an embodiment of this specification;

[0018] Figure 3 is a processing flow chart of a method for scheduling a process provided by an embodiment of the present specification;

[0019] Figure 4 It is a schematic diagram of statistical information provided by an embodiment of this specification;

[0020] Figure 5 It is a structural diagram of a device for scheduling processes provided by an embodiment of this specification;

[0021] Figure 6 is a structural diagram of a device for scheduling processes provided by another embodiment of the present specification;

[0022] Figure 7 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0023] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0024] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0025] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0026] First, the terms involved in one or more embodiments of this specification are explained.

[0027] Kernel: The internal core program of the operating system.

[0028] Scheduler: The kernel manages the program that decides which processes to run.

[0029] NUMA node: The unit that makes up the NUMA architecture. Memory access within the same node is faster than memory access across nodes.

[0030] Cache: High-speed cache memory. The speed of hitting the CACHE is faster than the speed of accessing the memory.

[0031] Cache affinity: The nature of a hit in a cache for cached content.

[0032] In this specification, a method for scheduling a process is provided. This specification also relates to an apparatus for scheduling a process, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0033] Figure 1A flowchart of a method for scheduling a process provided according to an embodiment of the present specification is shown, including steps 102 to 106.

[0034] Step 102: In response to a first process being awakened by a process on a first node, the awakening frequency of the first process corresponding to the first node is updated using the awakening data of all the times the first process is awakened by the first node.

[0035] Among them, the previous wake-up data may include any relevant data that can show the frequency of the previous wake-ups recorded according to the needs of the implementation scenario, and the embodiments of this specification do not limit this. For example, the previous wake-up data may include: the number of wake-ups, or the record of the wake-up time corresponding to each wake-up. For example, in the case of including the number of wake-ups, the wake-up frequency can be updated according to the number of wake-ups when the first process is awakened by the first node. For another example, since the farther the wake-up time is from the current time, the worse the timeliness, therefore, in the case of including the record of the wake-up time corresponding to each wake-up, the number of wake-ups can be counted based on all records, so as to update the wake-up frequency according to the timeliness of the number of wake-ups and the corresponding wake-up time.

[0036] Step 104: Determine whether the wake-up frequency satisfies a preset scheduling condition.

[0037] Among them, the preset scheduling conditions may include any conditions that can show a significant wake-up relationship set according to the needs of the implementation scenario, and the embodiments of this specification do not limit this. For example, when the wake-up frequency is a numerical value, the preset scheduling condition can be set to a numerical threshold range that can show a significant wake-up relationship. For another example, when the wake-up frequency is multiple numerical values, the preset scheduling condition can be set to a corresponding multiple numerical threshold ranges that can show a significant wake-up relationship, or set to an expression including variables corresponding to multiple numerical values ​​and the operational relationship between the variables, and set an expression result threshold range that can show a significant wake-up relationship for the expression.

[0038] Step 106: If yes, dispatch the first process to the CPU of the first node for execution.

[0039] It can be seen that since the method responds to the first process being awakened by the process on the first node, the awakening data of the previous awakenings of the first process by the first node is used to update the awakening frequency of the first process corresponding to the first node, and it is determined whether the awakening frequency meets the preset scheduling conditions, thereby judging whether the first process has a significant awakening relationship on the first node through the awakening frequency. Since a significant awakening relationship often implies information exchange between subsequent processes, scheduling the process to run on a node with a significant awakening relationship can reduce cross-node information transmission, and can also make full use of the internal resources of a node equal to cache affinity, saving communication overhead such as cross-node memory access. Therefore, when it is determined that the awakening frequency meets the preset scheduling conditions, the first process can be scheduled to the CPU of the first node for execution, thereby effectively improving the overall performance of the system.

[0040] It is understandable that the wake-up relationship between processes is usually accompanied by subsequent information exchange, which is usually manifested as a copy of memory data. If the process wake-up occurs inside a node, the subsequent information exchange will also be carried out inside the node. The memory access speed within the same node is faster than the memory access across nodes. When accessing memory on the same node, the cache inside the node can be fully utilized. Once the cache is hit, the memory access operation can be avoided. The cache access is faster than the memory access. In order to fully illustrate the effect of the method for scheduling processes provided in the embodiments of this specification, the following is combined with the following example. Figure 2 The process wake-up relationship diagram under the NUMA architecture is shown to illustrate. Figure 2 As shown, processes 1 and 2 are running on node0. Assuming that process 2 wakes up 1 and 3, and then transmits data to 1 and 3, node 1 may be completed quickly due to a cache hit. Even if the cache does not hit, since 1 and 2 are on the same node, memory access within the node is faster than cross-node memory access. And if 2 wants to pass data to 3, it needs to cross node0 to node2. This cross-node memory access operation is 70% slower than local memory access in some systems. Therefore, if the wake-up frequency of process 3 corresponding to node0 meets the preset scheduling conditions, the method provided in the embodiment of this specification can schedule process 3 to node0 when process 2 wakes up process 3, thereby significantly reducing the subsequent memory access overhead, thereby improving the overall system performance.

[0041] It should be noted that the embodiments of this specification do not limit the calculation method for updating the wake-up frequency. For example, the number of times the first process is awakened can be accumulated. The wake-up frequency can be represented by the number of times the first process is awakened by the first node, or the number of times the first process is awakened by all nodes and the number of times the first process is awakened by the first node, etc. Below, a possible implementation method is described by example.

[0042] In one or more embodiments, the wakeup data of the first process being awakened by the process on the first node can be used to obtain the score of the first process corresponding to the first node; the total wakeup data of the first process being awakened by each node under the NUMA architecture can be used to obtain the total score of the first process; the ratio of the score of the first process corresponding to the first node to the total score of the first process is calculated to obtain the wakeup frequency. In this embodiment, the wakeup frequency can be represented by the total score of the first process and the ratio, or can be represented by the ratio, or can be represented by the score of the first process corresponding to the first node and the ratio.

[0043] For example, in this embodiment, when the wake-up data is the number of wake-ups, the total number of times the first node is awakened by each node can be accumulated to obtain the total score of the first process, the number of times the first process is awakened by the first node can be accumulated to obtain the score of the first process corresponding to the first node, and then the ratio of the two can be calculated to obtain the wake-up frequency. Figure 2 The process wake-up relationship diagram shown in the figure shows that each process counts the wake-up times of all corresponding nodes, including the number of times the CPU on all nodes wakes up the current process and the total number of times the current process is woken up. When process 2 wakes up process 3, since process 2 is located on node 0, the wake-up times of process 3 on node 0 and the total number of wake-up times of process 3 being woken up by all nodes are updated.

[0044] In this embodiment, the wake-up frequency is obtained by calculating the ratio of the score of the first process corresponding to the first node to the total score of the first process, so that the wake-up frequency of the first process corresponding to the first node in all nodes under the NUMA architecture can be accurately evaluated, making the calculated wake-up frequency more accurate.

[0045] It should be noted that, based on this implementation, the method for determining whether the preset scheduling conditions are met is not limited. For example, in the case where the wake-up frequency is represented by the total score of the first process and the ratio, the judgment can be achieved by determining whether the total score of the first process is greater than the preset total score threshold and the ratio is greater than the preset ratio threshold. If the total score of the first process is greater than the preset total score threshold and the ratio is greater than the preset ratio threshold, it can be determined that the wake-up frequency meets the preset scheduling conditions. Through the judgment of the total score and the ratio of the first process in this implementation, it can be effectively determined that the first process is awakened significantly frequently as a whole and the first process corresponding to the first node is awakened significantly frequently, thereby effectively evaluating the significance of the wake-up relationship between the first process and the first node.

[0046] Since the previously accumulated wake-up data has completed its evaluation function in the scheduling of the first process when the first process is scheduled to the CPU of the first node for execution, continued accumulation may cause a cyclic triggering of the scheduling of the first process to the first node for execution. In order to avoid the waste of computing resources caused by cyclic triggering, one or more embodiments of the present specification also include: when the first process is scheduled to the CPU of the first node for execution, the wake-up data used to update the wake-up frequency of the first process corresponding to the first node is reset to an initial state. For example, the statistical values ​​of the wake-up process and the awakened process can be reset, such as the cumulative number of times the first process is awakened by all nodes is reset to zero, thereby avoiding cyclic triggering.

[0047] Considering that when the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions, the previous wake-up data will continue to be accumulated, and the timeliness of the wake-up data to the wake-up frequency will gradually decay due to the change in the length of the wake-up time from the current time, therefore, in one or more embodiments of this specification, when the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions, the previous wake-up data is updated according to the update rule that the previous wake-up data has a decaying trend from near to far from the current time. In this embodiment, the previous wake-up data is updated according to the update rule of timeliness decay, so as to avoid excessive proportion of historical statistics and ensure timeliness.

[0048] For example, according to the update rule that the wake-up data of all previous wake-up times show a decaying trend from near to far from the current time, updating the wake-up data of all previous wake-up times may include: multiplying each wake-up data in the wake-up data of all previous wake-up times by a corresponding weight to obtain updated wake-up data of all previous wake-up times, wherein the weight is taken according to the decaying trend from near to far from the corresponding wake-up time to the current time. For example, the total number of wake-ups in the wake-up data of all previous wake-up times is represented by S, including the total number of wake-ups of the current wake-up time, S1 to S n-1 The number of wake-ups corresponding to the first wake-up to the n-1th wake-up after the last update. The initial value of the number of wake-ups corresponding to each wake-up is 1. n-1 To Q1, the corresponding wake-up time is taken from near to far from the current time. For example, the weight corresponding to the wake-up in a preset time period close to the current time can be 1, the weight corresponding to the wake-up in another preset time period far from the current time can be 0.5, and the weight corresponding to the wake-up in another preset time period far from the current time can be 0. Update S according to the following formula:

[0049] S1 = S1 * Q1;

[0050] …

[0051] S n =S n *Q n ;

[0052] S=S1+S2…+S n-1 +S n .

[0053] In this embodiment, by using weights that decay from near to far wake-up times to current times, accumulation of wake-up data with insufficient timeliness can be accurately eliminated, and more effective wake-up data can be updated, thereby further achieving accurate evaluation of wake-up frequency.

[0054] For another example, according to the update rule that the wake-up data of all previous wake-up times show a decaying trend from near to far in terms of the wake-up time from the current time, updating the wake-up data of all previous wake-up times may include: deleting the wake-up data whose corresponding wake-up time in the wake-up data is longer than a preset effective time in terms of the distance from the current time from the wake-up data of all previous wake-up times.

[0055] In this embodiment, by directly deleting the wake-up data whose wake-up time is more than the preset effective time from the current time, the update of the wake-up data is completed more simply and quickly, so that the accumulated wake-up data can ensure a certain timeliness and be updated quickly and easily, thereby further realizing a quick and accurate evaluation of the wake-up frequency.

[0056] In order to further improve the overall performance of the system, in one or more embodiments of this specification, when the wake-up frequency does not meet the preset scheduling conditions, other scheduling strategies can be combined to schedule the first process. For example, the wake-up frequency scheduling strategy or the numa balance scheduling strategy can be used for scheduling.

[0057] For example, the wake affine scheduling strategy includes: recording the number of changes in the number of times a process wakes up other processes. Each time it wakes up other processes, it records the last awakened process. If the awakened process this time is different from the last time, the number of changes increases, so that the scenario where the process frequently wakes up multiple processes can be identified to decide which CPU the awakened process should choose to run. Wake affine considers the CPU C where the awakening process is located and the CPU P where the awakened process last ran. If C is idle, then C is selected as the recommended CPU. Otherwise, if P is idle, then P is selected as the recommended CPU. Alternatively, based on the load of C and P, a CPU with a smaller load is determined as the recommended CPU. Then, an idle CPU in the node where the recommended CPU is located is selected as the final choice. If there is no idle CPU, the recommended CPU is selected.

[0058] For another example, the numa balance scheduling policy focuses on whether the CPU running the process and the memory owned by the process are on the same node. When on the same node, the process memory access can reduce cross-node memory access. numa balance periodically scans the memory pages of the process and decides whether to migrate the process and memory pages to the same node.

[0059] The following combination Figure 3 , further describes the method of scheduling processes in combination with multiple embodiments of this specification. Figure 3 A flowchart of a method for scheduling a process provided by an embodiment of the present specification is shown, and the specific steps include step 302 to step 314.

[0060] Step 302: Execute a wake-up operation of waking up the first process by the process on the first node.

[0061] Step 304: Update the statistics of the awakened first process, where the statistics include: the total cumulative awakening times of the first process being awakened by each node, and the cumulative awakening times of the first process being awakened by the first node.

[0062] Step 306: Determine whether the total accumulated wake-up times exceeds a preset total threshold.

[0063] If the total accumulated wake-up times does not exceed the preset total score threshold, the process goes to step 308 to step 310.

[0064] Step 308: Attenuate the statistical value according to an update rule that the wake-up time shows an attenuation trend from near to far from the current time.

[0065] Step 310: According to other preset scheduling policies, select a CPU for the first process.

[0066] Step 312: If the total cumulative awakening times exceeds the preset total score threshold, determine whether the ratio of the cumulative awakening times of the first process awakened by the first node to the total cumulative awakening times exceeds the preset ratio threshold.

[0067] Step 314: If yes, schedule the first process to the CPU of the first node for execution.

[0068] Step 316: Reset the statistical value to the initial value.

[0069] If not, go to step 308 - step 310 .

[0070] For example, combining Figure 2 The process wake-up relationship diagram is shown in Figure 1. Before selecting the CPU, the statistics corresponding to process 3 can be updated. For example, Figure 4As shown in the schematic diagram of statistical information, each process under the NUMA architecture has corresponding statistical information of the wake-up relationship with all nodes. The statistical information records the cumulative wake-up times of the CPU on the node waking up the current process and the total cumulative wake-up times of the current process being awakened. When process 2 wakes up process 3, since process 2 is located on node0, the statistical information corresponding to process 3 is updated, and the update includes the cumulative wake-up times of node0 and the total cumulative wake-up times of all nodes. After the update, it is determined whether the total cumulative wake-up times of process 3 being awakened by all nodes exceeds the threshold. If so, proceed to the above step 312, otherwise go to step 308. In step 312, it is determined whether the ratio of the cumulative wake-up times of process 3 corresponding to node0 to the total cumulative wake-up times of process 3 being awakened exceeds the threshold. If so, it means that most of the processes that wake up process 3 are on node0, then the CPU located on node0 can be selected for process 3 through the above step 314, if not, proceed to the above step 308.

[0071] It can be seen that based on the multiple embodiments provided in the embodiments of this specification, since the wake-up statistics at the node level are performed, the node-level statistical information is provided to the scheduler when selecting the CPU for decision-making, so that it can better judge which node is most suitable for scheduling the process, and realize the identification of cross-node wake-up relationships. And scheduling the process to the node that wakes up most frequently makes the information transmission after wake-up have the advantage of memory access, and can make full use of the advantages of memory access and CACHE within the node. In the case that the scheduling based on wake-up statistics is unsuccessful, the statistical information can also be attenuated according to the timeliness to avoid excessive proportion of historical statistics and ensure timeliness. In the case of successful scheduling based on wake-up statistics, the initial value of the statistics is reset to avoid cyclic triggering, thereby improving the performance of the system as a whole.

[0072] Corresponding to the above method embodiment, this specification also provides an embodiment of a device for scheduling a process, and the device is configured in a kernel scheduler under a NUMA architecture. Figure 5 FIG. 1 shows a schematic diagram of a device for scheduling a process according to an embodiment of the present specification. Figure 5 As shown, the device includes: a wake-up frequency updating module 502 , a scheduling determination module 504 and a scheduling execution module 506 .

[0073] The wakeup frequency updating module 502 may be configured to update the wakeup frequency of the first process corresponding to the first node using the wakeup data of previous wakeups of the first process by the first node in response to the first process being awakened by the process on the first node.

[0074] The wake-up data may include any relevant data that can show the frequency of wake-ups recorded according to the implementation scenario, and the embodiments of this specification are not limited to this. For example, the wake-up data may include: the number of wake-ups, or the wake-up time corresponding to each wake-up.

[0075] The scheduling determination module 504 may be configured to determine whether the wake-up frequency satisfies a preset scheduling condition.

[0076] The scheduling execution module 506 may be configured to schedule the first process to the CPU of the first node for execution if yes.

[0077] It can be seen that since the device responds to the first process being awakened by the process on the first node, the awakening data of the previous awakenings of the first process by the first node is used to update the awakening frequency of the first process corresponding to the first node, and judge whether the awakening frequency meets the preset scheduling conditions, thereby judging whether the first process has a significant awakening relationship on the first node through the awakening frequency. Since a significant awakening relationship often implies information exchange between subsequent processes, scheduling the process to run on a node with a significant awakening relationship can reduce cross-node information transmission, and can also make full use of cache affinity and internal resources of the same node, saving communication overhead such as cross-node memory access. Therefore, when it is determined that the awakening frequency meets the preset scheduling conditions, the first process can be scheduled to the CPU of the first node for execution, thereby effectively improving the overall performance of the system.

[0078] Figure 6 FIG. 2 shows a schematic diagram of a device for scheduling a process according to another embodiment of the present specification. Figure 6 As shown, the wake-up frequency updating module 502 may include:

[0079] The node score calculation submodule 5022 may be configured to obtain the score of the first process corresponding to the first node by using the previous wakeup data of the first process being woken up by the process on the first node.

[0080] The total score calculation submodule 5024 may be configured to obtain the total score of the first process by using the total wakeup data of the first process being woken up by each node under the NUMA architecture.

[0081] The ratio calculation submodule 5026 may be configured to calculate the ratio of the score of the first process corresponding to the first node to the total score of the first process to obtain the wake-up frequency.

[0082] In this embodiment, the wake-up frequency is obtained by calculating the ratio of the score of the first process corresponding to the first node to the total score of the first process, so that the wake-up frequency of the first process corresponding to the first node in all nodes under the NUMA architecture can be accurately evaluated, making the calculated wake-up frequency more accurate.

[0083] It should be noted that, based on this implementation, the method for determining whether the preset scheduling condition is met is not limited. Figure 6 As shown, the scheduling determination module 504 may be configured to determine whether the total score of the first process is greater than a preset total score threshold and the ratio is greater than a preset ratio threshold.

[0084] Because the previously accumulated wake-up data has completed its evaluation function in the scheduling of the first process when the first process is scheduled to the CPU of the first node for execution, continued accumulation may cause a cyclic triggering of the scheduling of the first process to the first node for execution. In order to avoid the waste of computing resources caused by the cyclic triggering, in one or more embodiments of the present specification, Figure 6 As shown, the device may also include: a reset module 508, which can be configured to reset the wake-up data used to update the wake-up frequency of the first process corresponding to the first node to an initial state when the scheduling execution module 506 schedules the first process to the CPU of the first node for execution.

[0085] Considering that when the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling condition, the previous wake-up data will continue to be accumulated, and the timeliness of the wake-up data to the wake-up frequency will gradually decay due to the change in the length of the wake-up time from the current time, therefore, in one or more embodiments of this specification, if Figure 6 As shown, the device may also include: a wake-up data update module 510, which can be configured to update the previous wake-up data according to an update rule in which the wake-up data show a decaying trend from near to far from the current time when the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions.

[0086] like Figure 6 As shown, the wake-up data update module 510 can be configured to multiply each wake-up data in the previous wake-up data by a corresponding weight to obtain updated previous wake-up data, wherein the weight is taken in a decaying manner from near to far according to the distance between the corresponding wake-up time and the current time; or, the wake-up data whose corresponding wake-up time in the previous wake-up data is longer than a preset effective time from the current time is deleted from the previous wake-up data.

[0087] The above is a schematic scheme of a device for scheduling processes of this embodiment. It should be noted that the technical scheme of the device for scheduling processes and the technical scheme of the method for scheduling processes described above are of the same concept, and the details of the technical scheme of the device for scheduling processes that are not described in detail can be found in the description of the technical scheme of the method for scheduling processes described above.

[0088] Figure 7 The block diagram of a computing device 700 according to an embodiment of the present specification is shown. The components of the computing device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.

[0089] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0090] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0091] The computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 700 may also be a mobile or stationary server.

[0092] The processor 720 is used to execute the following computer executable instructions:

[0093] In response to a first process being awakened by a process on a first node, updating the awakening frequency of the first process corresponding to the first node using the awakening data of all the times the first process is awakened by the first node;

[0094] Determining whether the wake-up frequency meets a preset scheduling condition;

[0095] If yes, the first process is scheduled to the CPU of the first node for execution.

[0096] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned method for scheduling processes are of the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned method for scheduling processes.

[0097] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which are used when executed by a processor to:

[0098] In response to a first process being awakened by a process on a first node, updating the awakening frequency of the first process corresponding to the first node using the awakening data of all the times the first process is awakened by the first node;

[0099] Determining whether the wake-up frequency meets a preset scheduling condition;

[0100] If yes, the first process is scheduled to the CPU of the first node for execution.

[0101] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned method for scheduling processes belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned method for scheduling processes.

[0102] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0103] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0104] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A method for scheduling a process, applied to a kernel scheduler under a NUMA architecture, comprising: In response to a first process being awakened by a process on a first node, updating the awakening frequency of the first process corresponding to the first node using the awakening data of all the times the first process is awakened by the first node; Determining whether the wake-up frequency meets a preset scheduling condition; If yes, scheduling the first process to be executed by the CPU of the first node; When the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions, the wake-up data are updated according to the timeliness of the wake-up frequency and the update rule that the wake-up time shows a decaying trend from near to far from the current time, so as to achieve accurate evaluation of the wake-up frequency.

2. According to the method of claim 1, the updating of the wake-up frequency of the first process corresponding to the first node by using the wake-up data of each time the first process is awakened by the first node comprises: Using the previous awakening data of the first process being awakened by the process on the first node, obtaining the score of the first process corresponding to the first node; Obtain a total score of the first process by using total wakeup data of the first process being woken up by each node under the NUMA architecture; The wake-up frequency is obtained by calculating a ratio of a score of the first process corresponding to the first node to a total score of the first process.

3. According to the method of claim 2, the determining whether the wake-up frequency meets the preset scheduling condition comprises: It is determined whether the total score of the first process is greater than a preset total score threshold and the ratio is greater than a preset ratio threshold.

4. The method according to claim 1, further comprising: When the first process is scheduled to be executed by the CPU of the first node, the wakeup data used to update the wakeup frequency of the first process corresponding to the first node is reset to an initial state.

5. The method according to claim 1, wherein the updating of the previous wake-up data according to the timeliness of the previous wake-up data to the wake-up frequency and in accordance with the updating rule that the wake-up time is attenuated from near to far from the current time comprises: Multiply each wake-up data in the previous wake-up data by a corresponding weight to obtain updated previous wake-up data, wherein the weight is taken in a decaying manner from near to far according to the distance of the corresponding wake-up time to the current time; or, The wake-up data whose corresponding wake-up time in the previous wake-up data is longer than the preset effective time from the current time is deleted from the previous wake-up data.

6. The method according to any one of claims 1 to 5, wherein the wake-up data comprises: The number of wake-ups or the corresponding wake-up time for each wake-up.

7. A device for scheduling a process, configured in a kernel scheduler under a NUMA architecture, comprising: a wakeup frequency updating module configured to update the wakeup frequency of the first process corresponding to the first node using the wakeup data of all the times the first process is awakened by the first node in response to the first process being awakened by the process on the first node; A scheduling determination module is configured to determine whether the wake-up frequency meets a preset scheduling condition; a scheduling execution module, configured to schedule the first process to the CPU of the first node for execution if yes; The wake-up data update module is configured to update the previous wake-up data according to the timeliness of the previous wake-up data for the wake-up frequency and according to the update rule that the wake-up time shows a decaying trend from near to far from the current time, so as to achieve accurate evaluation of the wake-up frequency when the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions.

8. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions: In response to a first process being awakened by a process on a first node, updating the awakening frequency of the first process corresponding to the first node using the awakening data of all the times the first process is awakened by the first node; Determining whether the wake-up frequency meets a preset scheduling condition; If yes, scheduling the first process to be executed by the CPU of the first node; When the wake-up frequency of the first process corresponding to the first node does not meet the preset scheduling conditions, the wake-up data are updated according to the timeliness of the wake-up frequency and the update rule that the wake-up time shows a decaying trend from near to far from the current time, so as to achieve accurate evaluation of the wake-up frequency.

9. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the method for scheduling a process as described in any one of claims 1 to 8.