-
Notifications
You must be signed in to change notification settings - Fork 1.5k
remove up_cpu_pause up_cpu_resume up_cpu_paused up_cpu_pausereq #13863
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
Conversation
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason: To remove the "sync pause" and decouple the critical section from the dependency on enabling interrupts, after that we need to further implement "schedlock + spinlock". changelist 1 Modify the implementation of critical sections to no longer involve enabling interrupts or handling synchronous pause events. 2 GIC_SMP_CPUCALL attach to pause handler to remove arch interface up_cpu_paused_restore up_cpu_paused_save 3 Completely remove up_cpu_pause, up_cpu_resume, up_cpu_paused, and up_cpu_pausereq 4 change up_cpu_pause_async to up_send_cpu_sgi Signed-off-by: hujun5 <hujun5@xiaomi.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Signed-off-by: hujun5 <hujun5@xiaomi.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
I noticed that ostest crashes now with rv-virt:netnsh64_smp after merging this PR. |
|
Hi @hujun260 ,
|
Try it. Removing that SMP support allows context switches to occur in the middle of a critical section and completely breaks the critical section logic. A variety of unpredictable bad results will occur occasionally. I am not sure why that is. I suspect that this is caused beccause with this change, interrupts are no longer disabled on the other CPUs and there are probably ways that interrupt activity can force context switches. |
|
The crash call stack: The firmware: |
Thanks for your comment, Greg. The assertion started triggering after these commits were added. Checking out to the revision just before them being merged works as expected |
CONFIG_SCHED_BACKTRACE=y i just want to know call stack like this |
See below.
Use the device as a Wi-Fi AP and connect your PC to it. Run the server on the device and the client on PC: The client (PC): Update firmware archives: |
Thank you very much. I roughly understand the cause and am considering a solution. |
reason: If we need to handle a tcb that is running on another CPU, we need to process it through the smpcall method. This commit fixes the regression from apache#13863 Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason: If we need to handle a tcb that is running on another CPU, we need to process it through the smpcall method. This commit fixes the regression from apache#13863 Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason: If we need to handle a tcb that is running on another CPU, we need to process it through the smpcall method. This commit fixes the regression from apache#13863 Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason: If we need to handle a tcb that is running on another CPU, we need to process it through the smpcall method. This commit fixes the regression from #13863 Signed-off-by: hujun5 <hujun5@xiaomi.com>
reason: If we need to handle a tcb that is running on another CPU, we need to process it through the smpcall method. This commit fixes the regression from apache#13863 Signed-off-by: hujun5 <hujun5@xiaomi.com>

Summary
remove up_cpu_pause up_cpu_resume up_cpu_paused up_cpu_pausereq
reaeon:
To remove the "sync pause" and decouple the critical section from the dependency on enabling interrupts,
after that we need to further implement "schedlock + spinlock".
changelist
1 Modify the implementation of critical sections to no longer involve enabling interrupts or handling synchronous pause events.
2 GIC_SMP_CPUCALL attach to pause handler to remove arch interface up_cpu_paused_restore up_cpu_paused_save
3 Completely remove up_cpu_pause, up_cpu_resume, up_cpu_paused, and up_cpu_pausereq
4 change up_cpu_pause_async to up_send_cpu_sgi
Impact
arch
size nuttx
text data bss dec hex filename
271456 51066 63336 385858 5e342 nuttx
before
text data bss dec hex filename
272468 51066 63384 386918 5e766 nuttx
size -1060
Testing