1 purpose of process migration
One of the characteristics of distributed systems is to allow information to move through the system, but some systems only allow data (files, database records, etc.) to migrate in the system, and some systems allow only those tasks that have not yet started to be migrated, some systems allow the running of tasks to be migrated, and the last is called "Process migration". Process migration is a distributed system of loose coupling that transmits processes running on a processor (the source processor) to another processing machine (the destination processor) and enables the process to continue running from a "breakpoint" on the destination machine. In the distributed operating system, process migration can improve the load balancing and fault tolerance of the system, reduce the communication load and so on.
Achieve load balancing. One way to improve the overall performance of distributed system is to distribute the system load evenly to each processor in the system, that is, to realize dynamic load balancing or dynamic load sharing, which can improve the degree of parallelism and speed of the system and improve the overall performance of the system.
achieve high efficiency fault tolerance. In a distributed system, when a host fails, it is necessary to migrate the process that the host is running. Otherwise, if the host is running some critical processes, this can cause system task errors to run, the consequences will be disastrous. 2 process Migration mechanism
In order to realize the process migration, the corresponding process migration mechanism must be established in the distributed system. The mechanism should address such issues as who should initiate the process migration, what parts of the process should be migrated, and how the migration should be carried out, and what should be done about the unfinished message and messages. 2.1 Start of process migration
Who initiates the process migration, depending on the objectives to be achieved when designing the process migration mechanism, is discussed in two different situations.
If the goal is to balance the load, in the process migration mechanism, the system load monitoring module should be configured for each system, and one of the main control modules should be specified. The main control module periodically interacts with the monitoring modules in each system for information on system load conditions. When it finds that some systems are very busy and many processes are waiting to be processed while some systems are idle, the master Load monitoring module can initiate a process migration, which sends commands to heavily loaded systems that migrate several of these processes to a lighter-load system.
If the goal of a process migration is to get the special resources it needs for the migrated process, the migration can be initiated by a process that requires special resources. At this point, it is up to the process to ask which system the particular resource is needed, and which system the process itself wishes to migrate to. This migration, which is determined by the process itself, is called self-migration. 2.2 Process Migration Process
When a process is migrated, the migrated processes in the source system should be undone, and a new process is established in the target system, the so-called process migration, not process replication. Therefore, the process image includes at least the process control block that must be migrated, and any links between the process and other processes must also be updated.
The movement of the Process Control block is simple, and from an execution perspective, the difficulty lies in the address space of the process and the files that the process opens. Assuming that the process address space uses segmented or paged virtual storage policies, there are two workarounds: one is to transfer the entire address space on the migration, and no information about the process is found on the original system, but if the process is not the majority of the address space, this approach may be too expensive The second is to transfer only those parts of the address space in main memory, and the segments in the virtual space are transmitted only when needed, which minimizes the amount of data being transmitted, but requires the source processor to constantly modify the Segment table or page table during the lifetime of the process. 2.3 Algorithm for process migration
At present, the process migration algorithm mainly includes greedy copy algorithm, lazy copy algorithm and pre-copy algorithm. The different points of these algorithms are mainly embodied in three aspects: how many states need to be transferred from the source host to the target host, when to suspend the process running on the source host, and when to start the process on the target host. 2.3.1 Greedy copy algorithm (Eager copy)
The algorithm first hangs the origin host process, then the entire state of the transfer process (including some open files, execution status, etc.) to the target host, and then start the target host process. This algorithm is simple and easy to implement, but there are two shortcomings: long delay, which is unacceptable to the real-time system, some redundant data transfer to the target host, the actual is not used, causing the network burden. 2.3.2 Lazy Copy algorithm (lazy copy)
The algorithm first transmits the minimum related information required for the process to be re-executed on the target host. Rather than a greedy copy algorithm, it transmits the minimum number of state collections required and then starts on the host. This information is typically part or all of a process's core data and a small (two or three-page) address space. This information is then transmitted when the process executes the remaining state information on the target host. The advantages are: small delay, less network burden. Its disadvantage is that the copy algorithm leads to the residual dependence on the source host, so it can't improve the reliability of the system. 2.3.3 Pre-copy algorithm (pre-copy)
Unlike the previous two algorithms, the pre-copy algorithm suspends the process and transmits the core data when the process's part or all of the address space is transferred from the source host to the target host. That is, when the process executes on the source host, the address space is transferred to the destination host in parallel. After the process is suspended, the transferred core data (including open files, execution status, current directory, etc.) and some of the previously transferred address spaces are transferred to the target host. This creates a problem: the algorithm reduces the time it hangs, avoids the overhead and errors caused by the long suspend time, but copies some information two times, and the total transmission time increases instead. 3 Concluding remarks
Distributed system and its process migration is one of the most active research topics in the world, and its design idea is still in the further study of many scholars and scientists. Distributed system is superior to other computer systems because of its multi-machine cooperation and strong nature. Multi-machine cooperation is automatic task assignment and coordination, the strong is reflected in the system when one or several computers in the path failure, the system can continue its failure part or all of the work. Process migration is the important embodiment and means of this multi-machine cooperation and strength, which makes the system achieve high efficiency load balancing and task fault tolerance as much as possible.