Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Dave Hansen
	<dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Subject: Re: [RFC v14-rc3][PATCH 33/36] Support for share memory address	spaces
Date: Thu, 09 Apr 2009 18:13:11 -0400	[thread overview]
Message-ID: <49DE72F7.9040001@cs.columbia.edu> (raw)
In-Reply-To: <20090409210302.GA5115-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



Serge E. Hallyn wrote:
> Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
>> The task address space (task->mm) may be shared between processes if
>> CLONE_VM is used, and particularly among threads. Accordingly, treat
>> 'task->mm' as a shared object: during checkpoint check against the
>> objhash and only dump the contents if seen for the first time. During
>> restart, likewise, only restore if it's a new instance, otherwise use
>> the one already registered in the objhash.
>>
>> Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
> 
> Cool.
> 
> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> 
> Although:
> 
>> +	/* if the mm's objref is in the objhash, use that instance */
>> +	mm = cr_obj_get_by_ref(ctx, hh->objref, CR_OBJ_MM);
>> +	if (IS_ERR(mm)) {
>> +		ret = PTR_ERR(mm);
>> +		goto out;
>> +	}
>>
>> +	if (mm) {
>> +		if (mm != current->mm) {
> 
> In what twisted world could mm == current->mm at restart?

Tasks are re-created in user space, and so are threads. So threads will
already have their 'mm' set correctly.

Oren.

> 
>> +			ret = exec_mmap(mm);
>> +			if (ret < 0)
>> +				goto out;
>> +			atomic_inc(&mm->mm_users);
>> +		}
>> +		ret = 0;
>> +		goto out;
>> +	}
>> +
>> +	/* otherwise, add our mm to the objhash for future generations */
>>  	mm = current->mm;
>> +	ret = cr_obj_add_ref(ctx, mm, hh->objref, CR_OBJ_MM, 0);
>> +	if (ret < 0)
>> +		goto out;
>>
>>  	/* point of no return -- destruct current mm */
>>  	down_write(&mm->mmap_sem);
>> diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h
>> index 043535c..1bfe284 100644
>> --- a/include/linux/checkpoint.h
>> +++ b/include/linux/checkpoint.h
>> @@ -77,6 +77,7 @@ extern void cr_ctx_put(struct cr_ctx *ctx);
>>  enum {
>>  	CR_OBJ_FILE = 1,
>>  	CR_OBJ_INODE,
>> +	CR_OBJ_MM,
>>  	CR_OBJ_MAX
>>  };
>>
>> -- 
>> 1.5.4.3
> 

  parent reply	other threads:[~2009-04-09 22:13 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 12:27 [RFC v14-rc3][PATCH 00/36] Kernel based checkpoint/restart Oren Laadan
     [not found] ` <1239107264-21775-1-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 01/36] Create syscalls: sys_checkpoint, sys_restart Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 02/36] Checkpoint/restart: initial documentation Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 03/36] Make file_pos_read/write() public Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 04/36] General infrastructure for checkpoint restart Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 05/36] x86 support for checkpoint/restart Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 06/36] Dump memory address space Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 07/36] Restore " Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 08/36] Infrastructure for shared objects Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 09/36] Dump open file descriptors Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 10/36] actually use f_op in checkpoint code Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 11/36] add generic checkpoint f_op to ext fses Oren Laadan
     [not found]     ` <1239107264-21775-12-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09  1:59       ` Serge E. Hallyn
     [not found]         ` <20090409015926.GA20112-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-09  2:29           ` Serge E. Hallyn
     [not found]             ` <20090409022940.GA22284-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-12  3:42               ` Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 12/36] Restore open file descriptors Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 13/36] External checkpoint of a task other than ourself Oren Laadan
     [not found]     ` <1239107264-21775-14-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-16  4:45       ` Sukadev Bhattiprolu
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 14/36] c/r of restart-blocks: export functionality used in next patch Oren Laadan
     [not found]     ` <1239107264-21775-15-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09 21:07       ` Serge E. Hallyn
2009-04-16  5:00       ` Sukadev Bhattiprolu
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 15/36] c/r of restart-blocks Oren Laadan
     [not found]     ` <1239107264-21775-16-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-07 18:14       ` Dan Smith
     [not found]         ` <87r6042uwm.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-04-07 18:44           ` Oren Laadan
     [not found]             ` <49DB9F01.4050605-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-07 19:05               ` Dan Smith
     [not found]                 ` <87myas2sjr.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-04-08  2:24                   ` Oren Laadan
2009-04-16  6:02       ` Sukadev Bhattiprolu
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 16/36] Checkpoint multiple processes Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 17/36] Restart " Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 18/36] A new file type (CR_FD_OBJREF) for a file descriptor already setup Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 19/36] Checkpoint open pipes Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 20/36] Restore " Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 21/36] Record 'struct file' object instead of the file name for VMAs Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 22/36] Prepare to support shared memory Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 23/36] Dump anonymous- and file-mapped- " Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 24/36] Restore " Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 25/36] s390: Expose a constant for the number of words representing the CRs Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 26/36] c/r: Add CR_COPY() macro (v4) Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 27/36] s390: define s390-specific checkpoint-restart code (v7) Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 28/36] powerpc: provide APIs for validating and updating DABR Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 29/36] powerpc: checkpoint/restart implementation Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 30/36] powerpc: wire up checkpoint and restart syscalls Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 31/36] powerpc: enable checkpoint support in Kconfig Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 32/36] Export fs/exec.c:exec_mmap() Oren Laadan
     [not found]     ` <1239107264-21775-33-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09 21:06       ` Serge E. Hallyn
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 33/36] Support for share memory address spaces Oren Laadan
     [not found]     ` <1239107264-21775-34-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09 21:03       ` Serge E. Hallyn
     [not found]         ` <20090409210302.GA5115-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-09 22:13           ` Oren Laadan [this message]
     [not found]             ` <49DE72F7.9040001-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09 22:52               ` Serge E. Hallyn
     [not found]                 ` <20090409225212.GA8386-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-09 23:17                   ` Oren Laadan
     [not found]                     ` <Pine.LNX.4.64.0904091912440.12600-CXF6herHY6ykSYb+qCZC/1i27PF6R63G9nwVQlTi/Pw@public.gmane.org>
2009-04-10  0:09                       ` Serge E. Hallyn
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 34/36] Make cr_may_checkpoint_task() check each namespace individually Oren Laadan
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 35/36] c/r: Add UTS support (v6) Oren Laadan
     [not found]     ` <1239107264-21775-36-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09 21:17       ` Serge E. Hallyn
2009-04-07 12:27   ` [RFC v14-rc3][PATCH 36/36] Stub implementation of IPC namespace c/r Oren Laadan
     [not found]     ` <1239107264-21775-37-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-09 21:29       ` Serge E. Hallyn
     [not found]         ` <20090409212939.GD5115-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-12  3:46           ` Oren Laadan
     [not found]             ` <49E163FC.4080306-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-04-13 14:10               ` Serge E. Hallyn
     [not found]                 ` <20090413141022.GA13007-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-04-13 14:23                   ` Dan Smith

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=49DE72F7.9040001@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@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