Repository navigation
Conversation
4e30316 to
3435fb0
Compare
f35b8c9 to
39a11bd
Compare
linguini1
left a comment
There was a problem hiding this comment.
This PR is going to need significant testing and proof of testing, including across multiple hardware targets.
Also, please stop including "files changed" in your PR descriptions. We can see the list of changed files with the diff.
Your description claims docs were updated, but the diff doesn't show any docs changes.
b2c13a0 to
4d525d0
Compare
Since this patch series involves adding numerous headers based on CI compilation errors, I need to trigger the CI pipeline repeatedly. |
Since this patch series involves adding numerous headers based on CI compilation errors, I need to trigger the CI pipeline repeatedly.
I tried running it locally, but the behavior doesn't exactly match the CI server, and I couldn't get it to pass completely. |
Remove unnecessary preprocessor #undef directives to improve code clarity and reduce conditional compilation complexity. This cleanup aligns with the refactored critical section interface. Signed-off-by: hujun5 <[email protected]>
Consolidate architecture-specific context switching by replacing up_switch_context with unified nxsched_switch interface, reducing code duplication and improving scheduler integration consistency across all architecture implementations. Signed-off-by: hujun5 <[email protected]>
Optimize critical section usage by reducing protection scope to only cover essential operations, improving system responsiveness and reducing interrupt latency while maintaining synchronization safety. Signed-off-by: hujun5 <[email protected]>
Refactor critical section implementation to use rspinlock_t as the foundation, providing consistent synchronization semantics across SMP and non-SMP configurations with improved nesting support and reduced overhead. Signed-off-by: hujun5 <[email protected]>
Clean up and remove the deprecated irqcount field from task structures as it is no longer used by the refactored critical section implementation. This simplifies the TCB structure and reduces memory overhead. Signed-off-by: hujun5 <[email protected]>
Inline enter_critical_section function calls in performance-critical paths to reduce function call overhead while maintaining consistent semantics, improving overall system latency and responsiveness in real-time scenarios. Signed-off-by: hujun5 <[email protected]>
Optimize critical section implementation for non-SMP configurations by directly using up_irq_save/restore instead of rspinlock operations, reducing context switch overhead while maintaining compatibility with SMP code paths. Signed-off-by: hujun5 <[email protected]>
jerpelea
left a comment
There was a problem hiding this comment.
please split the PR in multple PRs that can be understood and reviewed
1.Critical Section Refactoring - Standardize interface naming, remove redundant declarations, and consolidate SMP/non-SMP code paths for improved maintainability and reduced compilation complexity.
2.Performance Optimization - Optimize critical section scope by narrowing protection windows to essential operations only, reducing interrupt latency and improving system responsiveness.
3.Architecture Consolidation - Replace up_switch_context with unified nxsched_switch interface across all architecture implementations for improved consistency and reduced code duplication.
4.Cleanup and Removal - Remove deprecated irqcount field and unnecessary preprocessor directives, simplifying the TCB structure and reducing memory overhead.
Add #include <nuttx/spinlock.h> to source files across avr, mips, renesas, and sparc architectures that use irqstate_t and critical section functions but were missing the required header file. Signed-off-by: hujun5 <[email protected]>
Summary
This pull request refactors the NuttX critical section implementation to use rspinlock_t as the unified foundation while optimizing performance for both SMP and non-SMP configurations. The series introduces enhanced spinlock operations, consolidates the scheduler interface, and eliminates deprecated synchronization mechanisms.
should merge after apache/nuttx-apps#3375
Changes Made
Critical Section Refactoring - Standardize interface naming, remove redundant declarations, and consolidate SMP/non-SMP code paths for improved maintainability and reduced compilation complexity.
Performance Optimization - Optimize critical section scope by narrowing protection windows to essential operations only, reducing interrupt latency and improving system responsiveness.
Architecture Consolidation - Replace
up_switch_contextwith unifiednxsched_switchinterface across all architecture implementations for improved consistency and reduced code duplication.Cleanup and Removal - Remove deprecated
irqcountfield and unnecessary preprocessor directives, simplifying the TCB structure and reducing memory overhead.TEST
OSTEST pass