-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sched/tcb: use shared group for kthreads #12320
base: master
Are you sure you want to change the base?
Conversation
@anchao, let's discuss here as these comments are visible in Can you teach your opinion about the |
Although TLSF has more advantages than Best fit in terms of time complexity I have added an attachment containing the test results of different allocators (Sheet from @XuNeo Thanks), You can generate a chart and observe the memory trend (This chart may not show the worst case scenario of TLSF) |
@anchao, thanks for sharing the details. Here I am trying to keep |
Sounds good, could you update this PR, I'd like to review the code directly |
e93ddd2
to
f443ffc
Compare
1461cbe
to
c9a6669
Compare
Please fix this failure:
|
@acassis I am wondering that is this GCC 12 issue, just pushed a version using $progma to see if it can be fixed. Please teach if there are better fixes. |
229d4d6
to
69ba63d
Compare
@yf13 adding #pragma in the generic code is not a good idea, maybe you can try to fix the structure to avoid the issue, please see here: micropython/micropython#7064 He create a union to storage the right size |
@acassis thanks, will remove #pragma later after passing all checks. Now case |
@xiaoxiang781216 now the remaining issues are in this log:
and
patch #12387 has been created for the latter. |
@yf13 thanks, see the comment in the pr. |
Fix here: apache/nuttx-apps#2403 |
Removed temporary fixes from this patch |
Thread args have already been saved to stack after the TLS section by nxtask_setup_stackargs. This is to retrieve it for use. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
f4ff342
to
75cafed
Compare
@xiaoxiang781216 it looks that the LTP timeouts in So looks like that I have to wait until CI is normal to trigger another check. |
@Donny9 is looking this problem. |
a7e0136
to
9868fb6
Compare
@anchao, @xiaoxiang781216 looks like the CI system is okay now. Please give this patch a review when free and let me know if there is anything I can do. |
0ef90ca
to
84d791e
Compare
Kthreads can share the group data so that to reduce overheads. This implements shared kthread group via: - use `tcb_s` instead of `task_tcb_s` for kthreads - use `g_kthread_group` when creating kthreads - use stackargs to start tasks and kthreads see pull/12320 for test logs. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
@xiaoxiang781216 looks like our CI got connectivity issue:
I forgot somewhere I saw other repositories using sub-module instead of download, not sure if it can reduce this kind of connectivity issues? Looks like the |
- replaces `ta_argv` with `stackargs` - drops `ta_argv` from `task_info_s` - drops `g_idleargv` and checks idle accordingly Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Summary
Current task group data is embedded in the task TCB, this is also used for kernel threads, which seems can share the
group
as they all live in kernel space.This patch uses
tcb_s
for kthreads with a sharedgroup
instance. Thus the overhead is reduced when more kthreads are in use.Memory usage of group instance, i.e.
sizeof(task_group_s)
, onrv-virt
device:Kernel memory footprints collected from attached logs:
The savings are beyond
sizeof(task_group_s)
due to subordinate data of groups.Impact
This may affect all configs.
Testing
nsh
,nsh64
,knsh32
andknsh64
. See logs-12320.tar.gz for more details:embedded
folder has logs from upstream version.kthreads
folder has logs from patched version.