From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH] c/r: Add UTS support (v4)
Date: Fri, 20 Mar 2009 15:42:51 -0500 [thread overview]
Message-ID: <20090320204251.GC14879@us.ibm.com> (raw)
In-Reply-To: <49C3F0A9.9080703-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
>
>
> Serge E. Hallyn wrote:
> > Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
> >>
> >> Dan Smith wrote:
> >>> OL> So what happens in the following scenario:
> >>>
> >>> OL> * task A is the container init(1)
> >>> OL> * A calls fork() to create task B
> >>> OL> * B calls unshare(CLONE_NEWUTS)
> >>> OL> * B calls clone(CLONE_PARENT) to create task C
> >>>
> >>> In the previous version of the patch, I failed the checkpoint if this
> >>> was the case by making sure that all tasks in the set had the same
> >>> nsproxy. You said in IRC that this was already done elsewhere in the
> >>> infrastructure, but now that I look I don't see that anywhere.
> >>>
> >> in cr_may_checkpoint_task():
> >>
> >> 285 /* FIXME: change this for nested containers */
> >> 286 if (task_nsproxy(t) != ctx->root_nsproxy)
> >> 287 return -EPERM;
> >>
> >>> The check I had was in response to Daniel's comments about avoiding
> >>> the situation for the time being by making sure that all the tasks had
> >>> the same set of namespaces (i.e. the same nsproxy at the time of
> >>> checkpoint).
> >>>
> >>> OL> Two approaches to solve this are:
> >>>
> >>> OL> a) Identify, in mktree, that this was the case, and impose an
> >>> OL> order on the forks/clones to recreate the same dependency (an
> >>> OL> algorithm for this is described in [1])
> >>>
> >>> OL> b) Do it in the kernel: for each nsproxy (identified by an objref)
> >>> OL> the first task that has it will create it during restart, in or
> >>> OL> out of the kernel, and the next task will simply attach to the
> >>> OL> existing one that will be deposited in the objhash.
> >>>
> >>> I think that prior discussion led to the conclusion that simplicity
> >>> wins for the moment, but if you want to solve it now I can cook up
> >>> some changes.
> >>>
> >> If we keep the assumption, for simplicity, that all tasks share the
> >> same namespace, then the checkpoint code should check, once, how that
> >> nsproxy differs from the container's parent (except for the obvious
> >> pidns).
> >
> > I disagree. Whether the container had its own utsns doesn't
> > affect whether it should have a private utsns on restart.
>
> Right, I missed that...
>
> >> If it does differ, e.g. in uts, then the checkpoint should save the
> >> uts state _once_ - as in global data. Restart will restore the state
> >> also _once_, for the init of the container (the first task restored),
> >> _before_ it forks the rest of the tree.
> >>
> >> Otherwise, we don't get the same outcome.
> >
> > Again I disagree. If we were planning on never supporting nested
> > uts namespaces it woudl be fine, but what you are talking about
> > is making sure we have to break the checkpoint format later to support
> > nested namespaces.
>
> We don't know how we are to support nested namespaces. So either we solve
> it now, or we do something that is bound to break later. The image format
> is going to change anyways as we move along.
>
> >
> > Rather, we should do:
> >
> > 1. record the hostname for the container in global data.
> > 2. The restart program can decide whether to honor the global
> > checkpoint image hostname or not. It can either use a
> > command line option, or check whether the recorded hostname
> > is different from the restart host. I prefer the former.
>
> Sounds good.
>
> > 3. for each task, leave an optional spot for hostname. If
> > there is a hostname, then it will unshare(CLONE_NEWUTS)
> > and set its hostname before calling sys_restart() or
> > cloning any child tasks.
>
> Doesn't this imply a a specific format that is bound to break later ?
Not if we don't specify a format for the optional record now.
We do of course need to pick a spot for it now, and as Dan
noticed, that should be above the actual task layout so that
the info can be easily accessed by mktree.c before calling
sys_restart()...
But what the heck, like you're saying let's leave step 3 for later :)
thanks,
-serge
next prev parent reply other threads:[~2009-03-20 20:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 18:51 [PATCH] c/r: Add UTS support (v4) Dan Smith
[not found] ` <1237402291-28812-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-03-19 22:26 ` Oren Laadan
[not found] ` <49C2C686.2060806-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-19 22:39 ` Dan Smith
[not found] ` <871vstdtn1.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-03-19 22:58 ` Oren Laadan
[not found] ` <49C2CDFA.4010907-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-19 23:13 ` Oren Laadan
2009-03-20 13:56 ` Dan Smith
[not found] ` <49C2D183.8040905-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-20 18:10 ` Serge E. Hallyn
[not found] ` <20090320181043.GB8380-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-03-20 19:34 ` Oren Laadan
[not found] ` <49C3EFAF.9030706-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-20 19:59 ` Dave Hansen
2009-03-20 20:48 ` Oren Laadan
[not found] ` <49C4011C.1050707-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-20 21:00 ` Dave Hansen
2009-03-20 21:26 ` Oren Laadan
[not found] ` <49C40A23.6080708-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-20 21:39 ` Dave Hansen
2009-03-20 21:58 ` Oren Laadan
2009-03-23 14:52 ` Dan Smith
[not found] ` <87eiwoi956.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-03-23 15:08 ` Serge E. Hallyn
2009-03-20 18:05 ` Serge E. Hallyn
[not found] ` <20090320180506.GA8380-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-03-20 19:38 ` Oren Laadan
[not found] ` <49C3F0A9.9080703-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-03-20 20:42 ` Serge E. Hallyn [this message]
2009-03-19 22:28 ` Oren Laadan
2009-03-24 15:07 ` Oren Laadan
2009-03-24 15:21 ` Dan Smith
[not found] ` <87d4c7gd54.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-03-24 15:34 ` Oren Laadan
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=20090320204251.GC14879@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=orenl-eQaUEPhvms7ENvBUuze7eA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.