Changes between Version 125 and Version 126 of processus_thread


Ignore:
Timestamp:
Sep 23, 2020, 12:00:06 AM (4 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v125 v126  
    33[[PageOutline]]
    44
    5 The process is the internal representation of a user application. A process can be running as a single thread (called main thread), or can be multi-threaded. ALMOS-MKH supports the POSIX thread API.
     5The process is the internal representation of an user application. A process can be running as a single thread (called main thread), or can be multi-threaded. ALMOS-MKH supports the POSIX thread API.
    66For a multi-threaded application, the number of threads can be very large, and the threads of a given process can be distributed on all cores available in the shared memory architecture, for maximal parallelism. Therefore, a single process can spread on all clusters. To avoid contention, the process descriptor of a P process, and the associated structures, such as the list of registered vsegs ('''VSL'''), the generic page table ('''GPT'''), or the file descriptors table ('''FDT''')  are  (partially) replicated in all clusters containing at least one thread of P.
    77
    88== __1) Process definition__ ==
    99
    10 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 the 16 MSB bits of PID.
    11 
    12 Since there are several copies of the process descriptors, ALMOS-MKH defines a reference process descriptor, located in the '''reference cluster'''. The other copies are used as local caches, and ALMOS-MKH must guaranty the coherence between the reference and the copies.
    13 
    14 As ALMOS-MKH supports process migration, the '''reference cluster''' can be different from the '''owner cluster'''. The '''owner cluster''' cannot change (because the PID is fixed), but the '''reference cluster''' can change in case of process migration.
     10The 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. For any process, the '''owner cluster''' is the cluster where the process has been created. The  16 LSB bits (LPID) contain the local process index in the '''owner cluster'''.
     11
     12Since there are several copies of the process descriptor, ALMOS-MKH defines a reference process descriptor, located in the '''reference cluster''' that contains the reference values for replicated structures such as the process VMM. The other copies are used as local caches, and ALMOS-MKH must guaranty the coherence between the reference and the copies.
     13
     14Initially, the reference cluster is the owner cluster tAs ALMOS-MKH supports process migration, the '''reference cluster''' can be different from the '''owner cluster'''. The '''owner cluster''' cannot change (because the PID is fixed), but the '''reference cluster''' can change in case of process migration.
    1515
    1616In each cluster K, the local cluster manager ( [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/cluster.h#L97 cluster_t] type in ALMOS-MKH ) contains a process manager ( [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/cluster.h#L75 pmgr_t]  type in ALMOS-MKH ) that maintains three structures for all processes owned by K :
     
    5757To scan the set of all threads of a process P, ALMOS-MKH traverses the COPIES_LIST of all process_descriptors associated to P process.
    5858
    59 This implementation of ALMOS-MKH does not support thread migration: a thread is pinned on a given core in a given cluster. In the future process migration mechanism, all threads of given process in a given cluster can migrate to another cluster for load balancing. This mechanism is not implemented yet (february 2018), and will require to distinguish the kernel thread identifier (TRDID, that will be modified by a migration), and the user thread identifier (THREAD, that cannot be modified by a migration). In the current implementation, the user identifier (returned by the pthread_create() sys call) is identical to the kernel identifier.
     59This implementation of ALMOS-MKH does not support thread migration: a thread is pinned on a given core in a given cluster. In the future process migration mechanism, all threads of a process in a given cluster can migrate to another cluster for load balancing. This mechanism is not implemented yet (february 2018), and will require to distinguish the kernel thread identifier (TRDID, that will be modified by a migration), and the user thread identifier (THREAD, that is modified by a migration). In the current implementation, the user identifier (returned by the pthread_create() sys call) is identical to the kernel identifier.
    6060
    6161You can find below a partial list of information stored in a thread descriptor ([https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/thread.h#L134 thread_t] in ALMOS-MKH):