Skip to contentSkip to conversation

ENOMEM returned from rt_task_create and rt_sem_create

Xenomai Steve Hartmann 2 participants 7 messages Aug 21, 2014 – Aug 25, 2014

lore
Share & tools
lore
#0 lore raw

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a user land application.

This code I am having issues with was working pretty well until I added some more semaphores. As it runs right now, it will call rt_sem_create 544 times, then call a single rt_task_create. There are also about 15 mutexes created also. I didn't count it, but somewhere around 520 or so semaphores, I start getting ENOMEM returned from both of these methods.

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but if it is not detrimental, I would like to just raise whatever limit it is that I am running into.

Thanks,

Steve

#1 lore raw
Quoted 8 lines · Steve Hartmann

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a user land application.

This code I am having issues with was working pretty well until I added some more semaphores. As it runs right now, it will call rt_sem_create 544 times, then call a single rt_task_create. There are also about 15 mutexes created also. I didn't count it, but somewhere around 520 or so semaphores, I start getting ENOMEM returned from both of these methods.

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but if it is not detrimental, I would like to just raise whatever limit it is that I am running into.

Raising CONFIG_XENO_OPT_SYS_HEAPSZ should fix this issue.

Signature · 1 line
Philippe.
#2 lore raw
Quoted 12 lines · Philippe Gerum
Quoted 11 lines · Steve Hartmann

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a user land application.

This code I am having issues with was working pretty well until I added some more semaphores. As it runs right now, it will call rt_sem_create 544 times, then call a single rt_task_create. There are also about 15 mutexes created also. I didn't count it, but somewhere around 520 or so semaphores, I start getting ENOMEM returned from both of these methods.

Quoted 11 lines
Quoted 5 lines

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but if it is not detrimental, I would like to just raise whatever limit it is that I am running into.

Raising CONFIG_XENO_OPT_SYS_HEAPSZ should fix this issue.

Signature · 1 line
Philippe.

Thanks for the reply.

That's what I thought too. I doubled it to 512 and saw no effect. I also doubled the value of CONFIG_XENO_OPT_GLOBAL_SEM_HEAP and CONFIG_XENO_OPT_SEM_HEAPSZ to see if they had any effect - they did not.

#3 lore raw
Quoted 25 lines · Steve Hartmann
Quoted 21 lines · Philippe Gerum
Quoted 11 lines · Steve Hartmann

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a user land application.

This code I am having issues with was working pretty well until I added some more semaphores. As it runs right now, it will call rt_sem_create 544 times, then call a single rt_task_create. There are also about 15 mutexes created also. I didn't count it, but somewhere around 520 or so semaphores, I start getting ENOMEM returned from both of these methods.

Quoted 5 lines

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but if it is not detrimental, I would like to just raise whatever limit it is that I am running into.

Raising CONFIG_XENO_OPT_SYS_HEAPSZ should fix this issue.

Quoted 10 lines
Quoted 2 lines
Signature · 1 line
Philippe.

Thanks for the reply.

That's what I thought too. I doubled it to 512 and saw no effect. I also doubled the value of CONFIG_XENO_OPT_GLOBAL_SEM_HEAP and CONFIG_XENO_OPT_SEM_HEAPSZ to see if they had any effect - they did not.

This could be the number of registry slots then, try raising CONFIG_XENO_OPT_REGISTRY_NRSLOTS.

Signature · 1 line
Philippe.
#4 lore raw
Quoted 43 lines · Philippe Gerum
Quoted 33 lines · Steve Hartmann
Quoted 24 lines · Philippe Gerum
Quoted 15 lines · Steve Hartmann

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a user land application.

This code I am having issues with was working pretty well until I added
some more semaphores. As it runs right now, it will call rt_sem_create
544 times, then call a single rt_task_create. There are also about 15 mutexes created also. I didn't count it, but somewhere around 520 or so
semaphores, I start getting ENOMEM returned from both of these methods.

Quoted 6 lines

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but
if it is not detrimental, I would like to just raise whatever limit it is that I am running into.

Quoted 4 lines

Raising CONFIG_XENO_OPT_SYS_HEAPSZ should fix this issue.

Signature · 1 line
Philippe.
Quoted 8 lines

