diff mbox

[API-NEXT,04/14] api: shm: add flag to guarantee address unicity on all ODP threads

Message ID 1475836517-60484-5-git-send-email-christophe.milard@linaro.org
State Superseded
Headers show

Commit Message

Christophe Milard Oct. 7, 2016, 10:35 a.m. UTC
The ODP_SHM_SINGLE_VA flag is created: when set (at odp_shm_reserve()),
this flag guarantees that all ODP threads sharing this memory
block will see the block at the same address (regadless of ODP
thread type -pthread vs process- or fork time)

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

---
 include/odp/api/spec/shared_memory.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.7.4

Comments

Maxim Uvarov Oct. 7, 2016, 10:41 a.m. UTC | #1
On 10/07/16 13:35, Christophe Milard wrote:
> The ODP_SHM_SINGLE_VA flag is created: when set (at odp_shm_reserve()),

> this flag guarantees that all ODP threads sharing this memory

> block will see the block at the same address (regadless of ODP

> thread type -pthread vs process- or fork time)

>

> Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

> ---

>   include/odp/api/spec/shared_memory.h | 7 +++----

>   1 file changed, 3 insertions(+), 4 deletions(-)

>

> diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h

> index 8c76807..fefb5d6 100644

> --- a/include/odp/api/spec/shared_memory.h

> +++ b/include/odp/api/spec/shared_memory.h

> @@ -45,10 +45,9 @@ extern "C" {

>   /*

>    * Shared memory flags

>    */

> -

> -/* Share level */

> -#define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */

> -#define ODP_SHM_PROC    0x2 /**< Share with external processes */

> +#define ODP_SHM_SW_ONLY		0x1 /**< Application SW only, no HW access   */

> +#define ODP_SHM_PROC		0x2 /**< Share with external processes       */

> +#define ODP_SHM_SINGLE_VA	0x4 /**< guarantee unique addr on all threads*/


Please merge it to patch 6 and do not modify original lines. (don't 
forget about no create flag).

Maxim.

>   

>   /**

>    * Shared memory block info
Christophe Milard Oct. 10, 2016, 1:28 p.m. UTC | #2
Patch 4 and 6 are really part of the implementation of 2 different
functions (locking memory and guaranteeing single virtual address).
Yes, they both add a flag, but isn't strange to do 2 different
unrelated things in one patch? If you insist, I can merge, but it
feels wrong to me...

When it comes to the other remark, I can leave the other lines
untouched, but the code is easier to read when comments are aligned
(in the final file, not in the patch, I agree). How do one normally do
that (like touching old lines to make thing more pretty when the new
lines comes)? Just another patch adding space and reformating
comments?. Or we don't care about comment/code alignment?

Thx :-)

Christophe.

On 7 October 2016 at 12:41, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 10/07/16 13:35, Christophe Milard wrote:

>>

>> The ODP_SHM_SINGLE_VA flag is created: when set (at odp_shm_reserve()),

>> this flag guarantees that all ODP threads sharing this memory

>> block will see the block at the same address (regadless of ODP

>> thread type -pthread vs process- or fork time)

>>

>> Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

>> ---

>>   include/odp/api/spec/shared_memory.h | 7 +++----

>>   1 file changed, 3 insertions(+), 4 deletions(-)

>>

>> diff --git a/include/odp/api/spec/shared_memory.h

>> b/include/odp/api/spec/shared_memory.h

>> index 8c76807..fefb5d6 100644

>> --- a/include/odp/api/spec/shared_memory.h

>> +++ b/include/odp/api/spec/shared_memory.h

>> @@ -45,10 +45,9 @@ extern "C" {

>>   /*

>>    * Shared memory flags

>>    */

>> -

>> -/* Share level */

>> -#define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */

>> -#define ODP_SHM_PROC    0x2 /**< Share with external processes */

>> +#define ODP_SHM_SW_ONLY                0x1 /**< Application SW only, no

>> HW access   */

>> +#define ODP_SHM_PROC           0x2 /**< Share with external processes

>> */

>> +#define ODP_SHM_SINGLE_VA      0x4 /**< guarantee unique addr on all

>> threads*/

>

>

> Please merge it to patch 6 and do not modify original lines. (don't forget

> about no create flag).

>

> Maxim.

>

>

>>     /**

>>    * Shared memory block info

>

>
diff mbox

Patch

diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h
index 8c76807..fefb5d6 100644
--- a/include/odp/api/spec/shared_memory.h
+++ b/include/odp/api/spec/shared_memory.h
@@ -45,10 +45,9 @@  extern "C" {
 /*
  * Shared memory flags
  */
-
-/* Share level */
-#define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */
-#define ODP_SHM_PROC    0x2 /**< Share with external processes */
+#define ODP_SHM_SW_ONLY		0x1 /**< Application SW only, no HW access   */
+#define ODP_SHM_PROC		0x2 /**< Share with external processes       */
+#define ODP_SHM_SINGLE_VA	0x4 /**< guarantee unique addr on all threads*/
 
 /**
  * Shared memory block info