[Devel] [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR

2010-02-24 Thread Sukadev Bhattiprolu
Following two sets of patches is an early attempt to integrate LXC and USER-CR. Overview: Have USER-CR export the core checkpoint and restart functionality into a library (/lib/libcheckpoint.a and usercr.h) and have LXC link with this library. TODO: 1. For now, libcheckpoint.a

[Devel] [PATCH 1/4][user-cr] Move common definitions to restart.h

2010-02-24 Thread Sukadev Bhattiprolu
From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Date: Tue, 23 Feb 2010 15:25:31 -0800 Subject: [PATCH 1/4][user-cr] Move common definitions to restart.h To make restart() a library interface, the main() and related code in restart.c should be moved to a separate file. To prepare for the

[Devel] [PATCH 2/4][user-cr] Rename struct args to struct restart_args

2010-02-24 Thread Sukadev Bhattiprolu
From 8a6fad2170fbbeb7a5e44c32239f9703c0b7d2f9 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Date: Tue, 23 Feb 2010 15:33:04 -0800 Subject: [PATCH 2/4][user-cr] Rename struct args to struct restart_args Rename struct args to struct restart_args and move to a new

[Devel] [PATCH 3/4][user-cr] Move main() in restart.c to restart-main.c

2010-02-24 Thread Sukadev Bhattiprolu
From 6553b7da33f56e9cb6927e7469af22df56b7f55f Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Date: Tue, 23 Feb 2010 15:55:34 -0800 Subject: [PATCH 3/4][user-cr] Move main() in restart.c to restart-main.c This would enable us to put restart.o into a library. TODO:

[Devel] [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a

2010-02-24 Thread Sukadev Bhattiprolu
From c4063a8976fd8eca9b8d62a12b95c3125c8471c7 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Date: Tue, 23 Feb 2010 16:25:36 -0800 Subject: [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a Export app_restart() and usercr.h to user in a new library

[Devel] [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Sukadev Bhattiprolu
From 94fe79c36ac3aed69c8d97f8e4d17c9b02961b97 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Date: Tue, 23 Feb 2010 17:47:51 -0800 Subject: [PATCH 1/2] Rename --directory option to --statefile [See following mail for an intro to this patch set

[Devel] Re: [PATCH v2 -mmotm 2/4] cgroups: remove events before destroying subsystem state objects

2010-02-24 Thread Balbir Singh
* Kirill A. Shutemov kir...@shutemov.name [2010-02-22 17:43:40]: Events should be removed after rmdir of cgroup directory, but before destroying subsystem state objects. Let's take reference to cgroup directory dentry to do that. Signed-off-by: Kirill A. Shutemov kir...@shutemov.name

[Devel] Re: [PATCH 2/2][LXC] Have lxc_restart call app_restart()

2010-02-24 Thread Cedric Le Goater
On 02/24/2010 09:41 AM, Sukadev Bhattiprolu wrote: diff --git a/src/lxc/Makefile2 b/src/lxc/Makefile2 new file mode 100644 index 000..9aba841 --- /dev/null +++ b/src/lxc/Makefile2 @@ -0,0 +1,16 @@ + +CFLAGS = -static -I . -I .. + +LDFLAGS = /lib/libcheckpoint.a -lutil + +LXC_OBJS =

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Cedric Le Goater
On 02/24/2010 09:41 AM, Sukadev Bhattiprolu wrote: [See following mail for an intro to this patch set https://lists.linux-foundation.org/pipermail/containers/2010-February/023048.html] The --directory is misleading since the option seems to expect an checkpoint image file. sigh. This has

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Daniel Lezcano
Cedric Le Goater wrote: On 02/24/2010 09:41 AM, Sukadev Bhattiprolu wrote: [See following mail for an intro to this patch set https://lists.linux-foundation.org/pipermail/containers/2010-February/023048.html] The --directory is misleading since the option seems to expect an checkpoint

[Devel] Re: [PATCH v2 -mmotm 2/4] cgroups: remove events before destroying subsystem state objects

2010-02-24 Thread Balbir Singh
* Kirill A. Shutemov kir...@shutemov.name [2010-02-24 13:42:15]: On Wed, Feb 24, 2010 at 10:40 AM, Balbir Singh bal...@linux.vnet.ibm.com wrote: * Kirill A. Shutemov kir...@shutemov.name [2010-02-22 17:43:40]: Events should be removed after rmdir of cgroup directory, but before

[Devel] Re: [PATCH v2 -mmotm 3/4] cgroups: Add simple listener of cgroup events to documentation

2010-02-24 Thread Kirill A. Shutemov
On Wed, Feb 24, 2010 at 5:30 AM, Li Zefan l...@cn.fujitsu.com wrote: +     ret = dprintf(event_control, %d %d %s, efd, cfd, argv[2]); I found it won't return negative value for invalid input, though errno is set properly. It looks like a glibc bug. I've file bug to glibc bugzilla:

[Devel] Re: [PATCH v2 -mmotm 2/4] cgroups: remove events before destroying subsystem state objects

2010-02-24 Thread Kirill A. Shutemov
On Wed, Feb 24, 2010 at 10:40 AM, Balbir Singh bal...@linux.vnet.ibm.com wrote: * Kirill A. Shutemov kir...@shutemov.name [2010-02-22 17:43:40]: Events should be removed after rmdir of cgroup directory, but before destroying subsystem state objects. Let's take reference to cgroup directory

[Devel] Re: [PATCH -mm] cgroups: fix failure path in cgroup_write_event_control()

2010-02-24 Thread Kirill A. Shutemov
On Wed, Feb 24, 2010 at 5:22 AM, Li Zefan l...@cn.fujitsu.com wrote: How to reproduce:  # mount -t cgroup -o memory xxx /cgroup  # mkdir /cgroup/tmp  # ./cgroup_event_listener /cgroup/tmp/cgroup.event_control abc  ^C  # rmdir /cgroup/tmp  # cat /proc/cgroups | grep memory  memory  2      

[Devel] [PATCH -mmotm] cgroup: fix typo in error handling in cgroup_write_event_control()

2010-02-24 Thread Kirill A. Shutemov
Actually, we want to fput() cfile, if cfile is not NULL. Signed-off-by: Kirill A. Shutemov kir...@shutemov.name --- kernel/cgroup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index d142524..049ce0d 100644 --- a/kernel/cgroup.c +++

[Devel] Re: [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR

2010-02-24 Thread Serge E. Hallyn
Quoting Sukadev Bhattiprolu (suka...@linux.vnet.ibm.com): Following two sets of patches is an early attempt to integrate LXC and USER-CR. Overview: Have USER-CR export the core checkpoint and restart functionality into a library (/lib/libcheckpoint.a and usercr.h) and have LXC link

[Devel] Re: [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a

2010-02-24 Thread Serge E. Hallyn
Quoting Sukadev Bhattiprolu (suka...@linux.vnet.ibm.com): From c4063a8976fd8eca9b8d62a12b95c3125c8471c7 Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com Date: Tue, 23 Feb 2010 16:25:36 -0800 Subject: [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a

[Devel] Scheduling in atomic while restoring shm

2010-02-24 Thread Nikita V. Youshchenko
Hi While playing with checkpoint-restart code, version several-commits-before-0.19, we have faced scheduling in atomic issue. It is still in v0.19, below code is from there. 247 down_write(shm_ids-rw_mutex); 248 249 /* we are the sole owners/users of this ipc_ns, it

[Devel] Re: [PATCH -mmotm] cgroup: fix typo in error handling in cgroup_write_event_control()

2010-02-24 Thread Paul Menage
On Wed, Feb 24, 2010 at 5:31 AM, Kirill A. Shutemov kir...@shutemov.name wrote: Actually, we want to fput() cfile, if cfile is not NULL. Signed-off-by: Kirill A. Shutemov kir...@shutemov.name Thanks. Acked-by: Paul Menage men...@google.com ---  kernel/cgroup.c |    2 +-  1 files changed,

[Devel] Re: [PATCH -mm] cgroups: fix failure path in cgroup_write_event_control()

2010-02-24 Thread Paul Menage
On Wed, Feb 24, 2010 at 5:28 AM, Kirill A. Shutemov kir...@shutemov.name wrote: Using a single goto label to cleanup multi failure paths can get things wrong quite easily, while multi labels makes the code cleaner. I disagree. It's easer to make mistake on changing code with multi failure

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Sukadev Bhattiprolu
Daniel Lezcano [dlezc...@fr.ibm.com] wrote: Cedric Le Goater wrote: On 02/24/2010 09:41 AM, Sukadev Bhattiprolu wrote: [See following mail for an intro to this patch set https://lists.linux-foundation.org/pipermail/containers/2010-February/023048.html] The --directory is misleading

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Cedric Le Goater
This has some major impact on our side as it is a 9 year old API ... We'll look into it to see how painful it is to change. Ah, did not realize it caused that much pain. bah. we should change anyway. We can keep --directory and add --statefile. For --statefile option we can use a switch

[Devel] Re: [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR

2010-02-24 Thread Cedric Le Goater
On 02/24/2010 09:34 AM, Sukadev Bhattiprolu wrote: Following two sets of patches is an early attempt to integrate LXC and USER-CR. Overview: Have USER-CR export the core checkpoint and restart functionality into a library (/lib/libcheckpoint.a andusercr.h) and have LXC link with this

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Serge E. Hallyn
Quoting Cedric Le Goater (c...@fr.ibm.com): This has some major impact on our side as it is a 9 year old API ... We'll look into it to see how painful it is to change. Ah, did not realize it caused that much pain. bah. we should change anyway. We can keep --directory and add

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Cedric Le Goater
On 02/24/2010 07:30 PM, Serge E. Hallyn wrote: Are we sure that we won't find other information which lxc_checkpoint will want to store which sys_checkpoint() ignores? A link to a btrfs snapshot, for instance. after having froze the container and before running the lxc-checkpoint command, one

[Devel] Re: [PATCH 1/2][LXC] Rename --directory option to --statefile

2010-02-24 Thread Serge E. Hallyn
Quoting Cedric Le Goater (c...@fr.ibm.com): On 02/24/2010 07:30 PM, Serge E. Hallyn wrote: Are we sure that we won't find other information which lxc_checkpoint will want to store which sys_checkpoint() ignores? A link to a btrfs snapshot, for instance. after having froze the container and

[Devel] [PATCH linux-cr] send uses_interp=1 to arch_setup_additional_pages

2010-02-24 Thread Serge E. Hallyn
Because the s390 version won't set up vdso if it is 0. It is safe to assume that if we are calling special_mapping_restore() then there is a vdso in the checkpoint image, and if that is the case then the checkpointed program was dynamically linked. Other architectures ignore uses_interp so this

[Devel] Re: [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a

2010-02-24 Thread Sukadev Bhattiprolu
Serge E. Hallyn [se...@us.ibm.com] wrote: | diff --git a/restart.c b/restart.c | index b1518f2..a163862 100644 | --- a/restart.c | +++ b/restart.c | @@ -530,6 +530,12 @@ int app_restart(struct restart_args *args) | ret = ckpt_coordinator(ctx); | } | | + /* | +*

[Devel] [PATCH] c/r: fix scheduling in atomic while restoring ipc shm

2010-02-24 Thread Oren Laadan
While playing with checkpoint-restart code, version several-commits-before-0.19, we have faced scheduling in atomic issue. ... So restore_ipc_shm() calls ipc_lock() and then restore_memory_contents(). Inside ipc_lock(), a spinlock is taken. Inside restore_memory_contents(), checkpoint

[Devel] Re: [PATCH -mm] cgroups: fix failure path in cgroup_write_event_control()

2010-02-24 Thread Li Zefan
Kirill A. Shutemov wrote: On Wed, Feb 24, 2010 at 5:22 AM, Li Zefan l...@cn.fujitsu.com wrote: How to reproduce: # mount -t cgroup -o memory xxx /cgroup # mkdir /cgroup/tmp # ./cgroup_event_listener /cgroup/tmp/cgroup.event_control abc ^C # rmdir /cgroup/tmp # cat /proc/cgroups |

[Devel] Re: [PATCH] c/r: fix scheduling in atomic while restoring ipc shm

2010-02-24 Thread Oren Laadan
Hi Nikita, Thanks for the report and the analysis. It actually helped to pinpoint a couple of other minor issues in the code. This patch should fix all of these. Oren. Oren Laadan wrote: While playing with checkpoint-restart code, version several-commits-before-0.19, we have faced

[Devel] global_send_sigint

2010-02-24 Thread Sukadev Bhattiprolu
global_send_sigint is -1 by default. If it is -1, we either send SIGKILL or SIGINIT depending on whether we started new pidns with init or new pidns without init. If global_send_sigint is explicitly set to 0 by user (--signal is set). no signal is sent. Given that we are making restart()

[Devel] [PATCH linux-cr RFC] change sysctl and default for unprivileged use

2010-02-24 Thread Serge E. Hallyn
ckpt_unpriv_allowed now can be 0 meaning privilege required for both checkpoint and restart, 1 meaning privilege required only for restart, or 2 meaning both can be done unprivileged. Make 1 the default. Signed-off-by: Serge E. Hallyn se...@us.ibm.com --- checkpoint/sys.c | 14 --