-
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
arm: g_current_regs is only used to determine if we are in irq, #13444
Conversation
f483c8f
to
70970df
Compare
f63fe3e
to
b996852
Compare
[Experimental Bot, please feedback here] NuttX PR Requirements ReviewWhile the provided summary gives a high-level idea of the change, it lacks some important details. Here's a breakdown of what's missing and how to improve the PR: Summary:
Impact:
Testing:
Overall: The PR is incomplete and needs more details to meet the NuttX requirements. Provide the missing information and address all the impact points clearly. Detailed testing information, including logs, is crucial for reviewers to evaluate your changes effectively. |
i update the pr |
ab6070b
to
3a66943
Compare
please fix conflict, @hujun260 |
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. |
with other functionalities removed. reason: by doing this we can reduce context switch time, When we exit from an interrupt handler, we directly use tcb->xcp.regs before size nuttx text data bss dec hex filename 225920 409 30925 257254 3ece6 nuttx after text data bss dec hex filename 225604 409 30925 256938 3ebaa nuttx szie change -316 Signed-off-by: hujun5 <[email protected]>
Signed-off-by: hujun5 <[email protected]>
Signed-off-by: hujun5 <[email protected]>
with other functionalities removed. Signed-off-by: hujun5 <[email protected]>
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. |
@hujun260 |
ok i'll look into this issue |
…basis for judging whether to call restore_critical_section. This commit fixes the regression from apache#13444 Signed-off-by: hujun5 <[email protected]>
#13598 fix this issue |
…basis for judging whether to call restore_critical_section. This commit fixes the regression from #13444 Signed-off-by: hujun5 <[email protected]>
…basis for judging whether to call restore_critical_section. This commit fixes the regression from apache#13444 Signed-off-by: hujun5 <[email protected]>
Summary
Why
When a context switch occurs currently, the context before the interrupt is fetched from the global variable g_current_regs and then stored in the corresponding tcb->xcp.regs. Subsequently, the new context is assigned to g_current_regs. When returning from the interrupt context, the context is retrieved from g_current_regs and used.
In reality, we do not necessarily require this intermediate variable g_current_regs to accomplish a context switch. Eliminating it avoids multiple assignments, especially during multiple context switches within interrupts, which can lead to repeated assignments.
All we need is to work directly with the context of the currently running task. This approach enhances the speed of context switching, reduces the code base, and optimizes signal handling logic. By simply leveraging the context of the active task, we can streamline the process and improve overall efficiency.
reason:
by doing this we can reduce context switch time,
When we exit from an interrupt handler, we directly use tcb->xcp.regs
Missing Information:
Related Issues: none
NuttX Apps Impact: none
Impact
Is a new feature added? NO
Is an existing feature changed? yes
g_current_regs is only used to determine if we are in irq with other functionalities removed.
We need to use up_interrupt_context for interrupt identification instead of relying on up_current_regs for that purpose.
before
size nuttx
text data bss dec hex filename
225920 409 30925 257254 3ece6 nuttx
after
text data bss dec hex filename
225604 409 30925 256938 3ebaa nuttx
szie change -316
Testing
Build Host:
Target:
logs:
NO change