-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
riscv: use g_running_task store current regs #13585
Conversation
[Experimental Bot, please feedback here] The PR summary is missing some information, and the Testing section is incomplete. Here's a breakdown: Summary - Needs Improvement
Impact - Needs Improvement
Testing - Incomplete
To improve this PR:
By providing this additional information, you'll make it easier for reviewers to understand and approve your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested OK with OSTest on rv-virt:knsh, rv-virt:knsh64 and milkv_duos:nsh. Thanks!
Hi @tmedicci would you need to test this on ESP32 RISC-V? Thanks! |
@hujun260 I rebooted and retested OSTest, 10 times on rv-virt:knsh64. Out of the 10 tests, 1 test failed at vfork. Would you know what's causing this? Thanks! https://gist.github.com/lupyuen/cebee9e69f23047476a7a5305f595fa6
Update: Out of 20 reboots and retests, 2 failed with the vfork error. So the failure rate is 10%. |
ok i'll try to reproduce |
@hujun260 I did some more Stress Testing:
So this vfork problem might be introduced in the past 2 weeks? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do more analysis on the vfork issue, to ensure it's not caused by this PR. Thanks!
|
@lupyuen Could you send me your stress testing script? I can occasionally reproduce the issue on my side, but the efficiency is relatively low. |
@hujun260 Here's my Stress Test Script that will run 20 times: https://github.com/lupyuen/nuttx-riscv64/blob/main/special-qemu-riscv-knsh64.sh Please change https://github.com/apache/nuttx/tree/master to https://github.com/hujun260/nuttx/tree/apache_11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested OK with OSTest on rv-virt:knsh, rv-virt:knsh64 and milkv_duos:nsh.
Stressed Tested 200 times (reboot + ostest) on rv-virt:knsh64. All 200 times succeeded 🎉 Thanks :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stress Test of rv-virt:knsh64 (reboot qemu + restart ostest) succeeded for all 200 iterations. Also tested OK with OSTest on milkv_duos:nsh. Thank you so much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested: Stress Test of rv-virt:knsh64 (reboot qemu + restart ostest) succeeded for all 200 iterations. Also tested OK with OSTest on milkv_duos:nsh. Thank you so much!
This commit fixes the regression from apache#13561 In order to determine whether a context switch has occurred, we can use g_running_task to store the current regs. This allows us to compare the current register state with the previously stored state to identify if a context switch has taken place. Signed-off-by: hujun5 <[email protected]>
FYI All the Daily Tests are successful now 🎉 |
Summary
This commit fixes the regression from #13561
In order to determine whether a context switch has occurred, we can use g_running_task to store the current regs. This allows us to compare the current register state with the previously stored state to identify if a context switch has taken place.
Impact
riscv
Testing
rv-virt:knsh
rv-virt:knsh64
rv-virt:smp