Thanks for the reply.

That's what I thought too. I doubled it to 512 and saw no effect. I also
doubled the value of CONFIG_XENO_OPT_GLOBAL_SEM_HEAP and CONFIG_XENO_OPT_SEM_HEAPSZ to see if they had any effect - they did not.

Quoted 5 lines

This could be the number of registry slots then, try raising CONFIG_XENO_OPT_REGISTRY_NRSLOTS.

Signature · 1 line
Philippe.

Thanks, I will try that today. However, in all the calls to rt_sem_create, I pass NULL to the name parameter. Should the semaphores still be taking up registry slots even if unnamed?

Steven

#5 lore raw
Quoted 50 lines · Steve Hartmann
Quoted 46 lines · Philippe Gerum
Quoted 33 lines · Steve Hartmann
Quoted 24 lines · Philippe Gerum
Quoted 15 lines · Steve Hartmann

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a user land application.

This code I am having issues with was working pretty well until I added
some more semaphores. As it runs right now, it will call rt_sem_create
544 times, then call a single rt_task_create. There are also about 15 mutexes created also. I didn't count it, but somewhere around 520 or so
semaphores, I start getting ENOMEM returned from both of these methods.

Quoted 6 lines

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but
if it is not detrimental, I would like to just raise whatever limit it is that I am running into.

Quoted 4 lines

Raising CONFIG_XENO_OPT_SYS_HEAPSZ should fix this issue.

Signature · 1 line
Philippe.
Quoted 8 lines

Thanks for the reply.

That's what I thought too. I doubled it to 512 and saw no effect. I also
doubled the value of CONFIG_XENO_OPT_GLOBAL_SEM_HEAP and CONFIG_XENO_OPT_SEM_HEAPSZ to see if they had any effect - they did not.

This could be the number of registry slots then, try raising CONFIG_XENO_OPT_REGISTRY_NRSLOTS.

Quoted 7 lines
Quoted 2 lines
Signature · 1 line
Philippe.

Thanks, I will try that today. However, in all the calls to rt_sem_create, I pass NULL to the name parameter. Should the semaphores still be taking up registry slots even if unnamed?

When created from user-space, they will. This way we get a valid internal identifier on an anon object, for referring to it from userland.

Signature · 1 line
Philippe.
#6 lore raw
Quoted 59 lines · Philippe Gerum
Quoted 58 lines · Steve Hartmann
Quoted 53 lines · Philippe Gerum
Quoted 37 lines · Steve Hartmann
Quoted 28 lines · Philippe Gerum
Quoted 18 lines · Steve Hartmann

Hi folks,

I am using linux 3.2.21 + xenomai 2.6.2.1 on intel core i7. This is a
user land application.

This code I am having issues with was working pretty well until I added
some more semaphores. As it runs right now, it will call rt_sem_create
544 times, then call a single rt_task_create. There are also about 15
mutexes created also. I didn't count it, but somewhere around 520 or
so
semaphores, I start getting ENOMEM returned from both of these methods.

Quoted 7 lines

Is there a way I can increase whatever memory pool these are pulling from? It is feasible to rewrite the code so I use less semaphores, but
if it is not detrimental, I would like to just raise whatever limit it
is that I am running into.

Quoted 4 lines

Raising CONFIG_XENO_OPT_SYS_HEAPSZ should fix this issue.

Signature · 1 line
Philippe.
Quoted 9 lines

Thanks for the reply.

That's what I thought too. I doubled it to 512 and saw no effect. I also
doubled the value of CONFIG_XENO_OPT_GLOBAL_SEM_HEAP and CONFIG_XENO_OPT_SEM_HEAPSZ to see if they had any effect - they did not.

This could be the number of registry slots then, try raising CONFIG_XENO_OPT_REGISTRY_NRSLOTS.

Signature · 1 line
Philippe.
Quoted 10 lines
Quoted 4 lines

Thanks, I will try that today. However, in all the calls to rt_sem_create, I pass NULL to the name parameter. Should the semaphores still be taking up registry slots even if unnamed?

When created from user-space, they will. This way we get a valid internal identifier on an anon object, for referring to it from userland.

Signature · 1 line
Philippe.

That fixed it. Thank you so much for your help!

Steven