wangzhi16 opened a new pull request, #18270:
URL: https://github.com/apache/nuttx/pull/18270

   ## Summary
   
   This PR aggregates three closely related architecture-level changes that 
optimize critical-section handling on various ARM platforms by replacing broad 
critical-section locks with more targeted spinlocks or mutexes. The goal is to 
clarify locking responsibilities, reduce contention, and improve system 
responsiveness.
   
   ## Included Commits
   
   - `b4f7a03` — arm64/common: Critical Section Optimization. — wangzhi16 
(2025-06-20)
     - Replace broad `critical_section` usage with spinlocks to protect 
distinct resources.
   
   - `23f98ce` — arm/phy62xx: Critical Section Optimization. — wangzhi16 
(2025-06-20)
     - Narrow critical-section scope by using more appropriate synchronization 
primitives (spinlocks) in PHY62xx code.
   
   - `90be4bc` — arm/rtl8720c: Critical Section Optimization. — wangzhi16 
(2025-06-20)
     - Replace `critical_section` with spinlock or mutex where appropriate in 
RTL8720C driver code.
   
   ## Rationale
   
   - Replacing coarse-grained `critical_section` usage with per-resource 
spinlocks/mutexes:
     - Clarifies which resource each lock protects, improving maintainability.
     - Reduces contention and blocking time for unrelated subsystems, improving 
responsiveness.
     - Enables finer-grained concurrency and potential performance benefits on 
multicore or high-interrupt-rate systems.
   
   ## Impact
   
   - Functional: No intended change to higher-level behavior; synchronization 
semantics should remain correct while reducing unnecessary blocking. Care must 
be taken to preserve lock ordering where multiple locks are acquired to avoid 
deadlocks.
   - Performance: Expected reduction in contention and improved system 
responsiveness, particularly under high concurrency or interrupt load.
   - Compatibility: Source-level changes; should compile normally. Reviewers 
should verify there are no subtle ordering or memory visibility regressions 
introduced by replacing `enter_critical_section`/`leave_critical_section` with 
spinlocks/mutexes.
   
   ## Testing
   
   1. Build validation
   
   ```bash
   ./tools/configure.sh -l <board_config>
   make -j$(nproc)
   ```
   
   2. Functional tests
   ```ostest
   ```
   
   PASS
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to