[Devel] [PATCH 1/9] Introduce trivial sys_checkpoint and sys_restore system calls

2008-09-03 Thread Andrey Mirkin
Right now they just return -ENOSYS. Later they will provide functionality to checkpoint and restart a container. Both syscalls take as arguments a file descriptor and flags. Also sys_checkpoint take as the first argument a PID of container's init (later it will be container ID); sys_restart takes

[Devel] [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Andrey Mirkin
This patchset introduces kernel based checkpointing/restart as it is implemented in OpenVZ project. This patchset has limited functionality and are able to checkpoint/restart only single process. Recently Oren Laaden sent another kernel based implementation of checkpoint/restart. The main differenc

[Devel] [PATCH 9/9] Introduce functions to restore mm

2008-09-03 Thread Andrey Mirkin
Functions to restore mm, VMAs and mm context are added. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- cpt/Makefile |2 +- cpt/cpt.h |1 + cpt/cpt_image.h |5 + cpt/rst_mm.c | 320 + cpt/rst_process.c |

[Devel] [PATCH 3/9] Introduce context structure needed during checkpointing/restart

2008-09-03 Thread Andrey Mirkin
Add functions for context allocation/destroy. Introduce functions to read/write image. Introduce image header and object header. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- cpt/cpt.h | 37 cpt/cpt_image.h | 63 +++ cpt/sys.c | 127

[Devel] [PATCH 2/9] Make checkpoint/restart functionality modular

2008-09-03 Thread Andrey Mirkin
A config option CONFIG_CHECKPOINT is introduced. New structure cpt_operations is introduced to store pointers to checkpoint/restart functions from module. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- cpt/Kconfig|7 +++ cpt/Makefile |4 cpt/cpt.h | 19

[Devel] [PATCH 8/9] Introduce functions to restart a process

2008-09-03 Thread Andrey Mirkin
Functions to restart process, restore its state, fpu and registers are added. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- arch/x86/kernel/entry_32.S | 21 +++ arch/x86/kernel/process_32.c |3 + cpt/Makefile |3 +- cpt/cpt.h|2 + cpt/res

[Devel] [PATCH 7/9] Introduce function for restarting a container

2008-09-03 Thread Andrey Mirkin
Actually, right now this function will restart only one process. Function to read head of dump file is introduced. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- cpt/Makefile |2 +- cpt/cpt.h |1 + cpt/restart.c | 87 +

[Devel] [PATCH 5/9] Introduce function to dump process

2008-09-03 Thread Andrey Mirkin
Functions to dump task struct, fpu state and registers are added. All IDs are saved from the POV of process (container) namespace. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- cpt/Makefile |2 +- cpt/checkpoint.c |2 +- cpt/cpt.h |1 + cpt/cpt_image.h | 123 ++

[Devel] [PATCH 6/9] Introduce functions to dump mm

2008-09-03 Thread Andrey Mirkin
Functions to dump mm struct, VMAs and mm context are added. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- arch/x86/mm/hugetlbpage.c |2 + cpt/Makefile |2 +- cpt/cpt.h |1 + cpt/cpt_image.h | 61 +++ cpt/cpt_mm.c | 431

[Devel] [PATCH 4/9] Introduce container dump function

2008-09-03 Thread Andrey Mirkin
Actually right now we are going to dump only one process. Function for dumping head of image file are added. Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> --- cpt/Makefile |2 +- cpt/checkpoint.c | 74 ++ cpt/cpt.h|3 ++

Re: [Devel] [RFC][PATCH 0/2] CR: save/restore a single, simple task

2008-09-03 Thread Andrey Mirkin
On Friday 22 August 2008 01:37 Serge E. Hallyn wrote: > Quoting Andrey Mirkin ([EMAIL PROTECTED]): > > On Friday 01 August 2008 01:28 Serge E. Hallyn wrote: > > > Quoting Andrey Mirkin ([EMAIL PROTECTED]): > > > > Hello Oren, > > > > > > > > That is great, that you have proposed your version of > >

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Cedric Le Goater
>> >> (3) move mq_ns out of nsproxy. where shall I put it then ? >> >> (3.1) task_struct ? >> (3.2) mnt namespace maybe ? > > I think the last one is the way to go. > > mnt_namespace points to mq_ns. > > At clone(CLONE_NEWMNT), the new mnt namespace receives a copy of the > parent's m

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Cedric Le Goater
Eric W. Biederman wrote: > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > >>> (3.2) mnt namespace maybe ? >> I think the last one is the way to go. >> >> mnt_namespace points to mq_ns. >> >> At clone(CLONE_NEWMNT), the new mnt namespace receives a copy of the >> parent's mq_ns. >> >> If a tas

[Devel] Re: [PATCH 1/9] Introduce trivial sys_checkpoint and sys_restore system calls

2008-09-03 Thread Cedric Le Goater
Andrey Mirkin wrote: > Right now they just return -ENOSYS. Later they will provide functionality > to checkpoint and restart a container. > > Both syscalls take as arguments a file descriptor and flags. > Also sys_checkpoint take as the first argument a PID of container's init > (later it will be

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Cedric Le Goater
Serge E. Hallyn wrote: > Quoting Eric W. Biederman ([EMAIL PROTECTED]): >> "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: >> (3.2) mnt namespace maybe ? >>> I think the last one is the way to go. >>> >>> mnt_namespace points to mq_ns. >>> >>> At clone(CLONE_NEWMNT), the new mnt namespace re

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Cedric Le Goater
Eric W. Biederman wrote: > Cedric Le Goater <[EMAIL PROTECTED]> writes: >> Hello Eric, >> >> I've spent some time on the code and I'm facing some issues with the nsproxy >> API if we are to keep the mqueue namespace in nsproxy: >> >> int copy_namespaces(unsigned long flags, struct task_struc

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Cedric Le Goater
Andrey Mirkin wrote: > This patchset introduces kernel based checkpointing/restart as it is > implemented in OpenVZ project. This patchset has limited functionality and > are able to checkpoint/restart only single process. Recently Oren Laaden > sent another kernel based implementation of checkpoin

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Eric W. Biederman
Cedric Le Goater <[EMAIL PROTECTED]> writes: > ok. complete isolation would require 2 steps. I guess this is > acceptable because mq uses a fs > > allowing the host to see the child's /dev/mqueue is also 'a nice > to have' feature. unfortunately, we can't do that for all namespaces, > for sysvipc

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Serge E. Hallyn
Quoting Cedric Le Goater ([EMAIL PROTECTED]): > Eric W. Biederman wrote: > > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > > > >>> (3.2) mnt namespace maybe ? > >> I think the last one is the way to go. > >> > >> mnt_namespace points to mq_ns. > >> > >> At clone(CLONE_NEWMNT), the new mnt na

Re: [Devel] Re: [RFC v2][PATCH 4/9] Memory management - dump state

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 16:15 Cedric Le Goater wrote: > Andrey Mirkin wrote: > > On Sunday 31 August 2008 21:34 Cedric Le Goater wrote: > >> Oren Laadan wrote: > >>> Dave, Serge: > >>> > >>> I'm currently away so I must keep this short. I think we have so far > >>> more discussion than an ac

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Serge E. Hallyn
Quoting Cedric Le Goater ([EMAIL PROTECTED]): > >> > >> (3) move mq_ns out of nsproxy. where shall I put it then ? > >> > >> (3.1) task_struct ? > >> (3.2) mnt namespace maybe ? > > > > I think the last one is the way to go. > > > > mnt_namespace points to mq_ns. > > > > At clone(CLON

Re: [Devel] Re: [RFC v2][PATCH 4/9] Memory management - dump state

2008-09-03 Thread Cedric Le Goater
Andrey Mirkin wrote: > On Sunday 31 August 2008 21:34 Cedric Le Goater wrote: >> Oren Laadan wrote: >>> Dave, Serge: >>> >>> I'm currently away so I must keep this short. I think we have so far >>> more discussion than an actual problem. I'm happy to coordinate with >>> every interested party to ev

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Serge E. Hallyn
Quoting Cedric Le Goater ([EMAIL PROTECTED]): > Serge E. Hallyn wrote: > > Quoting Eric W. Biederman ([EMAIL PROTECTED]): > >> "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > >> > (3.2) mnt namespace maybe ? > >>> I think the last one is the way to go. > >>> > >>> mnt_namespace points to m

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Louis Rilling
On Wed, Sep 03, 2008 at 02:57:47PM +0400, Andrey Mirkin wrote: > This patchset introduces kernel based checkpointing/restart as it is > implemented in OpenVZ project. This patchset has limited functionality and > are able to checkpoint/restart only single process. Recently Oren Laaden > sent anothe

[Devel] Re: [PATCH 3/9] Introduce context structure needed during checkpointing/restart

2008-09-03 Thread Louis Rilling
On Wed, Sep 03, 2008 at 02:57:50PM +0400, Andrey Mirkin wrote: > Add functions for context allocation/destroy. > Introduce functions to read/write image. > Introduce image header and object header. > [...] > diff --git a/cpt/cpt_image.h b/cpt/cpt_image.h > new file mode 100644 > index 000..3

[Devel] Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts

2008-09-03 Thread Cedric Le Goater
>>> When a task does mq_open(name, flag), then name is in the mqueuefs >>> found in current->nsproxy->mnt_namespace->mqns. >>> >>> But if a task does >>> >>> clone(CLONE_NEWMNT); >>> mount --move /dev/mqueue /oldmqueue >>> mount -o newinstance -t mqueue none /dev/mqueue >>> >>> then tha

[Devel] Re: [PATCH 3/9] Introduce context structure needed during checkpointing/restart

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 17:56 Louis Rilling wrote: > On Wed, Sep 03, 2008 at 02:57:50PM +0400, Andrey Mirkin wrote: > > Add functions for context allocation/destroy. > > Introduce functions to read/write image. > > Introduce image header and object header. > > [...] > > > diff --git a/cpt/cp

Re: [Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 16:28 Cedric Le Goater wrote: > Andrey Mirkin wrote: > > This patchset introduces kernel based checkpointing/restart as it is > > implemented in OpenVZ project. This patchset has limited functionality > > and are able to checkpoint/restart only single process. Recentl

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Louis Rilling
On Wed, Sep 03, 2008 at 03:49:51PM +0200, Louis Rilling wrote: > On Wed, Sep 03, 2008 at 02:57:47PM +0400, Andrey Mirkin wrote: > > This patchset introduces kernel based checkpointing/restart as it is > > implemented in OpenVZ project. This patchset has limited functionality and > > are able to che

[Devel] Re: [PATCH 3/9] Introduce context structure needed during checkpointing/restart

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 16:29 Matthieu Fertré wrote: > Andrey Mirkin a écrit : > > Add functions for context allocation/destroy. > > Introduce functions to read/write image. > > Introduce image header and object header. > > > > Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> > > --- > > cp

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Serge E. Hallyn
Quoting Cedric Le Goater ([EMAIL PROTECTED]): > Andrey Mirkin wrote: > > This patchset introduces kernel based checkpointing/restart as it is > > implemented in OpenVZ project. This patchset has limited functionality and > > are able to checkpoint/restart only single process. Recently Oren Laaden >

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 18:06 Louis Rilling wrote: > On Wed, Sep 03, 2008 at 03:49:51PM +0200, Louis Rilling wrote: > > On Wed, Sep 03, 2008 at 02:57:47PM +0400, Andrey Mirkin wrote: > > > This patchset introduces kernel based checkpointing/restart as it is > > > implemented in OpenVZ projec

[Devel] Re: [PATCH 4/9] Introduce container dump function

2008-09-03 Thread Serge E. Hallyn
Quoting Andrey Mirkin ([EMAIL PROTECTED]): > Actually right now we are going to dump only one process. > Function for dumping head of image file are added. > > Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> > --- > cpt/Makefile |2 +- > cpt/checkpoint.c | 74 > +++

[Devel] Re: [PATCH 3/9] Introduce context structure needed during checkpointing/restart

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 18:13 Cedric Le Goater wrote: > > +void context_release(struct cpt_context *ctx) > > +{ > > + ctx->ctx_state = CPT_CTX_ERROR; > > + > > + if (ctx->file) > > + fput(ctx->file); > > + kfree(ctx); > > +} > > + > > +static void context_put(struct cpt_conte

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Cedric Le Goater
> Forgot a global comment: you will probably get the same (rather pointless for > a > proof of concept, IMHO) requests as Oren got, to > 1) improve coding style: > a) especially avoid error handling like: > err = foo(); > if (!err) > err = bar(); > if (!err) >

[Devel] Re: [PATCH 2/9] Make checkpoint/restart functionality modular

2008-09-03 Thread Serge E. Hallyn
Quoting Andrey Mirkin ([EMAIL PROTECTED]): > A config option CONFIG_CHECKPOINT is introduced. > New structure cpt_operations is introduced to store pointers to > checkpoint/restart functions from module. Thanks Andrey. The structure of this patchset is very nice, and I'm finding it very easy to r

[Devel] Re: [PATCH 6/9] Introduce functions to dump mm

2008-09-03 Thread Louis Rilling
On Wed, Sep 03, 2008 at 02:57:53PM +0400, Andrey Mirkin wrote: > Functions to dump mm struct, VMAs and mm context are added. > [...] > diff --git a/cpt/cpt_mm.c b/cpt/cpt_mm.c > new file mode 100644 > index 000..6e025cc > --- /dev/null > +++ b/cpt/cpt_mm.c > @@ -0,0 +1,431 @@ > +/* > + * Co

[Devel] Re: [PATCH 8/9] Introduce functions to restart a process

2008-09-03 Thread Louis Rilling
On Wed, Sep 03, 2008 at 02:57:55PM +0400, Andrey Mirkin wrote: > Functions to restart process, restore its state, fpu and registers are added. > > Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> > --- > arch/x86/kernel/entry_32.S | 21 +++ > arch/x86/kernel/process_32.c |3 + > cpt/Makef

[Devel] Re: [PATCH 4/9] Introduce container dump function

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 18:23 Serge E. Hallyn wrote: > Quoting Andrey Mirkin ([EMAIL PROTECTED]): > > Actually right now we are going to dump only one process. > > Function for dumping head of image file are added. > > > > Signed-off-by: Andrey Mirkin <[EMAIL PROTECTED]> > > --- > > cpt/Mak

[Devel] Re: [PATCH 3/9] Introduce context structure needed during checkpointing/restart

2008-09-03 Thread Cedric Le Goater
> +void context_release(struct cpt_context *ctx) > +{ > + ctx->ctx_state = CPT_CTX_ERROR; > + > + if (ctx->file) > + fput(ctx->file); > + kfree(ctx); > +} > + > +static void context_put(struct cpt_context *ctx) > +{ > + if (!--ctx->refcount) > + context_rele

[Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 18:26 Cedric Le Goater wrote: > > Forgot a global comment: you will probably get the same (rather pointless > > for a proof of concept, IMHO) requests as Oren got, to > > 1) improve coding style: > > a) especially avoid error handling like: > > err = foo(); > >

[Devel] Re: [PATCH 2/9] Make checkpoint/restart functionality modular

2008-09-03 Thread Andrey Mirkin
On Wednesday 03 September 2008 18:27 Serge E. Hallyn wrote: > Quoting Andrey Mirkin ([EMAIL PROTECTED]): > > A config option CONFIG_CHECKPOINT is introduced. > > New structure cpt_operations is introduced to store pointers to > > checkpoint/restart functions from module. > > Thanks Andrey. The str

[Devel] [PATCH 0/11][v3]: Enable multiple mounts of devpts

2008-09-03 Thread sukadev
This patchset includes the patches to cleanup get_node() I had sent earlier, with the Sign-off added. No other changes were made to those patches since I last sent. --- Enable multiple mounts of devpts filesystem so each container can allocate ptys independently. User interface: Since

[Devel] [PATCH 1/11][v3]: Move tty lookup/reopen to tty_open

2008-09-03 Thread sukadev
Subject: [PATCH 1/11]: Move tty lookup/reopen to tty_open From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Move tty_driver_lookup_tty() and tty_reopen() from tty_init_dev() into tty_open() (one of the two callers of tty_init_dev()). These calls are not really required in ptmx_open(), the other cal

[Devel] [PATCH 2/11][v3]: Add an instance parameter devpts interfaces

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 2/11]: Add an instance parameter to devpts interfaces Pass-in 'inode' or 'tty' parameter to devpts interfaces. With multiple devpts instances, these parameters will be used in subsequent patches to identify the instance of devpts moun

[Devel] [PATCH 3/11][v3]: Simplify devpts_get_tty()

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 3/11]: Simplify devpts_get_tty() As pointed out by H. Peter Anvin, since the inode for the pty is known, we don't need to look it up. Signed-off-by: Sukadev Bhattiprolu <[EMAIL PROTECTED]> --- fs/devpts/inode.c | 17 +-

[Devel] [PATCH 6/11][v3]: Remove devpts_root global

2008-09-03 Thread sukadev
Serge, Matt, Pls sign-off if you agree/want to. --- From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 6/11]: Remove devpts_root global Remove the 'devpts_root' global variable and find the root dentry using the super_block. The super-block can be found from the device inode

[Devel] [PATCH 5/11][v3]: Simplify devpts_pty_kill

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 5/11]: Simplify devpts_pty_kill When creating a new pty, save the pty's inode in the tty->driver_data. Use this inode in pty_kill() to identify the devpts instance. Since we now have the inode for the pty, we can skip get_node() lookup

[Devel] [PATCH 4/11][v3]: Simplify devpts_pty_new()

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 4/11]: Simplify devpts_pty_new() devpts_pty_new() is called when setting up a new pty and would not have an existing dentry or inode for the pty. So don't bother looking for an existing dentry - just create a new one. Signed-off-by: S

[Devel] [PATCH 7/11][v3]: Per-mount allocated_ptys

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 7/11]: Per-mount allocated_ptys To enable multiple mounts of devpts, 'allocated_ptys' must be a per-mount variable rather than a global variable. Move 'allocated_ptys' into the super_block's s_fs_info. Changelog[v2]: Define a

[Devel] [PATCH 8/11][v3]: Per-mount 'config' object

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 8/11]: Per-mount 'config' object With support for multiple mounts of devpts, the 'config' structure really represents per-mount options rather than config parameters. Rename 'config' structure to 'pts_mount_opts' and store it in the su

[Devel] [PATCH 9/11][v3]: Extract option parsing to new function

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 9/11]: Extract option parsing to new function Move code to parse mount options into a separate function so it can (later) be shared between mount and remount operations. Signed-off-by: Sukadev Bhattiprolu <[EMAIL PROTECTED]> --- fs/

[Devel] [PATCH 10/11][v3]: Ability to internally create ptmx

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 10/11]: Ability to internally create ptmx /dev/ptmx is closely tied to the devpts filesystem. An open of /dev/ptmx, allocates the next pty index and the associated device shows up in the devpts fs as /dev/pts/n. Wih multiple instancs

[Devel] [PATCH 11/11][v3]: Enable multiple instances of devpts

2008-09-03 Thread sukadev
From: Sukadev Bhattiprolu <[EMAIL PROTECTED]> Subject: [PATCH 11/11]: Enable multiple instances of devpts To support containers, allow multiple instances of devpts filesystem. such that indices of ptys allocated in one instance are independent of ptys allocated in other instances of devpts. But

[Devel] Re: [PATCH 11/11][v3]: Enable multiple instances of devpts

2008-09-03 Thread H. Peter Anvin
[EMAIL PROTECTED] wrote: > > 2. To effectively use the multi-instance mode, applications/libraries > should, open "/dev/pts/ptmx" instead of "/dev/ptmx" but obviously > this would fail in the legacy mode. > NOT SO! /dev/ptmx is required by Unix98 (which is arguab

[Devel] Re: [PATCH 1/8] sysfs: Implement sysfs tagged directory support.

2008-09-03 Thread Benjamin Thery
David Shwatrz wrote: > Hi, >> go into my tree this week, > > I am also interested in this patch; may I ask - what do you mean by > "my tree" ?I am a little newbie in the kernel, as you might understand. > I looked into http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ > for candid