Memory placement with the vmo command
You can allocate user memory with parameters of the vmo command. You can also decide on whether you want to use the first-touch scheduling policy or the round-robin scheduling policy.
With the first-touch scheduling policy, memory is allocated from the chip module that the thread was running on when it first touched that memory segment, which is the first page fault. With the round-robin scheduling policy, which is the default for all memory types, memory allocation is striped across each of the vmpools.
The following parameters of the vmo command
control the placement of user memory and can either have a value of
1, signifying the first touch scheduling policy, or 2, signifying
the round-robin scheduling policy:
- memplace_data
- This parameter specifies the memory placement for the following
types of data:
- Data of the main executable that is either initialized or uninitialized
- Heap segment data
- Shared library data
- Data of object modules that are loaded at run-time
- memplace_mapped_file
- This parameter specifies the memory placement for files that are mapped into the address space of a process, such as the shmat() function and the mmap() function. The default value for this parameter is 2.
- memplace_shm_anonymous
- This parameter specifies the memory placement for anonymous shared memory that acts as working storage memory that is created by a call to the shmget() function or the mmap() function. The memory can only be accessed by the creating process or its descendants and it is not associated with a name or a key. The default value for this parameter is 2.
- memplace_shm_named
- This parameter specifies the memory placement for named shared memory that acts as working storage memory that is created by a call to the shmget() function or the shm_open() function. It is associated with a name or a key that allows more than one process to access it simultaneously. The default value for this parameter is 2.
- memplace_stack
- This parameter specifies the memory placement for the program stack. The default value for this parameter is 2.
- memplace_text
- This parameter specifies the memory placement for the application text of the main executable, but not for its dependencies. The default value for this parameter is 2.
- memplace_unmapped_file
- This parameter specifies the memory placement for unmapped file access, such as with the read() or write() functions. The default value for this parameter is 2.