All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/4] Object creation with a specified id
@ 2008-03-10 13:50 Nadia.Derbey-6ktuUTfB/bM
  2008-03-10 13:50 ` [RFC][PATCH 1/4] Provide a new procfs interface to set next ipc id Nadia.Derbey-6ktuUTfB/bM
                   ` (4 more replies)
  0 siblings, 5 replies; 34+ messages in thread
From: Nadia.Derbey-6ktuUTfB/bM @ 2008-03-10 13:50 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: xemul-GEFAQzZX7r8dnm+yROfE0A


A couple of weeks ago, a discussion has started after Pierre's proposal for
a new syscall to change an ipc id (see thread
http://lkml.org/lkml/2008/1/29/209).


Oren's suggestion was to force an object's id during its creation, rather
than 1. create it, 2. change its id.

So here is an implementation of what Oren has suggested.

2 new files are defined under /proc/self:
  . next_ipcid --> next id to use for ipc object creation
  . next_pids --> next upid nr(s) to use for next task to be forked
                  (see patch #2 for more details).

When one of these files (or both of them) is filled, a structure pointed to
by the calling task struct is filled with these ids.

Then, when the object is created, the id(s) present in that structure are
used, instead of the default ones.

The patches are against 2.6.25-rc3-mm1, in the following order:

[PATCH 1/4] adds the procfs facility for next ipc to be created.
[PATCH 2/4] adds the procfs facility for next task to be forked.
[PATCH 3/4] makes use of the specified id (if any) to allocate the new IPC
            object (changes the ipc_addid() path).
[PATCH 4/4] uses the specified id(s) (if any) to set the upid nr(s) for a newly
            allocated process (changes the alloc_pid()/alloc_pidmap() paths).

Any comment and/or suggestions are welcome.

Cc-ing Pavel and Sukadev, since they are the pid namespace authors.

Regards,
Nadia

--

--

^ permalink raw reply	[flat|nested] 34+ messages in thread
* [RFC][PATCH 0/4] Object creation with a pre-defined id (v2)
@ 2008-03-28  9:53 Nadia.Derbey-6ktuUTfB/bM
  2008-03-28  9:53 ` [RFC][PATCH 4/4] PID: use the target ID specified in procfs Nadia.Derbey-6ktuUTfB/bM
  0 siblings, 1 reply; 34+ messages in thread
From: Nadia.Derbey-6ktuUTfB/bM @ 2008-03-28  9:53 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: xemul-GEFAQzZX7r8dnm+yROfE0A


Hi,

Here is a second version of what has been proposed 2 weeks ago to create
an object with a pre-defined id (this feature would be used during the
restart operation) - see thread https://lists.linux-foundation.org/pipermail/containers/2008-March/thread.html#10287

Main changes since last version:
  . Pavel's suggestion has been integrated; this makes things more readable:
    alloc_pidmap() is unchanged and a alloc_fixed_pidmap() is added for the
    predefined ids.
  . Oren's suggestion has been integrated:
    We now have a single file under /proc/self (/proc/self/next_id).
    When this file is filled, a structure pointed to by the calling task struct
    is filled with the id(s).
    Then, when the object is created, the id(s) present in that structure are
    used, instead of the default ones.
    The syntax is one of:
      . echo "LONG XX" > /proc/self/next_id
        next object to be created will have an id set to XX
      . echo "LONG<n> X0 ... X<n-1>" > /proc/self/next_id
        next object to be created will have its ids set to XX0, ... X<n-1>
        This is particularly useful for processes that may have several ids
        if they belong to nested namespaces.

The objects covered here are ipc objects and processes.

The patches are still against 2.6.25-rc3-mm1, in the following order:

[PATCH 1/4] adds the procfs facility for next object to be created, this
            object being associated to a single id.
[PATCH 2/4] enhances the procfs facility for objects associated to multiple
            ids (like processes).
[PATCH 3/4] makes use of the specified id (if any) to allocate the new IPC
            object (changes the ipc_addid() path).
[PATCH 4/4] uses the specified id(s) (if any) to set the upid nr(s) for a newly
            allocated process (changes the alloc_pid() path).

Any comment and/or suggestions are welcome.

Regards,
Nadia

--

^ permalink raw reply	[flat|nested] 34+ messages in thread
* [RFC][PATCH 0/4] Object creation with a specified id
@ 2008-04-04 14:51 Nadia.Derbey
  2008-04-04 14:51 ` [RFC][PATCH 4/4] PID: use the target ID specified in procfs Nadia.Derbey-6ktuUTfB/bM
  2008-04-04 14:51 ` Nadia.Derbey
  0 siblings, 2 replies; 34+ messages in thread
From: Nadia.Derbey @ 2008-04-04 14:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: containers, orenl


Hi,


When restarting a process that has been previously checkpointed, that process
should keep on using some of its ids (such as its process id, or sysV ipc ids).

This patch provides a feature that can help ensuring this saved state reuse:
it makes it possible to create an object with a pre-defined id.

A first implementation had been proposed 2 months ago. It consisted in
changing an object's id after it had been created.

Here is a second implementation based on Oren Ladaan's idea: Oren's suggestion
was to force an object's id during its creation, rather than 1. create it,
2. change its id.

A new file is created  in procfs: /proc/self/next_id.

When this file is filled with and id value, a structure pointed to by the
calling task struct is filled with that id.

Then, when an object supporting this feature is created, the id present in
that new structure is used, instead of the default one.

The syntax is one of:
   . echo "LONG XX" > /proc/self/next_id
     next object to be created will have an id set to XX
   . echo "LONG<n> X0 ... X<n-1>" > /proc/self/next_id
     next object to be created will have its ids set to XX0, ... X<n-1>
     This is particularly useful for processes that may have several ids if
     they belong to nested namespaces.

The objects covered here are ipc objects and processes.
Today, the ids are specified as long, but having a type string specified in
the next_id file makes it possible to cover more types in the future, if
needed.

The patches are against 2.6.25-rc3-mm1, in the following order:

[PATCH 1/4] adds the procfs facility for next object to be created, this
            object being associated to a single id.
[PATCH 2/4] enhances the procfs facility for objects associated to multiple
            ids (like processes).
[PATCH 3/4] makes use of the specified id (if any) to allocate the new IPC
            object (changes the ipc_addid() path).
[PATCH 4/4] uses the specified id(s) (if any) to set the upid nr(s) for a newly
            allocated process (changes the alloc_pid()/alloc_pidmap() paths).

Any comment and/or suggestions are welcome.

Regards,
Nadia

--
--

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2008-04-04 15:02 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-10 13:50 [RFC][PATCH 0/4] Object creation with a specified id Nadia.Derbey-6ktuUTfB/bM
2008-03-10 13:50 ` [RFC][PATCH 1/4] Provide a new procfs interface to set next ipc id Nadia.Derbey-6ktuUTfB/bM
2008-03-10 13:50 ` [RFC][PATCH 2/4] Provide a new procfs interface to set next upid nr(s) Nadia.Derbey-6ktuUTfB/bM
2008-03-10 13:50 ` [RFC][PATCH 3/4] IPC: use the target ID specified in procfs Nadia.Derbey-6ktuUTfB/bM
2008-03-10 13:50 ` [RFC][PATCH 4/4] PID: " Nadia.Derbey-6ktuUTfB/bM
     [not found]   ` <20080310135209.769712000-6ktuUTfB/bM@public.gmane.org>
2008-03-11 12:04     ` Pavel Emelyanov
     [not found]       ` <47D67557.7080506-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-11 15:28         ` Nadia Derbey
     [not found]           ` <47D6A52D.6030701-6ktuUTfB/bM@public.gmane.org>
2008-03-11 15:37             ` Pavel Emelyanov
     [not found]               ` <47D6A741.9080708-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-11 15:55                 ` Nadia Derbey
2008-03-11 16:47                 ` Serge E. Hallyn
     [not found]                   ` <20080311164725.GA12918-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2008-03-11 16:55                     ` Pavel Emelyanov
     [not found]                       ` <47D6B990.4080400-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-11 17:53                         ` Serge E. Hallyn
     [not found]                           ` <20080311175328.GA14171-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2008-03-12 19:58                             ` Eric W. Biederman
     [not found]                               ` <m1zlt3yarj.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2008-03-13 10:41                                 ` Nadia Derbey
     [not found]                                   ` <47D904E4.4000208-6ktuUTfB/bM@public.gmane.org>
2008-03-13 17:40                                     ` Eric W. Biederman
     [not found]                                       ` <m1r6eewmj2.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2008-03-13 19:06                                         ` Serge E. Hallyn
2008-03-13 20:01                                         ` Oren Laadan
     [not found]                                           ` <47D987FE.9040909-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-13 23:12                                             ` Eric W. Biederman
     [not found]                                               ` <m163vqw74n.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2008-03-13 23:24                                                 ` Oren Laadan
     [not found] ` <20080310135054.312992000-6ktuUTfB/bM@public.gmane.org>
2008-03-13 23:16   ` [RFC][PATCH 0/4] Object creation with a specified id Oren Laadan
     [not found]     ` <47D9B5B7.6060803-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-14  6:21       ` Nadia Derbey
     [not found]         ` <47DA195B.8070704-6ktuUTfB/bM@public.gmane.org>
2008-03-14 15:50           ` Oren Laadan
     [not found]             ` <47DA9EB5.8040704-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-14 15:56               ` Pavel Emelyanov
     [not found]                 ` <47DAA041.9090009-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-14 16:02                   ` Oren Laadan
     [not found]                     ` <47DAA1A6.6010509-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-14 16:08                       ` Pavel Emelyanov
2008-03-14 16:11                   ` Nadia Derbey
2008-03-14 16:11               ` Nadia Derbey
     [not found]                 ` <47DAA3AA.4050906-6ktuUTfB/bM@public.gmane.org>
2008-03-14 16:45                   ` Oren Laadan
     [not found]                     ` <47DAABAB.7000706-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-16  3:43                       ` Serge E. Hallyn
     [not found]                         ` <20080316034320.GA19793-6s5zFf/epYLPQpwDFJZrxFMas7LaWZ9n@public.gmane.org>
2008-03-16 19:08                           ` Oren Laadan
     [not found]                             ` <47DD703C.4030809-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-17 14:44                               ` Serge E. Hallyn
  -- strict thread matches above, loose matches on Subject: below --
2008-03-28  9:53 [RFC][PATCH 0/4] Object creation with a pre-defined id (v2) Nadia.Derbey-6ktuUTfB/bM
2008-03-28  9:53 ` [RFC][PATCH 4/4] PID: use the target ID specified in procfs Nadia.Derbey-6ktuUTfB/bM
2008-04-04 14:51 [RFC][PATCH 0/4] Object creation with a specified id Nadia.Derbey
2008-04-04 14:51 ` [RFC][PATCH 4/4] PID: use the target ID specified in procfs Nadia.Derbey-6ktuUTfB/bM
2008-04-04 14:51 ` Nadia.Derbey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.