Changes between Version 44 and Version 45 of replication_distribution


Ignore:
Timestamp:
Dec 8, 2019, 6:31:56 PM (3 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • replication_distribution

    v44 v45  
    1 = Data replication & distribution policy =
     1= Virtual segments replication & distribution policy =
    22
    33[[PageOutline]]
    44
    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.
     5The replication / distribution policy of segments has two goals: enforce locality (as much as possible), and avoid contention (it is the main goal).
     6 
     7To 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.
    108
    11 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.
     9A '''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, 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.
    1210
    13 __''This replication / distribution policy is implemented by the Virtual Memory Manager (in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.h vmm.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vmm.c vmm.c] files).''__
     11The '''vseg''' API is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vseg.h almos_mk/kernel/mm/vseg] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/mm/vseg.c almos-mkh/kernel/mm/vseg.c] files.
    1412
    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].
     13To 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.
    1716
    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.
     17The 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.
    2118
    22 == __1)  User segments types and attributes__  ==
     19== __1. User segments types__  ==
    2320
    24  * A vseg is '''public''' when it can be accessed by any thread T of the process, whatever the cluster running the thread T.  It is '''private''' when it can only be accessed by the threads running in the cluster containing the physical memory bank where this vseg is mapped. A '''private''' vseg is entirely mapped in one single cluster K.
     21 * A vseg is '''public''' when it must be accessed by any thread T of the process, whatever the cluster running the thread T.  It is '''private''' when it needs only to be accessed by the threads running in the cluster containing the physical memory bank where this vseg is mapped. A '''private''' vseg is entirely mapped in one single cluster K.
    2522 * For a '''public''' vseg, ALMOS-MKH implements a global mapping : In all clusters, a given virtual address is mapped to the same physical address. For a '''private''' vseg, ALMOS-MKH implements a local mapping : the same virtual address can be mapped to different physical addresses, in different clusters.
    2623 * A '''public''' vseg can be '''localized''' (all vseg pages are mapped in the same cluster), or '''distributed''' (different pages are mapped on different clusters, using the virtual page number (VPN) least significant bits as distribution key). A '''private''' vseg is always '''localized'''.
     
    5148When a given vseg or a given entry in the page table must be removed by the kernel, this modification must be done first in the reference cluster, and broadcast to all other clusters for update.
    5249
    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__ ==
    5457
    5558The virtual address space of an user process P is split in 5 fixed size zones, defined by configuration parameters in [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kernel_config.h].  Each zone contains one or several vsegs, as described below.