7 | | Le PID (Process Identifier) est codé sur 32 bits, et il est unique dans le système : les 16 bits de poids fort contiennent |
8 | | les coordonnées (X,Y) du cluster propriétaire Z, les 16 bits de poids faibles (LPID) contiennent le numéro local dans le cluster propriétaire. |
9 | | Le cluster propriétaire est donc défini par les 16 bits de poids fort du PID. |
10 | | Le descripteur d’un processus P et les tables qui lui sont associées sont répliqués - partiellement - dans les clusters qui contiennent au moins un thread de P (appelés clusters actifs de P). |
| 7 | The PID (Process Identifier) is coded on 32 bits. It is unique in the system, and has a fixed format: The 16 MSB (CXY) contain the owner cluster identifier. The 16 LSB bits (LPID) contain the local process index in owner cluster. The '''owner cluster''' is therefore defined by PID MSB bits. |
16 | | - PID : processus identifier (contient les coordonnées du cluster propriétaire) |
17 | | - PPID : parent processus identifier, |
18 | | - XMIN, XMAX, YMIN, YMAX : recrangle recouvrant tous les clusters actifs |
19 | | - CREF : coordonnées du cluster de référence |
20 | | - PT : table des pages du processus, |
21 | | - VSL : liste des vsegs du processus, |
22 | | - FDT : table des fichiers ouverts du processus, |
23 | | - TH_TBL : liste des threads du processus, |
24 | | - ENV : variables d’environnement du processus, |
| 13 | '''Warning''' : to support process migration, the '''reference cluster''' can be different from the '''owner process'''. |
28 | | Il existe quatre types de threads : |
29 | | * un thread '''USER''' est créé suite à un appel système pthread_create(). |
30 | | * un thread '''KERNEL''' est créé pour exécuter un service système. |
31 | | * un thread '''IDLE''' est exécuté par un CPU qui ne possède aucun autre thread exécutable. |
32 | | * un thread '''RPC''' est créé et ou activé par le noyau pour exécuter une ou plusieurs RPCs. |
| 20 | The process descriptor (process_t in ALMOS-MK) contains the following informations: |
| 21 | - PID : proces identifier. |
| 22 | - PPID : parent process identifier, |
| 23 | - XMIN, XMAX, YMIN, YMAX : rectangle covering all active clusters. |
| 24 | - PREF : extended pointer on the reference process descriptor. |
| 25 | - VMM : virtual memory manager containing the PG_TBL and the VSEG_LIST. |
| 26 | - FD_TBL : open file descriptors table. |
| 27 | - TH_TBL : local table of threads owned by this process in this cluster. |
| 28 | - LOCAL_LIST : member of local list of all process descriptors in same cluster. |
| 29 | - COPIES_LIST : member of global list (globale) of all copies of same process. |
| 30 | - CHILDREN_LIST : member of global list of all children of same parent process. |
| 31 | - CHILDREN_ROOT : root of global list of children process. |
38 | | L'instance du noyau propriétaire d'un processus P attribue à un thread de P un identifiant unique dans le processus. Ce TRDID est codé sur 32 bits, |
39 | | et il indexe la table THTBL. |
| 37 | ALMOS-MK defines four types of threads : |
| 38 | * one '''USER''' thread is created by a pthread_create() system call. |
| 39 | * one '''KERNEL''' thread is dynamically created by the kernel to execute a kernel service in a cluster. |
| 40 | * one '''RPC''' thread is activated by the kernel to execute one or several pending RPC requests. |
| 41 | * the '''IDLE''' thread is executed when there is no other thread to execute on a core. |
41 | | Les principales informations stockées dans le descripteur de thread sont les suivantes : |
| 43 | From the point of view of scheduling, a thread can be in six states, as described in section [wiki:thead_scheduling D]. |
| 44 | |
| 45 | This implementation of ALMOS-MK does not support thread migration: a thread is pinned on a given core in a given cluster. The only exception is the main thread of a process, that is automatically created by the kernel when a new process is created: This main thread follow its owner process in case of process migration. |
| 46 | |
| 47 | An user thread is identified by a fixed format TRDID identifier, coded on 32 bits : The 16 MSB bits (CXY) define the cluster where the thread has been pinned. The 16 LSB bits (LTID) define the thread local index in the local TH_TBL[K,P] of |
| 48 | a process descriptor P in a cluster K. This LTID index is allocated by the local process descriptor when the thread is created. |
| 49 | |
| 50 | Therefore, the TH_TBL(K,P) thread table for a given process in a given clusters contains only the threads of P placed in cluster K. The set of all threads of a given process is defined by the union of all TH_TBL(K,P) for all active clusters K. |
| 51 | To scan the set off all threads of a process P, ALMOS-MK traverse the COPIES_LIST of all process_descriptors associated to P process. |
| 52 | |
| 53 | The thread descriptor (thread_t in ALMOS-MK) contains the following informations: |
| 54 | * TRDID : thread identifier |
| 55 | * PTRDID : parent thread identifier |
48 | | * PARENT : TRDID du thread parent qui doit être informé de la terminaison. |
49 | | * IO : canaux alloués au thread dans le cas des périphériques multi-canaux. |
50 | | * SIGNALS : vecteur de bits permettant d’enregistrer les signaux reçus par le thread |
| 62 | * XLIST : member of the global list of threads waiting on the same resource. |
| 63 | * SCHED : pointer on the scheduler in charge of this thread. |
| 64 | * CORE : pointer on the owner processor core. |
| 65 | * IO : allocated devices (in case of privately allocated devices). |
| 66 | * SIGNALS : bit vector permettant d’enregistrer les signaux reçus par le thread |
61 | | Le processus père P s’exécute sur un coeur dans un cluster Z. Il fait un appel système fork() qui a principalement |
62 | | pour rôle de sélectionner un cluster cible X qui deviendra le cluster propriétaire du processus fils F, et de dupliquer |
63 | | le processus P dans le cluster Z. Le choix du cluster cible devrait en principe s’appuyer sur la DQDT, bien que |
64 | | celle-ci ne soit pas implémentée actuellement dans ALMOS-MK. |
| 76 | The parent process P is running on a core in cluster K, and execute the fork() system call to create a remote process F. This syscall selects a target cluster Z, that will become the owner of the F process. Cluster K will contain the reference process descriptor. The target cluster can be specified by the user application or automatdefined by the kernel using the DQDT. |
| 77 | 1. the kernel in 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. |
| 78 | 1. the kernel in cluster K ask to kernel in cluster Z to allocate a PID for the F process and to register the extended pointer on process descriptor in PREF_TBL[Z] of cluster Z. This done by the RPC_PROCESS_PID_ALLOC that takes the process descriptor pointer argument and returns the PID. |
| 79 | 1. the kernel in cluster K initializes the F process descriptor from informations found in the P parent process descriptor. This includes the inherited ... |
| 80 | 1. the kernel in cluster K creates locally the main thread of process F, and register this thread in the TH_TBL[K,P] |
| 81 | |
| 82 | |