Linux Container Development
 help / color / mirror / Atom feed
From: Nadia.Derbey-6ktuUTfB/bM@public.gmane.org
To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: [RFC PATCH 0/6] SYSVIPC/semaphores - allow saving/restoring a process' semundo_list
Date: Wed, 25 Jun 2008 15:49:10 +0200	[thread overview]
Message-ID: <20080625134910.487216000@bull.net> (raw)


This patchset is a part of an effort to make sysv ipc objects
read/writable from userspace for checkpoint / restart.

System V ipc's are objects that are global to a system and can thus be
checkpointed and restarted on a container basis. But some parts of the ipc
structures are process related and, as such should be checkpointed / restarted
on a process basis.

Message queues needn't and thus cannot be reached from a task structure
(only the other direction is possible: a task can be reached by a msg receiver
or sender structure if it is sleeping).

Shared memories are accessible from a task structure through that task's
memory mapping (/proc/<pid>/maps shows a process' memory maps).

Semaphores are kind of accessible from a task structure too: the task
structure's sysvsem field makes it possible to walk through all the semaphores
operations to undo when a process is exiting.
This list, that need to be saved and restored during a process' c/r,
cannot yet be accessed from user space.

This is a feature that will be needed if ever we take the direction of driving
checkpoint / restart from user space, though the read part of it could be used
even from now on.

Since this undo_list is, again, on a thread basis, we propose to externalize
it via a new proc file: /proc/<pid>/semundo.

Actually, Pierre Pieffer has already done the proposal in threads
https://lists.linux-foundation.org/pipermail/containers/2008-January/thread.html#9756
up to #9759

I've ported them to 2.6.26-rc5-mm3, and I'm now coming back with a
simpler implementation: the write operation is now only allowed into
/proc/self/semundo, which simplifies the locking strategy.


These patches should be applied to 2.6.26-rc5-mm3, in the following order:
[ PATCH 1/6] : ipc_rcu_protect_access_to_undo_list.patch
               Makes the process' undo_list rcu protected in order to enable
               safely reading it.
[ PATCH 2/6] : ipc_procfs_semundo_file.patch
               Introduces the semundo proc file (the seq operations are still
               empty).
[ PATCH 3/6] : ipc_procfs_semundo_start_stop_seqops.patch
               Introduces the .start and .stop seq operations.
[ PATCH 4/6] : ipc_procfs_semundo_next_seqop.patch
               Introduces the .next seq operation.
[ PATCH 5/6] : ipc_procfs_semundo_show_seqop.patch
               Introduces the .show seq operation.
[ PATCH 6/6] : ipc_procfs_semundo_write.patch
               The semundo proc file becomes writable.

Comments are welcome!

Regards,
Nadia

--

             reply	other threads:[~2008-06-25 13:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 13:49 Nadia.Derbey-6ktuUTfB/bM [this message]
2008-06-25 13:49 ` [RFC PATCH 1/6] IPC/sem: RCU-protect the process semundo list Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080625135538.385496000-6ktuUTfB/bM@public.gmane.org>
2008-06-25 20:33     ` Serge E. Hallyn
2008-06-25 13:49 ` [RFC PATCH 2/6] IPC/sem: per <pid> semundo file in procfs Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080625135538.762662000-6ktuUTfB/bM@public.gmane.org>
2008-06-25 20:33     ` Serge E. Hallyn
2008-06-26  5:08     ` Michael Kerrisk
     [not found]       ` <517f3f820806252208m1f5b91dfm38b8babff73adf72-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-06-26  6:07         ` Nadia Derbey
2008-06-25 13:49 ` [RFC PATCH 3/6] IPC/sem: start/stop operations for /proc/pid/semundo Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080625135539.139605000-6ktuUTfB/bM@public.gmane.org>
2008-06-25 20:39     ` Serge E. Hallyn
2008-06-25 13:49 ` [RFC PATCH 4/6] IPC/sem: next " Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080625135539.519489000-6ktuUTfB/bM@public.gmane.org>
2008-06-25 20:57     ` Serge E. Hallyn
     [not found]       ` <20080625205719.GD16374-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-06-26  5:35         ` Nadia Derbey
2008-06-25 13:49 ` [RFC PATCH 5/6] IPC/sem: .show operation " Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080625135539.893049000-6ktuUTfB/bM@public.gmane.org>
2008-06-25 20:58     ` Serge E. Hallyn
2008-06-25 13:49 ` [RFC PATCH 6/6] IPC/sem: .write operation for /proc/<self>/semundo Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080625135540.271934000-6ktuUTfB/bM@public.gmane.org>
2008-06-25 21:09     ` Serge E. Hallyn
     [not found]       ` <20080625210937.GF16374-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-06-26  5:44         ` Nadia Derbey
2008-06-27 14:06     ` Serge E. Hallyn
     [not found]       ` <20080627140607.GA20581-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-06-27 14:12         ` Nadia Derbey
2008-06-30  8:37         ` Nadia Derbey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080625134910.487216000@bull.net \
    --to=nadia.derbey-6ktuutfb/bm@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox