Process migration method, device, computing device and storage medium
By layering the load of the process and task in a multi-core SMP system, we prioritize the migration of newly added low-load processes due to the impact of low-load processes in the background, and improve system performance and cache utilization rate .
Patent Information
- Application Number
- CN202110738697.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-06-30
AI Technical Summary
In multi-core SMP systems, existing process migration methods will cause high-load processes to migrate across processors or memory nodes in full load scenarios due to low-load processes in the background, resulting in cache failure and affecting the performance of high-load processes.
By dividing processes into active and inactive processes in computing devices, layering loads based on real load and task tasks, priority is given to migrating newly added low-load processes, avoiding migration of high-real load processes, and ensuring the performance of high-load processes.
Reduces the impact of background processes on the main process, avoids migration across processors or memory nodes, and improves cache utilization and program operation performance.
Smart Images

Figure CN113326140B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet, and in particular to a process migration method, device, computing equipment and storage medium. Background Art
[0002] In a multi-core SMP (symmetric multiprocessor) system, reasonable task scheduling is an important prerequisite for unleashing the potential of the multi-core system. Multi-core scheduling currently runs a process queue on each processor. In addition, a process in an executable state can be added to other running queues to achieve load balancing between processors and avoid the situation where some processors are busy and others are idle.
[0003] The current load balancing implementation uses task hierarchical load (task_h_load), which considers the load contribution of the current process to the current processor and determines whether a task meets the migration conditions based on the size of the task hierarchical load. However, the existing process migration method has the following problems: in a full-load scenario, a high-load process may be affected by a background low-load process and migrate across processors or even memory nodes, causing serious cache failures, which in turn affects the normal performance of the high-load process. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a process migration method, apparatus, computing device and storage medium that overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of the present invention, there is provided a process migration method which is executed in a computing device, the method comprising: dividing each process into an active process or an inactive process based on the actual load of each process in the processor; determining whether the active process is the only active process in the processor; if it is not the only active process, determining the task hierarchical load of the process in sequence; and migrating the process to other processors when the task hierarchical load of the process meets a preset condition.
[0006] Optionally, in the process migration method according to the present invention, if it is not the only active process, the step of determining the task hierarchical load of the process in sequence includes: polling a linked list storing the processes in the processor to obtain the order in which the processes are added; and determining the task hierarchical load of the processes in sequence according to the order in which the processes are added from the back to the front.
[0007] Optionally, in the process migration method according to the present invention, after the step of dividing each process into an active process or an inactive process based on the actual load of each process in the processor, the method further includes the step of counting the number of active processes in the processor.
[0008] Optionally, in the process migration method according to the present invention, the step of calculating the real load includes: respectively obtaining time information of each process in a working state and in a non-working state; and calculating the real load of each process based on the time information.
[0009] Optionally, in the process migration method according to the present invention, the step of calculating the task hierarchical load includes: obtaining the number of processors in the corresponding group of the process; obtaining the process load of the process in the corresponding group; and taking the ratio of the process load to the number of processors as the task hierarchical load of the process.
[0010] Optionally, in the process migration method according to the present invention, the step of dividing each process into an active process or an inactive process based on the actual load of each process in the processor includes: if the actual load of the process is greater than a preset load threshold, the process is determined to be an active process; otherwise, the process is determined to be an inactive process.
[0011] Optionally, in the process migration method according to the present invention, when the task layered load of the process meets the preset conditions, the step of migrating the process to other processors includes: determining whether the task layered load of the process is less than half of the load imbalance value; if so, migrating the process to other processors.
[0012] According to another aspect of the present invention, a process migration device is provided, which includes: a process status determination module, suitable for dividing each process into an active process or an inactive process based on the actual load of each process in the processor; a judgment module, suitable for judging whether the active process is the only active process in the processor; a process task hierarchical load determination module, suitable for sequentially determining the task hierarchical load of the process; and a process migration module, suitable for migrating the process to other processors.
[0013] According to another aspect of the present invention, there is provided a computing device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for being executed by the at least one processor, and the program instructions include instructions for executing the above method.
[0014] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the above method.
[0015] According to the solution of the present invention, the dual effects of the process's task real load and task hierarchical load are comprehensively considered. When there is only one process with a high real load on the processor, the low-load process newly added to the processor is migrated first to avoid migrating the high-real load process, thereby ensuring the normal performance of the high-load process.
[0016] According to the solution of the present invention, in a full-thread use case scenario, the impact of background processes on the main process is reduced, and the main process will not be affected by the background and will not migrate across processors or even across memory nodes. At this time, the cache memory utilization rate is the highest and the program running performance is also the best.
[0017] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0019] Figure 1 A schematic diagram 100 showing the principle of process migration;
[0020] Figure 2 A flow chart of a process migration method 200 in the prior art is shown;
[0021] Figure 3 A schematic diagram of a computing device 300 according to one embodiment of the present invention is shown;
[0022] Figure 4 A flowchart of a process migration method 400 according to an embodiment of the present invention is shown.
[0023] Figure 5 A structural diagram of a process migration device 500 according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0025] An important part of load balancing is how to select the appropriate process for migration in the processor process queue. Specifically, the load of the processor process queue is the sum of the loads of all processes on the process queue. The load of a process is related to the actual running time of the process. Basically, the longer the continuous running time, the higher the load. Therefore, the goal of load balancing is to make the best use of processor computing resources so that each process can get sufficient processor time. In order to achieve this goal, it is necessary to select appropriate processes (generally, processes with smaller loads are more likely to meet the migration conditions) from busy processors with more processes in the running queue and larger total loads and migrate them to relatively idle processors.
[0026] like Figure 1 As shown, Figure 1 The schematic diagram 100 of the process migration principle is shown, the processes running in processor 0 are process 1, process 2 and process 3, and the processes running in processor 1 are process 4. Compared with processor 1, processor 0 is a busy processor, and at this time, for example, process 3 in processor 0 can be migrated to processor 1, so as to achieve system load balancing.
[0027] Figure 2 A flowchart of a method 200 for implementing process migration in the prior art is shown. After starting the process migration process, each process on the busy processor is first polled in order. Then, it is determined whether the task layered load of the process meets the migration requirements. Finally, the process that meets the migration requirements is migrated from the busy processor to the idle processor. The process migration method uses the task layered load, that is, considering the load contribution brought by the current process to the current processor, and judging whether a task meets the migration conditions according to the size of the task layered load.
[0028] When group scheduling is enabled, the more tasks are running in the same group, the more tasks are averaged over a processor because the weight of a task group is at the default value when not actively adjusted. This results in the hierarchical load of tasks (task_h_load) = task load / number of CPUs. In this case, the background process load may be greater than or equal to the worker process load.
[0029] In a specific example, after group scheduling is enabled, full threads run the specified program.
[0030] Process 1 (continuously running user process):
[0031] Located in task group A, there are 10 processes in the group, distributed on 10 processors;
[0032] Process load task_load = 1000;
[0033] Then the hierarchical load of the process task_h_load=1000 / 10=100.
[0034] Process 2 (a periodically running background process):
[0035] Located in task group B, there is a total of 1 process in the group, distributed on 1 processor;
[0036] Process load task_load = 120;
[0037] Then the hierarchical load of the process task_h_load=120 / 1=120.
[0038] At this time, the hierarchical load of the background process is greater than or equal to the hierarchical load of the working process. As mentioned above, processes with a smaller load are more likely to meet the migration conditions. Moreover, when multiple tasks on a processor meet the migration conditions, they are migrated in the order in which the tasks are added to the run queue. The processes that are added to the run queue first are prioritized, so generally, the continuously running user processes will be migrated. In a full-load scenario, a high-load process may be affected by a low-load background process and migrate across processors or even memory nodes, which will cause serious cache failures and affect the normal performance of the high-load process.
[0039] In order to solve the problems existing in the above-mentioned prior art, the technical solution of the present invention is proposed. An embodiment of the present invention provides a process migration method, which can be executed in a computing device. Specifically, Figure 3 FIG. 3 shows a block diagram of a computing device 300 according to an embodiment of the present invention. Figure 3 As shown, in a basic configuration 302, computing device 300 typically includes system memory 306 and one or more processors 304. A memory bus 308 may be used for communication between processor 304 and system memory 306.
[0040] Depending on the desired configuration, the processor 304 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 304 can include one or more levels of cache such as a first-level cache 310 and a second-level cache 312, a processor core 314, and registers 316. An example processor core 314 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 318 can be used with the processor 304, or in some implementations, the memory controller 318 can be an internal part of the processor 304.
[0041] Depending on the desired configuration, the system memory 306 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the computing device usually refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 304. The system memory 306 may include an operating system 320, one or more applications 322, and program data 324. The application 322 is actually a plurality of program instructions, which are used to instruct the processor 304 to perform corresponding operations. In some embodiments, in some embodiments, the application 322 may be arranged to execute instructions on the operating system by one or more processors 304 using program data 324. The operating system 320 may be, for example, Linux, Windows, etc., which includes program instructions for processing basic system services and performing tasks that depend on hardware. The application 322 includes program instructions for implementing various user-desired functions, and the application 322 may be, for example, a browser, instant messaging software, a software development tool (such as an integrated development environment IDE, a compiler, etc.), etc., but is not limited thereto. When the application 322 is installed into the computing device 300 , a driver module may be added to the operating system 320 .
[0042] When the computing device 300 starts running, the processor 304 reads and executes the program instructions of the operating system 320 from the memory 306. The application 322 runs on the operating system 320 and uses the interface provided by the operating system 320 and the underlying hardware to implement various functions desired by the user. When the user starts the application 322, the application 322 is loaded into the memory 306, and the processor 304 reads and executes the program instructions of the application 322 from the memory 306.
[0043] The computing device 300 also includes a storage device 332 , which includes a removable storage 336 and a non-removable storage 338 , both of which are connected to the storage interface bus 334 .
[0044] The computing device 300 may also include an interface bus 340 that facilitates communication from various interface devices (e.g., output devices 342, peripheral interfaces 344, and communication devices 346) to the basic configuration 302 via the bus / interface controller 330. Example output devices 342 include a graphics processing unit 348 and an audio processing unit 350. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 352. Example peripheral interfaces 344 may include a serial interface controller 354 and a parallel interface controller 356, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 358. Example communication devices 346 may include a network controller 360, which may be arranged to facilitate communication with one or more other computing devices 362 via a network communication link via one or more communication ports 364.
[0045] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0046] The computing device 300 also includes a storage interface bus 334 connected to the bus / interface controller 330. The storage interface bus 334 is connected to a storage device 332, which is suitable for data storage. Example storage devices 332 may include removable storage 336 (such as CD, DVD, USB flash drive, removable hard disk, etc.) and non-removable storage 338 (such as hard disk drive HDD, etc.).
[0047] In the computing device 300 according to the present invention, the application 322 includes a plurality of program instructions for executing the method 400 .
[0048] Figure 4 The flowchart of a process migration method 400 according to one embodiment of the present invention is shown. The method 400 is suitable for being executed in a computing device (such as the aforementioned computing device 300).
[0049] like Figure 4 As shown, the purpose of method 400 is to implement a process migration method, which starts at step S402. In step S402, each process is divided into an active process or an inactive process based on the actual load of each process in the processor.
[0050] It should be noted that according to an embodiment of the present invention, before the execution of step S402, it has been determined that there is a load imbalance in the computing device and the process on the processor needs to be migrated. The judgment of the load imbalance can be obtained based on the aforementioned content or the existing load balancing strategy and will not be repeated here.
[0051] It should also be noted that the process migration method provided in this embodiment is applicable to the scenario where each process runs at full load or close to full load in the processor, that is, the occupancy rate of the processor is close to 100%.
[0052] Preferably, the real load of the process can be calculated through the following steps.
[0053] Step S422: respectively obtain the time information of each process in the working state and in the non-working state.
[0054] Exemplarily, the process runs intermittently. After running for a period of time, the processor will stop running the process for a period of time and switch to running other processes. When other processes are stopped, the processor will run the process again. The time that the process is in the working state is the running time of the process.
[0055] In step S424, the real load of each process is calculated based on the time information.
[0056] The process load is the accumulation of multiple running times, and the load in the previous running time needs to be attenuated. The attenuation coefficient is related to the time that the process is in a non-working state.
[0057] The real load is calculated based on the time the process spends in each running interval and the attenuation coefficient of each running interval. For example, before the current time, the process has run for a total of 3 time intervals, then the real load of the process = (first time interval * first attenuation coefficient) + (second time interval * second attenuation coefficient) + (third time interval * third attenuation coefficient).
[0058] After obtaining the real load of the process, it is compared with the preset load threshold. When the real load of the process is greater than the load threshold, the process is judged to be an active process, otherwise it is an inactive process. The setting of the load threshold can be set by those skilled in the art or according to the properties of the computing device, and this embodiment does not limit this.
[0059] In step S404, it is determined whether the active process is the only active process in the processor. In step S402, the status of each process in the processor (active process or inactive process) has been determined by the real load of each process, and it can be directly determined whether the target process is the only active process in the processor.
[0060] It should be noted that when the process is the only active process in the processor, the process is directly skipped. In other words, when the process is the only process in the processor, migration of the process is abandoned.
[0061] Of course, in order to facilitate determining the number of active processes in the processor, the number of active processes in the processor may be counted before executing step S404.
[0062] In step S406, if it is not the only active process, the task layer load of the process is determined in sequence. The task layer load of each process on the processor is determined by polling, starting from the process that joins the run queue later.
[0063] Specifically, a linked list storing each process in the processor is polled to obtain the order in which each process is added; and the task hierarchical load of the process is determined in sequence according to the order in which each process is added from the back to the front.
[0064] After a process joins the process queue, it will be placed at the head of the specified linked list. Therefore, by polling from the head of the linked list, the process can be polled according to the time it joined the process queue. In other words, the order in which the processes are added can be known by polling the linked list.
[0065] In some embodiments, the steps for calculating the task load of each process are as follows: obtain the number of processors in the corresponding group of the process; obtain the process load of the process in the corresponding group; and use the ratio of the process load to the number of processors as the task hierarchical load of the process.
[0066] It should be noted that the calculation steps of the task load are applicable to the scenario where each process in the group runs at full load or close to full load on the processor.
[0067] In a specific example, the calculation formula of the conventional task layer load is as follows:
[0068] Task layer load = actual load of the process * relative top-level load of the parent queue / parent queue load;
[0069] Therefore, task layer load / task real load = parent queue relative top load / parent queue load = current cpu group entity weight / 1024 = current process load / total load of all processes in the group;
[0070] So when each process is running at full capacity, the load is the same, and the current process load / total load of all processes in the group is approximately 1 / total number of processors.
[0071] In other words, when each process in the group runs at full load or close to full load on the processor, the load of each process in the group is the same, then the task layered load of each process = process load / number of processors for the process in the corresponding group.
[0072] In a specific example, the process is in task group 0, which is distributed on 5 processors in total, and each process in task group 0 is running at full load. The load of the process = 10; then the task layer load of the process = 10 / 5 = 2.
[0073] In step S408, when the task layer load of the process meets a preset condition, the process is migrated to other processors.
[0074] Specifically, a load imbalance value is calculated according to the current load value of the computing device, and it is determined whether the task layer load of the process is less than half of the load imbalance value. If so, the process is migrated to other processors.
[0075] It should be noted that the load value of the computing device is not a fixed value, it changes with the running of each process, so the load imbalance value also changes from time to time. In short, the smaller the task layer load, the easier it is to meet the migration conditions.
[0076] Figure 5 A structural diagram of a process migration device 500 according to an embodiment of the present invention is shown.
[0077] like Figure 5 As shown, the device 500 includes a state determination module, which is suitable for dividing each process into an active process or an inactive process based on the actual load of each process in the processor; a judgment module, which is suitable for judging whether the active process is the only active process in the processor; a task hierarchical load determination module, which is suitable for sequentially determining the task hierarchical load of the process; and a migration module, which is suitable for migrating the process to other processors.
[0078] It should be noted that the principle and workflow of the process migration device provided in this embodiment are similar to those of the aforementioned process migration method. For relevant details, reference may be made to the description of the aforementioned process migration method, which will not be repeated here.
[0079] This embodiment comprehensively considers the dual impact of the real load of the task and the hierarchical load of the task in the load balancing task migration standard. When there is only one process with a high real load on the processor, the low-load process newly added to the processor is migrated first. In the full-thread use case scenario, the impact of the background process on the main process is reduced, and the main process will not be affected by the background and migrate across processors or even memory nodes. At this time, the cache memory utilization rate is the highest and the program running performance is the best.
[0080] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0081] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the method of the present invention according to the instructions in the program code stored in the memory.
[0082] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0083] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the preferred embodiment of the present invention.
[0084] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0085] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0086] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0087] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0088] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0089] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0090] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0091] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative and not restrictive with respect to the scope of the present invention, and the scope of the present invention is defined by the appended claims.
Claims
1. A process migration method, executed in a computing device, wherein a plurality of processors reside in the computing device, the method comprising: Based on the actual load of each process in the processor, classify the processes into active processes or inactive processes; determining whether the active process is the only active process in the processor; If it is not the only active process, the task hierarchical load of the process is determined in sequence, and the calculation step of the task hierarchical load includes: obtaining the number of processors in the corresponding group of the process, obtaining the process load of the process in the corresponding group, and taking the ratio of the process load to the number of processors as the task hierarchical load of the process; When the task layer load of the process meets a preset condition, the process is migrated to other processors.
2. The method of claim 1, wherein: If the process is not the only active process, the step of sequentially determining the task hierarchical load of the process comprises: Polling a linked list storing each process in the processor to obtain the order in which each process is added; According to the order in which each process is added from the back to the front, the task layering load of the process is determined in sequence.
3. The method of claim 1, wherein: After the step of classifying each process into an active process or an inactive process based on the real load of each process in the processor, the step further includes: Count the number of active processes in the processor.
4. The method of claim 1, wherein: The steps of calculating the real load include: Obtain the time information of each process in the working state and in the non-working state respectively; Based on the time information, the real load of each process is calculated.
5. The method of claim 1, wherein: The step of classifying each process into an active process or an inactive process based on the real load of each process in the processor includes: If the actual load of the process is greater than the preset load threshold, the process is determined to be an active process; SPE2 Otherwise, the process is determined to be an inactive process.
6. The method of claim 2, wherein: When the task layered load of the process meets the preset conditions, the step of migrating the process to other processors includes: Calculating a load imbalance value according to a current load value of the computing device; Determining whether the task hierarchical load of the process is less than half of the load imbalance value; If so, the process is migrated to another processor.
7. A process migration device, comprising: a state determination module adapted to classify each process in the processor as an active process or an inactive process based on the actual load of each process in the processor; a determination module, adapted to determine whether the active process is the only active process in the processor; The task hierarchical load determination module is adapted to sequentially determine the task hierarchical load of a process, wherein the calculation step of the task hierarchical load comprises: obtaining the number of processors in a corresponding group of a process, obtaining the process load of the process in the corresponding group, and taking the ratio of the process load to the number of processors as the task hierarchical load of the process; as well as A migration module is adapted to migrate the process to other processors.
8. A computing device comprising: at least one processor; and A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 6.
9. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 6.
