Changes between Version 26 and Version 27 of processus_thread


Ignore:
Timestamp:
Jul 16, 2016, 1:46:11 PM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v26 v27  
    2525- '''PPID''' : parent process identifier,
    2626- '''PREF''' : extended pointer on the reference process descriptor.
    27 - '''VMM''' : virtual memory manager containing the PG_TBL and the VSEG_LIST.
     27- '''VSEG_LIST''' : root of the local list of virtual segments defining the memory image.
     28- '''PG_TBL''' : page table defining the physical memory mapping.
    2829- '''FD_TBL''' : open file descriptors table.
    2930- '''TH_TBL''' : local table of threads owned by this process in this cluster.
     
    7273
    7374The process creation in a remote cluster implement the POSIX fork / exec  mechanism.
    74 Notice that ALMOS-MK implements  one private scheduler per processor core.
     75When a parent process P executes the fork() system call, a new child process C is created.
     76The new F process inherit from the parent process P the open files (FD_TBL), and the memory image (VSEG_LIST and PG_TBL), and the corresponding structures must be replicated in the new process descriptor. After a fork(), the C process can execute an exec() system call, that allocate a new memory image to the C process, but the new process can also continue to execute with the inherited memory image. For load balancing, ALMOS-MK  uses the DQDT to create the child process C on a different cluster from the parent cluster P.
     77Therefore, P and C have usually different owner clusters.
    7578
    7679=== 3.1) fork() ===
    7780
    78 The parent process P is running on a core in cluster K, and executes the fork() system call to create a new process F on a remote cluster Z that will  become the owner of the F process. It is selected by the kernel using the DQDT. Cluster K will contain the reference process descriptor. The fork() system call execute the following steps:
     81The parent process P is running on a core in cluster K, and executes the fork() system call to create a new process C on a remote cluster Z that will  become the owner of the C process. ALMOS-MK creates the first C process descriptor in the same cluster as the parent cluster P, and postpone the costly copy of page table from P to C, because this copy is useless in case of exec(). When the fork() system call returns, the C process owner cluster is Z, but the reference process descriptor is in cluster K. The child process and the associated main thread will be migrated to the target cluster later, when the child process makes an "exec" or any other system call.
    7982
    80  1. the cluster K allocates memory in K to store the reference process descriptor of F, and get a pointer on this process descriptor using the process_alloc() function.
    81  1. the cluster K ask to kernel Z to allocate a PID for the F process, and to register the process descriptor extended pointer in PREF_TBL(Z) of cluster Z manager. This is done by the RPC_PROCESS_PID_ALLOC that takes the process descriptor pointer as argument and returns the PID.
     83 1. the cluster K allocates memory in K for the reference process descriptor of c, and get a pointer on this process descriptor using the process_alloc() function.
     84 1. the cluster K ask to kernel Z to allocate a PID for the F process, and to register the process descriptor extended pointer in its PREF_TBL(Z). It uses the RPC_PROCESS_PID_ALLOC that takes the process descriptor pointer as argument and returns the PID.
    8285 1. after RPC completion, the kernel K initializes the F process descriptor from informations found in the P parent process descriptor. This includes the inherited ...
    8386 1. the kernel K creates locally the main thread of process F, and register this thread in the TH_TBL(K,P),
     
    8992
    9093After a fork() system call, the F process can execute an exec() system call. This system call forces the F process to migrate from the K cluster to the owner cluster Z, to execute a new code, while keeping the same PID. Therefore a new reference process descriptor must be created in  the Z cluster, and initialized. The Z cluster  will become both the owner and the reference cluster of the F process. The old reference process descriptor in K must be deleted.
    91 The exec() system call  execute the following steps:
    92  1. The kernel K send an RPC_PROCESS_MIGRATE to cluster Z. The argument is the extended pointer on the F process descriptor in cluster K.
     94The exec() system call  executes the following steps:
     95 1. The kernel K send an RPC_PROCESS_MIGRATE to cluster Z. The argument are the extended pointer on the F process descriptor in cluster K.
    9396 1. To execute this RPC, the kernel Z allocates a new reference process descriptor in cluster Z, and initializes it from informations found in process descriptor in cluster K, using a remote_memcpy().
    9497 1. The kernel Z allocates and initializes the  structures contained in the process VMM: PG_TBL(Z,F), VSEG_LIST(Z,F).
    9598 1. The kernel Z creates the main thread associated to process P in cluster Z, initializes it, and register it in the TH_TBL(Z,P).
    96  1. The kernel Z registers this thread in the scheduler of the core selected by the Z kernel an acknowledges the RPC. When this thread starts execution, the binary code will be loaded in the kernel Z memory, as required by the page faults.
     99 1. The kernel Z registers this thread in the scheduler of the core selected by the Z kernel and acknowledges the RPC.
    97100 1. When receiving the RPC acknowledge, the kernel K destroy the F process descriptor and the associated thread in cluster K, that is not anymore involved in process F execution.
    98101