diff mbox

[API-NEXT] linux-gen: shared_memory: remove flag forcing mlock()

Message ID 1480962415-31899-1-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 7f97683b1afc4826825f0db0fcac40858892494a
Headers show

Commit Message

Christophe Milard Dec. 5, 2016, 6:26 p.m. UTC
The _ishm flag _ODP_ISHM_LOCK is no longer set when doing shm_reserve(),
hence enabling non-root user to exceed the 64MB mlock memory limit
(ulimit).

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

---
 platform/linux-generic/odp_shared_memory.c | 3 ---
 1 file changed, 3 deletions(-)

-- 
2.7.4

Comments

Maxim Uvarov Dec. 12, 2016, 12:59 p.m. UTC | #1
On 12/05/16 21:26, Christophe Milard wrote:
> The _ishm flag _ODP_ISHM_LOCK is no longer set when doing shm_reserve(),

> hence enabling non-root user to exceed the 64MB mlock memory limit

> (ulimit).


64kb on my system (Ubuntu), not 64MB. Is it ok to fix in place? My ipc
patches based on that patch.

Maxim.

> 

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

> ---

>  platform/linux-generic/odp_shared_memory.c | 3 ---

>  1 file changed, 3 deletions(-)

> 

> diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c

> index d2bb74c..ba32dee 100644

> --- a/platform/linux-generic/odp_shared_memory.c

> +++ b/platform/linux-generic/odp_shared_memory.c

> @@ -58,9 +58,6 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align,

>  

>  	flgs = get_ishm_flags(flags);

>  

> -	/* all mem reserved through this interface is requested to be locked: */

> -	flgs |= (flags & _ODP_ISHM_LOCK);

> -

>  	block_index = _odp_ishm_reserve(name, size, -1, align, flgs, flags);

>  	if (block_index >= 0)

>  		return to_handle(block_index);

>
Maxim Uvarov Dec. 12, 2016, 2:07 p.m. UTC | #2
Applied,
Maxim.

On 5 December 2016 at 21:26, Christophe Milard <christophe.milard@linaro.org
> wrote:


> The _ishm flag _ODP_ISHM_LOCK is no longer set when doing shm_reserve(),

> hence enabling non-root user to exceed the 64MB mlock memory limit

> (ulimit).

>

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

> ---

>  platform/linux-generic/odp_shared_memory.c | 3 ---

>  1 file changed, 3 deletions(-)

>

> diff --git a/platform/linux-generic/odp_shared_memory.c

> b/platform/linux-generic/odp_shared_memory.c

> index d2bb74c..ba32dee 100644

> --- a/platform/linux-generic/odp_shared_memory.c

> +++ b/platform/linux-generic/odp_shared_memory.c

> @@ -58,9 +58,6 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t

> size, uint64_t align,

>

>         flgs = get_ishm_flags(flags);

>

> -       /* all mem reserved through this interface is requested to be

> locked: */

> -       flgs |= (flags & _ODP_ISHM_LOCK);

> -

>         block_index = _odp_ishm_reserve(name, size, -1, align, flgs,

> flags);

>         if (block_index >= 0)

>                 return to_handle(block_index);

> --

> 2.7.4

>

>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index d2bb74c..ba32dee 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -58,9 +58,6 @@  odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align,
 
 	flgs = get_ishm_flags(flags);
 
-	/* all mem reserved through this interface is requested to be locked: */
-	flgs |= (flags & _ODP_ISHM_LOCK);
-
 	block_index = _odp_ishm_reserve(name, size, -1, align, flgs, flags);
 	if (block_index >= 0)
 		return to_handle(block_index);