[PATCH 2/3] score: Add CONFIGURE_INIT_TASK_STORAGE_SIZE
chrisj at rtems.org
Tue Nov 24 21:28:58 UTC 2020
On 24/11/20 10:45 pm, Sebastian Huber wrote:
> On 24/11/2020 12:40, Chris Johns wrote:
>> On 24/11/20 6:35 pm, Sebastian Huber wrote:
>>> On 23/11/2020 21:23, Chris Johns wrote:
>>>> On 23/11/20 7:46 pm, Sebastian Huber wrote:
>>>>> On 22/11/2020 23:22, Chris Johns wrote:
>>>>>> On 20/11/20 7:31 pm, Sebastian Huber wrote:
>>>>>>> In order to better support applications which use the new
>>>>>>> rtems_task_construct() directive add the
>>>>>>> CONFIGURE_INIT_TASK_STORAGE_SIZE configuration option. If this option
>>>>>>> is specified, then the Classic API initialization task is constructed
>>>>>>> with rtems_task_construct().
>>>>>> The name CONFIGURE_INIT_TASK_STORAGE_SIZE does not reflect the role described
>>>>>> here and is a little ambiguous unless you know the implementation detail.
>>>>>> CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ?
>>>>> I am not sure. The storage size is a property of the task. How this
>>>>> property is
>>>>> achieved is a detail and may change.
>>>> Is it a property of a specific instance (Init) of a specific type
>>>> (construct) of
>>>> You have stated:
>>>> "If this option is specified, then the Classic API initialization task
>>>> is constructed with rtems_task_construct()."
>>>> This is how I am reading this sentence. Sure in time the task may not be
>>>> constructed and that may change but the effect needs to be a "constructed" task
>>>> or you would need another variables.
>>>> The key issue is the config option triggers a change in the type of Init task
>>>> and we should be as clear about that as we can.
>>> I changed the documentation of CONFIGURE_INIT_TASK_STORAGE_SIZE to not mention
>>> rtems_task_construct(). This is just an implementation detail.
>> Does this mean all Init tasks will be statically constructed tasks?
> No, if you specify CONFIGURE_INIT_TASK_STACK_SIZE (this is also the default),
> then rtems_task_create() is used. If you specify
> CONFIGURE_INIT_TASK_STORAGE_SIZE, then rtems_task_construct() is used.
They why not make this explicit and so helpful to users? I see no need for any
abstraction or a need to hide what this does. The name you have selected is
subtle and requires you know the implementation to understand what it means, ie
statically initialised tasks need static storage and so this makes Init static.
If both are defined you get an error and all the documentation says is they are
mutually exclusive. Again no indication the Init stack is now static.
Before this change if I delete `Init` I recovered that memory back to the
workspace. With this change deleting `Init` does _not_ recover the memory. This
is serious and important change that needs to be clearly explained to all users.
> For a user it should be no concern how the system creates the Classic API
> initialization task. What matters is that the task has the configured properties.
I think it is important to users. I would like to know what effect to
initialisation these options have. For someone new to RTEMS starting RTEMS is
one of the first things they experience.
We cannot change the option CONFIGURE_INIT_TASK_STACK_SIZE but we can make the
task storage size more helpful with CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE.
More information about the devel