diff options
author | Bill Fischofer <bill.fischofer@linaro.org> | 2018-04-04 16:19:27 -0500 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-04-10 22:54:40 +0300 |
commit | bd0377ae95427e80f04b0dd5f3a8dcb0b1ab89e3 (patch) | |
tree | 491fb0728b36f3cdf1925fbd1eee82f56b184c6a | |
parent | 5555878edbda765134fbe50f3181f409963037ea (diff) |
doc: userguide: shm corrections
Clarify the use of the ODP_SHM_SINGLE_VM flag on shm operations.
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Josep Puigdemont <josep.puigdemont@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | doc/users-guide/users-guide.adoc | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index e480c69d5..9c1307b4b 100644 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -798,16 +798,16 @@ shared_data_t *shared_data; shared_data = odp_shm_addr(shm); ---- -The address returned by `odp_shm_addr()` is valid only in the calling ODP -thread space: odp_shm_t handles can be shared between ODP threads and remain -valid within any threads, whereas the address returned by `odp_shm_addr(shm)` -may differ from ODP threads to ODP threads (for the same 'shm' block), and -should therefore not be shared between ODP threads. -For instance, it would be correct to send a shm handle using IPC between two -ODP threads and let each of these thread do their own `odp_shm_addr()` to -get the block address. Directly sending the address returned by -`odp_shm_addr()` from one ODP thread to another would however possibly fail -(the address may have no sense in the receiver address space). +The address returned by `odp_shm_addr()` is normally valid only in the calling +ODP thread space: odp_shm_t handles can be shared between ODP threads and +remain valid within any threads, whereas the address returned by +`odp_shm_addr(shm)` may differ from ODP threads to ODP threads (for the same +'shm' block), and should therefore not be shared between ODP threads. For +instance, it would be correct to send a shm handle using IPC between two ODP +threads and let each of these thread do their own `odp_shm_addr()` to get the +block address. Directly sending the address returned by `odp_shm_addr()` from +one ODP thread to another would however possibly fail (the address may make no +sense in the receiver address space). The address returned by `odp_shm_addr()` is nevertheless guaranteed to be aligned according to the alignment requirements provided at block creation @@ -819,7 +819,13 @@ All shared memory blocks are contiguous in any ODP thread addressing space: as provided in the `odp_shm_reserve()` call) is read and writeable and mapping the shared memory block. There is no fragmentation. -=== Memory behaviour +The exception to this rule is if the `odp_shm_t` is created with the +`ODP_SHM_SINGLE_VA` flag. This requests that `odp_shm_addr()` return the same +virtual address for all ODP threads in this instance. Note that there may be a +performance cost or shm size limit associated with providing this function in +some implementations. + +=== Memory behavior By default ODP threads are assumed to behave as cache coherent systems: Any change performed on a shared memory block is guaranteed to eventually become visible to other ODP threads sharing this memory block. |