Skip to content

heap setup/cleanup fixes, refactorings & more

Jan Kiszka xenomai 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest9 patches 22 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9native: Release fastlock to the proper heapksrc/skins/native/mutex.c+12 -20 replies
2/9nucleus: Use Linux spin lock for heap list managementksrc/nucleus/heap.c+12 -140 replies
3/9nucleus: Fix race window in heap mapping procedureinclude/asm-generic/bits/heap.h include/asm-generic/system.h ksrc/nucleus/heap.c +1 more+33 -330 replies
4/9nucleus: xnheap_destroy does not failinclude/nucleus/heap.h ksrc/nucleus/heap.c ksrc/skins/native/heap.c +2 more+17 -210 replies
5/9nucleus: Avoid returning errors from xnheap_destroy_mappedinclude/nucleus/heap.h ksrc/nucleus/heap.c ksrc/skins/native/heap.c +2 more+43 -5616 replies
6/9rtai: Try to fix _shm_freeksrc/skins/rtai/shm.c+19 -121 reply
7/9native: Do not requeue on auto-cleanup errorsinclude/native/ppd.h+4 -120 replies
8/9native: Fix memory leak on heap/queue auto-deletionksrc/skins/native/heap.c ksrc/skins/native/queue.c ksrc/skins/native/syscall.c+16 -191 reply
9/9nucleus: Include all heaps in statisticsinclude/nucleus/heap.h ksrc/drivers/ipc/iddp.c ksrc/drivers/ipc/xddp.c +12 more+169 -375 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [Xenomai-core] [PATCH v3 0/9] heap setup/cleanup fixes, refactorings & more

Third round of this series. This time I dug deeper into the heap management, trying to simplify its use which should remove a few race conditions of the existing code.

The central change is patch 5: xnheap_destroy_mapped will no longer return an error, it will always start deferred deletion in case the heap's memory is still in use. This simplifies the use a lot, allowing among other things to drop -EBUSY from the list of possible return codes of rt_queue/heap_delete.

The series furthermore contains an attempt to fix RTAI's shm code, fixes the know leakages of rt_mutex/queue/heap auto-deletion and introduces complete heap statistics (this time without using a Linux spin lock).

Please pull the series (or cherry-pick individual patches) from

git://xenomai.org/xenomai-jki.git for-upstream

if there are no concerns.

Jan Kiszka (9):
native: Release fastlock to the proper heap
nucleus: Use Linux spin lock for heap list management
nucleus: Fix race window in heap mapping procedure
nucleus: xnheap_destroy does not fail
nucleus: Avoid returning errors from xnheap_destroy_mapped
rtai: Try to fix _shm_free
native: Do not requeue on auto-cleanup errors
native: Fix memory leak on heap/queue auto-deletion
nucleus: Include all heaps in statistics

 include/asm-generic/bits/heap.h |    2 +-
 include/asm-generic/system.h    |    2 +-
 include/native/ppd.h            |   16 +--
 include/nucleus/heap.h          |   32 +++--
 ksrc/drivers/ipc/iddp.c         |    3 +-
 ksrc/drivers/ipc/xddp.c         |    6 +-
 ksrc/nucleus/heap.c             |  258 +++++++++++++++++++++++++++------------
 ksrc/nucleus/module.c           |    2 +-
 ksrc/nucleus/pod.c              |    5 +-
 ksrc/nucleus/shadow.c           |    5 +-
 ksrc/skins/native/heap.c        |   41 +++---
 ksrc/skins/native/mutex.c       |   14 ++-
 ksrc/skins/native/pipe.c        |    4 +-
 ksrc/skins/native/queue.c       |   34 +++---
 ksrc/skins/native/syscall.c     |   25 +---
 ksrc/skins/posix/shm.c          |    4 +-
 ksrc/skins/psos+/rn.c           |    6 +-
 ksrc/skins/rtai/shm.c           |   47 ++++---
 ksrc/skins/vrtx/heap.c          |    6 +-
 ksrc/skins/vrtx/syscall.c       |    3 +-
 20 files changed, 317 insertions(+), 198 deletions(-)

[1] http://thread.gmane.org/gmane.linux.real-time.xenomai.devel/6559