RES: Possible confdefs error when calculating workspace size
Joel Sherrill
joel.sherrill at OARcorp.com
Mon Mar 14 18:50:17 UTC 2011
On 03/14/2011 01:44 PM, Fabrício de Novaes Kucinskis wrote:
> Hi Joel,
>
> Your assumption was right: I didn't defined CONFIGURE_MESSAGE_BUFFER_MEMORY,
> basically because it wasn't necessary for my applications to run ok. Now I'm
> curious: what was the amount of 'extra' memory allocated by previous
> versions of confdefs?
>
I don't really recall but it was on the order of 10K. I fine-tuned
all the estimates and reworked a lot of the confdefs.h macros
to be easier to validate.
FWIW that was all done as part of TinyRTEMS. Unnecessary
over allocation lead to more workspace than was needed.
> But I bet more people like me, due to the overestimation made by previous
> versions, never configured adequately the message buffer memory and will
> start having problems with it now.
>
A few tests broke because of this.
> To be honest, I've never noticed the CONFIGURE_MESSAGE_BUFFER_MEMORY macro.
> Wouldn't be a good idea to point to it on the RTEMS User's Manual, item
> 10.4.1, 'Description'? I suggest a little change, something like: "...
> Memory is allocated from the RTEMS Workspace for the specified count of
> messages, each of max_message_size bytes in length (see the
> CONFIGURE_MESSAGE_BUFFER_MEMORY configuration parameter on item 23.2.2)."
>
If you don't mind, please file a PR on this so it won't slip through.
Honestly, the two macros weren't always around. I am thinking that
neither pre-dates 4.8.
--joel
> Thank you very much,
>
> Fabrício.
>
>
> -----Mensagem original-----
> De: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
> Enviada em: segunda-feira, 14 de março de 2011 11:29
> Para: Fabrício de Novaes Kucinskis
> Cc: rtems-users at rtems.com
> Assunto: Re: Possible confdefs error when calculating workspace size
>
> On 03/14/2011 09:17 AM, Fabrício de Novaes Kucinskis wrote:
>> Hi all,
>>
>> I'm upgrading an application from RTEMS 4.8 to 4.10. This application
>> runs 11 tasks (including Init and Idle) and some message queues.
>>
>> When running on RTEMS 4.10, the application creates all tasks, but
>> stops after the creation of some queues, returning RTEMS_UNSATISFIED
>> from a rtems_message_queue_create directive. According to the manual,
>> this means "unable to allocate message buffers" (from the workspace).
>>
> How are you accounting for the message buffer memory? It comes
> out of the workspace.
>
> For each message queue, you need to reserve like this:
>
>
> #define CONFIGURE_MESSAGE_BUFFER_MEMORY \
> CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( _maxQ1, _sizeQ1) + \
> CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( _maxQ2, _sizeQ2) + \
> ...
>
>> The problem is solved when I add one to the number of configured tasks
>> (RTEMS_MAXIMUM_TASKS 12) - this increases the workspace size as well.
>>
>> This didn't happen with previous versions - all I needed to do was
>> inform the correct number of tasks, and the workspace seemed to have
>> the right size.
>>
>> I couldn't find anything on the documentation that indicates a change
>> on the workspace size configuration.
>>
> There are almost always changes to the internals of confdefs.h from
> version to version. This time, it got tighter and did not overallocate
> as much memory. In 4.9, it was over estimating and likely covered up
> that you didn't reserve memory for the message buffers.
>> Is there something I'm missing, or this could be a possible error on
>> confdefs.h?
>>
>> Thanks in advance and best regards,
>>
>> Fabrício de Novaes Kucinskis.
>>
>
--
Joel Sherrill, Ph.D. Director of Research& Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list