Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Sukadev Bhattiprolu
	<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [C/R] threaded application
Date: Sun, 17 May 2009 14:29:37 -0400	[thread overview]
Message-ID: <4A105791.7040806@cs.columbia.edu> (raw)
In-Reply-To: <20090517023125.GA30716-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Suka,

Thanks for the report.

Sukadev Bhattiprolu wrote:
> Probably premature :-) but tried to C/R a simple threaded application
> (running as container-init).
> 
> First got an -EINVAL due to following check in may_checkpoint_task():
> 
>         /*
>          * FIX: for now, disallow siblings of container init created
>          * via CLONE_PARENT (unclear if they will remain possible)
>          */
>         if (ctx->root_init && t != ctx->root_task &&
>             t->real_parent == ctx->root_task->real_parent)
> 
> Assuming we are unintentionally excluding CLONE_THREAD with the
> above check, I added a check for tgid:
> 
>         if (ctx->root_init && t != ctx->root_task &&
>             t->real_parent == ctx->root_task->real_parent &&
>             t->tgid != ctx->root_task->tgid) {
> 
> This got past the -EINVAL but the test failed the ckpt_obj_contained() check.

Yes, I see no reason to prevent multi-threaded container init.
Will add this to the ckpt-v15-dev git tree.

> 
> 	c/r: FILE users 2 != count 6 objref 9
> 
> The main-thread opened a single file (log file). The other threads don't
> write to it (yet). The count '6' corresponds to the number of threads in
> the application.
> 
> I suspect that C/R code is incrementing obj->users once per thread for
> the log file even though the threads share the file_struct reference.
> (pthread_create() sets CLONE_FILES so the file_struct is shared between
> threads).
> 

Indeed, the current code doesn't yet handle files_struct as a
shared object, so anything with CLONE_FILES isn't done correctly.
That's on the todo-list...

Oren.

> Will post my test programs to Serge's new git-tree next week.
> 
> Sukadev
> 

      parent reply	other threads:[~2009-05-17 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-17  2:31 [C/R] threaded application Sukadev Bhattiprolu
     [not found] ` <20090517023125.GA30716-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-17 18:29   ` Oren Laadan [this message]

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=4A105791.7040806@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@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