Skip to content

RFC IPC/sem - allow saving/restoring a process semundo_list

Nadia.Derbey-6ktuUTfB/[email protected] containers 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4IPC/sem: use RCU to free the sem_undo_listinclude/linux/sem.h ipc/sem.c+37 -140 replies
2/4IPC/sem: per <pid> semundo file in procfsfs/proc/base.c fs/proc/internal.h ipc/sem.c+167 -00 replies
3/4IPC/sem: prepare semundo code to work on a third party taskipc/sem.c+83 -330 replies
4/4IPC/sem: add the write() operation to the semundo file in procfsfs/proc/base.c include/linux/sem.h ipc/sem.c+274 -90 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/4] IPC/sem - allow saving/restoring a process semundo_list

Hi,

A couple of months ago, Pierre Peiffer has submitted a patch series to enable checkpointing / restarting ipcs.
4 of these patches were related to semaphores:

https://lists.linux-foundation.org/pipermail/containers/2008-January/thread.html#9756
https://lists.linux-foundation.org/pipermail/containers/2008-January/thread.html#9757
https://lists.linux-foundation.org/pipermail/containers/2008-January/thread.html#9758
https://lists.linux-foundation.org/pipermail/containers/2008-January/thread.html#9759

They introduced a new procfs file: /proc/<pid>/semundo to read and write the semaphores undo values for a given process.

These patches are widely used in the -lxc development tree cryo code is based upon.
(more information about lxc can be found at http://lxc.sourceforge.net/ and the development tree can be found there too - under the patches link).

Manfred Spraul, on his side, has rewritten an important part of the semaphores code. See:

1. http://lkml.org/lkml/2008/5/24/92
2. http://lkml.org/lkml/2008/5/24/93
3. http://lkml.org/lkml/2008/5/24/90
4. http://lkml.org/lkml/2008/5/24/91

Mainly patches 1 and 4 made Pierre's patches unappliable.
. patch 1 changed the semundo_list proc_list field into a linked list. . patch 2
. reversed the locking order of the sem_undo_list lock and the semaphore
lock.
. converted the sem_undo structure to use rcu.

Since 2.6.26-rc5-mm3 is now the new target for the -lxc development tree, I've ported them and taking this opportunity to resubmit them to the containers list.

I have in mind a simpler solution, which I think I'll propose next week:
instead of writing into the /proc/<pid>/semundo of a third party process, only allow the write operation to be done for <current>.

Kathy, can you please pull in these patches?

Regards,
Nadia

--