nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

mm/mm_heap: move user buffer cleanup outside mm_lock()

Open anchao opened this issue 1 year ago • 3 comments

Summary

mm/mm_heap: move user buffer cleanup outside mm_lock()

  1. Move user buffer cleanup outside of mm_lock() to improve performance
  2. Fix free magic and posion mask is not set if hold mm_lock() failure

Signed-off-by: chao an [email protected]

Impact

N/A

Testing

ci-check

anchao avatar Jun 06 '24 07:06 anchao

Doen't this make finding the culprit of the double free (the caller) harder to find?

Yes, This PR needs optimize further, we must guarantee the atomicity of MM_ALLOC_BIT, and the current master may also misjudge under SMP case.

anchao avatar Jun 06 '24 08:06 anchao

Doen't this make finding the culprit of the double free (the caller) harder to find?

@davids5 Done, move the user memory cleanup outside of mm_lock() to improve RT performance

anchao avatar Jun 06 '24 08:06 anchao

ping @anchao

acassis avatar Jun 22 '24 22:06 acassis