x86_64: remove unnecessary restore_critical_section call in interrupt handler #18051
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes an unnecessary restore_critical_section() call from the x86_64 interrupt handler. Similar to the simulator architecture, analysis shows the critical section state is properly managed by the interrupt framework and does not need to be explicitly restored during interrupt context task switches. This simplifies the code and eliminates redundant operations.
Changes Made
Impact
• Code Quality: Simplifies interrupt handler implementation
• Performance: Eliminates redundant lock restoration operations
• Maintainability: Reduces confusion about when restore_critical_section should be called
• Compatibility: No behavioral changes, interrupt handling remains unchanged
Testing
Test Environment:
• Host: Linux x86_64
• Board: x86_64 simulator/QEMU
• Configuration: NuttX with interrupt handling and SMP support
Test Procedure:
Test Results:
Interrupt Handling Verification:
Multi-task Execution:
Critical Section Management:
Stress Testing:
Verification Checklist:
• ✅ Interrupt handling works without restore_critical_section call
• ✅ Critical section state properly maintained in all scenarios
• ✅ Task context switches work correctly during interrupts
• ✅ No deadlocks or synchronization issues observed
• ✅ No regressions in interrupt processing
• ✅ SMP operation unaffected
• ✅ OSTest passed without failures
Related Issues
Simplifies unnecessary critical section management in x86_64 interrupt handler, consistent with similar optimizations in other architectures.