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

   ## Summary
   `snoop_flush_lock()` and `snoop_dump()` wrapped their bodies in
   `enter_critical_section()`/`leave_critical_section()` on top of the
   `snoop->mutex` they already take. The critical section adds nothing: the
   task-context path is serialized by the mutex, and the interrupt-context path
   in `snoop_dump()` already runs with interrupts disabled. Holding a global
   critical section across `file_write()` and `file_fsync()` also blocks every
   CPU for the duration of the I/O.
   
   Drop both critical sections and leave the mutex as the only lock.
   
   File: `net/utils/net_snoop.c` (-6)
   
   ## Impact
   Affects Bluetooth/net snoop tracing only, and only when
   `CONFIG_NET_SNOOP` is enabled. The mutex still serializes the task-context
   writers, so the buffer and `snoop->next` stay protected. On SMP this
   removes a global stall around snoop file I/O.
   
   ## Testing
   Builds clean on `sim:bluetooth` with `CONFIG_NET_SNOOP=y`.
   


-- 
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]

  • [PR] bluetooth: net_snoop rem... zhhyu7 (via GitHub) via commits

Reply via email to