anchao commented on PR #13129:
URL: https://github.com/apache/nuttx/pull/13129#issuecomment-2316687622

   > @anchao Do you mean leave_critical_section before all malloc/free?
   > 
   > This has been modified, but the functionality of this method seems to have 
no difference Because of the check, calling malloc/free in the critical section 
will not have any effect
   
   In SMP, holding critical_section and then holding mm_lock may cause `ABBA` 
deadlock. For example, critical_section is used in the lower half of mm 
implementation:
   
   ```
   enter_critical_section(spin_lock)
   mm_lock
   enter_critical_section(spin_lock) <-- deadlock
   ```
   
   Please make sure that there is no habit of repeated locking in the code 
path, which may cause serious issues.


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