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/idle: disable sched when idle call nx_bringup #4026
Conversation
Because idle task will call mm_malloc to create some task and will take sem of mm. But if smp enable, the sem of mm may be taken by other cpu, so idle may be block because take this sem and crash. Change-Id: I22f0233ef6c59a1b81607d4389e68f8646c89395 Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
@Donny9 |
@Donny9 @xiaoxiang781216 |
We don't have this hardware, can you describe this deadlock in more detail, which lock cause the deadlock ? I test this pr in A7 smp, it's normal. |
Though this is spresense specific, it stops in the clock initialization.
|
Thank you , i will check this issue. |
@masayuki2009 The root cause of deadlock is that new task can't be sched and post semaphore, because i add sched_lock and sched_unlock before and after nx_bringup. But If we don't lock sched in smp, the system will crash because mem issue. How do you think this problem? |
@Donny9 |
@masayuki2009 cxd56_bringup shouldn't be called in idle thread and don't wait semaphore, we should fix this issue? |
@Donny9 |
Yes, you can try. |
This is a race condition hard to meet, but it will bite you later eventually. Our SMP system run more than half year without any issue, but stop boot suddenly. So a kconfig isn't a good candidate here. |
@xiaoxiang781216 |
Summary
Because idle task will call mm_malloc to create some task
and will take sem of mm. But if smp enable, the sem of mm may be
taken by other cpu, so idle may be block because take this sem and crash.
Change-Id: I22f0233ef6c59a1b81607d4389e68f8646c89395
Signed-off-by: Jiuzhu Dong dongjiuzhu1@xiaomi.com
Impact
normal boot for smp
Testing
maual test