Skip to content

RFC Object creation with a pre-defined id (v2)

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Provide a new procfs interface to set next idfs/proc/base.c include/linux/sched.h include/linux/sysids.h +3 more+166 -11 reply
2/4Provide a new procfs interface to set next upid nr(s)include/linux/sysids.h kernel/nextid.c+153 -200 replies
3/4IPC: use the target ID specified in procfsinclude/linux/sysids.h ipc/util.c kernel/nextid.c+39 -90 replies
4/4PID: use the target ID specified in procfsinclude/linux/pid.h kernel/fork.c kernel/pid.c+126 -200 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] Object creation with a pre-defined id (v2)

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

--