15 | | A '''vseg''' is a contiguous memory zone in the process virtual space, such as 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''' contains always 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 vseg_t in the ''vseg.h'' file. |
| 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 vseg_t in the ''vseg.h'' file. |
29 | | || type || || || access || replication || Placement || allocation policy in user space || |
30 | | || STACK || private || localized || Read Write || one physical mapping per thread || same cluster as thread using it || dynamic (one stack allocator per cluster) || |
31 | | || CODE || private || localized || Read Only || one physical mapping per cluster || same cluster as thread using it || static (defined in .elf file) || |
32 | | || DATA || public || distributed || Read Write || same mapping for all threads || distributed on all clusters || static (defined in .elf file || |
33 | | || ANON || public || localized || Read Write || same mapping for all threads || same cluster as calling thread || dynamic (one heap allocator per process || |
34 | | || FILE || public || localized || Read Write || same mapping for all threads || same cluster as the file cache || dynamic (one heap allocator per process) || |
35 | | || REMOTE || public || localized || Read Write || same mapping for all threads || cluster defined by user || dynamic (one heap allocator per process) || |
| 29 | || Type || || || Access || Replication || Placement || Allocation policy in user space || |
| 30 | || STACK || private || localized || Read Write || one physical mapping per thread || same cluster as thread using it || dynamic (one stack allocator per cluster) || |
| 31 | || CODE || private || localized || Read Only || one physical mapping per cluster || same cluster as thread using it || static (defined in .elf file) || |
| 32 | || DATA || public || distributed || Read Write || same mapping for all threads || distributed on all clusters || static (defined in .elf file || |
| 33 | || ANON || public || localized || Read Write || same mapping for all threads || same cluster as calling thread || dynamic (one heap allocator per process || |
| 34 | || FILE || public || localized || Read Write || same mapping for all threads || same cluster as the file cache || dynamic (one heap allocator per process) || |
| 35 | || REMOTEnn || public || localized || Read Write || same mapping for all threads || cluster defined by user || dynamic (one heap allocator per process) || |
67 | | It is located on top of the '''elf''' zone, and starts at address defined by the CONFIG_VSPACE_HEAP_BASE parameter. It contains all vsegs dynamically allocated / released by the mmap() / munmap() system calls (i.e. FILE / ANON / REMOTE types). The VMM implements a specific MMAP allocator for this zone, implementing the ''buddy'' algorithm. The mmap( FILE ) syscall maps directly a file in user space. The user level ''malloc'' library uses the mmap( ANON ) syscall to allocate virtual memory from the heap and map it in the same cluster as the calling thread. Besides the standard malloc() function, this library implements a non-standard remote_malloc() function, that uses the mmap( REMOTE ) syscall to dynamically allocate virtual memory from the heap, and map it a remote physical cluster. |
| 67 | It is located on top of the '''elf''' zone, and starts at the address defined by the CONFIG_VSPACE_HEAP_BASE parameter. It contains all vsegs dynamically allocated / released by the mmap() / munmap() system calls (i.e. FILE / ANON / REMOTE types). The VMM implements a specific MMAP allocator for this zone, implementing the ''buddy'' algorithm. The mmap( FILE ) syscall maps directly a file in user space. The user level ''malloc'' library uses the mmap( ANON ) syscall to allocate virtual memory from the heap and map it in the same cluster as the calling thread. Besides the standard malloc() function, this library implements a non-standard remote_malloc() function, that uses the mmap( REMOTE ) syscall to dynamically allocate virtual memory from the heap, and map it to a remote physical cluster. |
70 | | It is located on top of the '''mmap''' zone and starts at address defined by the CONFIG_VSPACE_STACK_BASE parameter. It contains an array of fixed size slots, and each slot contain one ''stack'' vseg. The size of a slot is defined by the CONFIG_VSPACE_STACK_SIZE. In each slot the first page is not mapped to detect stack overflow. As threads are dynamically created and destroyed, the VMM implement a specific STACK allocator for this zone, using a bitmap vector. As the ''stack'' vseg are private (the same virtual address can have different mappings, depending on the cluster) the number of slots in the '''stack''' zone defines actually the max number of threads for given process in a given cluster. |
| 70 | It is located on top of the '''mmap''' zone and starts at the address defined by the CONFIG_VSPACE_STACK_BASE parameter. It contains an array of fixed size slots, and each slot contains one ''stack'' vseg. The size of a slot is defined by the CONFIG_VSPACE_STACK_SIZE. In each slot, the first page is not mapped, in order to detect stack overflows. As threads are dynamically created and destroyed, the VMM implements a specific STACK allocator for this zone, using a bitmap vector. As the ''stack'' vsegs are private (the same virtual address can have different mappings, depending on the cluster) the number of slots in the '''stack''' zone actually defines the max number of threads for given process in a given cluster. |