anchao commented on PR #11842:
URL: https://github.com/apache/nuttx/pull/11842#issuecomment-1979880214
emm... strange, PR #11777 just move the instance of `struct task_info_s`
into `struct task_group_s`:
```
struct task_group_s
{
...
/* Thread local storage
***************************************************/
#ifndef CONFIG_MM_KERNEL_HEAP
struct task_info_s tg_info_;
#endif
FAR struct task_info_s *tg_info;
};
```
The instantiation of `struct task_group_s` comes from `heap` (malloc), and
it does not make temporary declarations in the stack:
```
int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
{
FAR struct task_group_s *group;
...
/* Allocate the group structure and assign it to the TCB */
group = kmm_zalloc(sizeof(struct task_group_s));
if (!group)
{
return -ENOMEM;
}
...
}
```
In addition, I checked on the sim. It seems the stack of `nsh` has not
changed. does esp board will declare `struct task_group_s` in the stack
directly?
Before patch #11777:
```
NuttShell (NSH) NuttX-10.4.0
MOTD: username=admin password=Administrator
nsh> ps
PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 FIFO Kthread - Ready 0000000000000000
069616 004632 6.6% Idle_Task
1 1 224 FIFO Kthread - Waiting Signal 0000000000000000
067536 004728 7.0% loop_task
2 2 224 FIFO Kthread - Waiting Semaphore 0000000000000000
067504 000888 1.3% hpwork 0x5019e0 0x501a08
3 3 100 FIFO Task - Running 0000000000000000
067536 003544 5.2% nsh_main
```
After patch #11777:
```
NuttShell (NSH) NuttX-10.4.0
MOTD: username=admin password=Administrator
nsh> ps
PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 FIFO Kthread - Ready 0000000000000000
069616 004632 6.6% Idle_Task
1 1 224 FIFO Kthread - Waiting Signal 0000000000000000
067536 004680 6.9% loop_task
2 2 224 FIFO Kthread - Waiting Semaphore 0000000000000000
067504 000888 1.3% hpwork 0x501d00 0x501d28
3 3 100 FIFO Task - Running 0000000000000000
067536 003544 5.2% nsh_main
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]