author | Angela Stegmaier <angelabaker@ti.com> | |
Fri, 23 Aug 2013 16:45:21 +0000 (11:45 -0500) | ||
committer | Chris Ring <cring@ti.com> | |
Thu, 3 Oct 2013 03:18:47 +0000 (20:18 -0700) | ||
commit | cc5c5f6438671f239b1e3e6c36b3ea27e5e93bdc | |
tree | f6318f061df20690f3f44cc98feeef1fa8f59565 | tree | snapshot (tar.xz tar.gz zip) |
parent | 678bc61810bda9b90bdfde03ab1a3b413f8284e3 | commit | diff |
QNX IPC: RscTable - Use MAP_NOINIT Flag to Allocate Mem
The QNX IPC dynamically allocates memory for the remote
core sections based on the resource table. These sections
are allocated using an mmap call and can be quite large.
There is a performance improvement if the allocated
memory is not zero-initialized during allocation with
mmap. It may be desireable to trade off zero-initialization
of the memory for the performance improvement, so to
enable the memory to not be zero-initialized, the MAP_NOINIT
flag is added to the flags in the mmap call.
It is important to note that the MAP_NOINIT flag will only
relax the zero-init requirement if the memory being mapped
was previously freed using UNMAP_INIT_OPTIONAL. This is
considered set for any memory that hasn't been allocated before,
so can help with boot-up time. Also, The default behavior of munmap
is to not have this flag set. However, if the "-m~i" option is
used on the procnto command line, the default behavior of
munmap is changed to act like UNMAP_INIT_OPTIONAL is set.
So, this change will only gurantee the zero-init to be relaxed if the
additional change is made to use the "-m~i" option.
To be safe, this patch also explicitly zero-initializes the
vring memory after allocation, so that even if the zero-init
requirement is relaxed, the vring memory will be zero-ed.
Also, a flag named "ZEROINIT_CHUNKS" is added in the file, and
set to 0 by default. If it is desired to restore the behavior of
zero-initialization of the chunks, this can be set to 1, and
the QNX IPC rebuilt.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
The QNX IPC dynamically allocates memory for the remote
core sections based on the resource table. These sections
are allocated using an mmap call and can be quite large.
There is a performance improvement if the allocated
memory is not zero-initialized during allocation with
mmap. It may be desireable to trade off zero-initialization
of the memory for the performance improvement, so to
enable the memory to not be zero-initialized, the MAP_NOINIT
flag is added to the flags in the mmap call.
It is important to note that the MAP_NOINIT flag will only
relax the zero-init requirement if the memory being mapped
was previously freed using UNMAP_INIT_OPTIONAL. This is
considered set for any memory that hasn't been allocated before,
so can help with boot-up time. Also, The default behavior of munmap
is to not have this flag set. However, if the "-m~i" option is
used on the procnto command line, the default behavior of
munmap is changed to act like UNMAP_INIT_OPTIONAL is set.
So, this change will only gurantee the zero-init to be relaxed if the
additional change is made to use the "-m~i" option.
To be safe, this patch also explicitly zero-initializes the
vring memory after allocation, so that even if the zero-init
requirement is relaxed, the vring memory will be zero-ed.
Also, a flag named "ZEROINIT_CHUNKS" is added in the file, and
set to 0 by default. If it is desired to restore the behavior of
zero-initialization of the chunks, this can be set to 1, and
the QNX IPC rebuilt.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c | diff | blob | history |