5 | | The replication / distribution policy of user processes has two goals: enforce locality (as much as possible), and avoid contention (it is the main goal). |
6 | | * The read-only segment containing the user code is replicated in all clusters where there is at least one thread using it. |
7 | | * The private segment containing the stack for a given thread is placed in the same cluster as the thread using it. |
8 | | * The shared segment containing the global data is distributed on all clusters as regularly as possible to avoid contention. |
9 | | * The segments dynamically allocated by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_mmap.c#L38 mmap()] system call are placed as described below. |
| 5 | The replication / distribution policy of segments has two goals: enforce locality (as much as possible), and avoid contention (it is the main goal). |
| 6 | |
| 7 | To actually control data placement on the physical memory banks, the kernel uses the paged virtual memory MMU to map a virtual segment to a given physical memory bank in a given cluster. |
15 | | A '''vseg''' is a contiguous memory zone in the process virtual space, where all adresses in this '''vseg''' can be accessed by the process without segmentation violation: if the corresponding is not mapped, the page fault will be handled by the kernel, |
16 | | and a physical page will be dynamically allocated and initialized if required. A '''vseg''' always contains an integer number of pages. Depending on its type, a '''vseg''' has some specific attributes regarding access rights, replication policy, and distribution policy. The vseg descriptor is defined by the structure [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vseg.h#L72 vseg_t]. |
| 13 | To avoid contention, almos-mkh replicates, for each process P, the process descriptor in all clusters containing at least one thread of P, and these clusters are called active clusters. The virtual memory manager VMM(P,K) of process P in cluster K, contains two main structures: |
| 14 | * The [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.h VSL(P,K)] is the list of all vsegs registered for process P in cluster K, |
| 15 | * The [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.h GPT(P,K)] is the generic page table, defining the actual physical mapping of those vsegs. |
18 | | For each process P, the process descriptor is replicated in all clusters containing at least one thread of P, and these clusters are called active clusters. More precisely, the virtual memory manager VMM(P,K) of process P in active cluster K, contains two main structures: |
19 | | * The [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.h#L108 VSL(P,K)] is the list of all vsegs registered for process P in cluster K, |
20 | | * The [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.h#L111 GPT(P,K)] is the generic page table, defining the actual physical mapping of those vsegs. |
| 17 | The Virtual Memory Manager API is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.h almos_mkh/kernel/mm/vmm.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.c almos-mkh/kernel/mm/vmm.c] files. |
53 | | == __2) 32 bits virtual space organisation__ == |
| 50 | ==__ 2. kernel segments types__== |
| 51 | * The read-only segment containing the user code is replicated in all clusters where there is at least one thread using it. |
| 52 | * The private segment containing the stack for a given thread is placed in the same cluster as the thread using it. |
| 53 | * The shared segment containing the global data is distributed on all clusters as regularly as possible to avoid contention. |
| 54 | * The segments dynamically allocated by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_mmap.c] system call are placed as described below. |
| 55 | |
| 56 | == __ 2. 32 bits virtual space organisation__ == |