Skip to content

ipc,namespace: fix free vs allocation race

Rik van Riel linux-fsdevel lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 1 replySuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ipc,namespace: make ipc namespace allocation wait for pending freeipc/namespace.c+16 -60 replies
2/2ipc,namespace: batch free ipc_namespace structuresfs/namespace.c include/linux/mount.h ipc/mqueue.c +2 more+25 -140 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchGiuseppe Scrivano
SeriesT-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] ipc,namespace: fix free vs allocation race

The IPC namespace code frees ipc_namespace structures asynchronously, via a work queue item. This results in ipc_namespace structures being freed very slowly, and the allocation path getting false failures since the to-be-freed ipc_namespace structures have not been freed yet.

Fix that by having the allocator wait when there are ipc_namespace structures pending to be freed.

Also speed up the freeing of ipc_namespace structures. We had some discussions about this last year, and ended up trying out various "nicer" ideas that did not work, so I went back to the original, with Al Viro's suggestion for a helper function:

https://lore.kernel.org/all/[email protected]/

This series fixes both the false allocation failures, and the slow freeing of ipc_namespace structures.

v3: remove mq_put_mnt (thank you Giuseppe)
v2: a few more fs/namespace.c cleanups suggested by Al Viro (thank you!)