From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Nadia.Derbey-6ktuUTfB/bM@public.gmane.org
Subject: Re: [RFC PATCH 0/5] Resend - Use procfs to change a syscall behavior
Date: Tue, 8 Jul 2008 16:50:34 -0500 [thread overview]
Message-ID: <20080708215034.GB2179@us.ibm.com> (raw)
In-Reply-To: <20080708105228.GB15311-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
Quoting Pavel Machek (pavel-+ZI9xUNit7I@public.gmane.org):
> On Mon 2008-07-07 14:01:19, Serge E. Hallyn wrote:
> > Quoting Pavel Machek (pavel-+ZI9xUNit7I@public.gmane.org):
> > > Hi!
> > >
> > > > This patchset is a part of an effort to change some syscalls behavior for
> > > > checkpoint restart.
> > > >
> > > > When restarting an object that has previously been checkpointed, its state
> > > > should be unchanged compared to the checkpointed image.
> > > > For example, a restarted process should have the same upid nr as the one it
> > > > used to have when being checkpointed; an ipc object should have the same id
> > > > as the one it had when the checkpoint occured.
> > > > Also, talking about system V ipcs, they should be restored with the same
> > > > state (e.g. in terms of pid of last operation).
> > > >
> > > > This means that several syscalls should not behave in a default mode when
> > > > they are called during a restart phase.
> > > >
> > > > One solution consists in defining a new syscall for each syscall that is
> > > > called during restart:
> > > > . sys_fork_with_id() would fork a process with a predefined id.
> > > > . sys_msgget_with_id() would create a msg queue with a predefined id
> > > > . sys_semget_with_id() would create a semaphore set with a predefined id
> > > > . etc,
> > > >
> > > > This solution requires defining a new syscall each time we need an existing
> > > > syscall to behave in a non-default way.
> > >
> > > Yes, and I believe that's better than...
> > >
> > > > An alternative to this solution consists in defining a new field in the
> > > > task structure (let's call it next_syscall_data) that, if set, would change
> > > > the behavior of next syscall to be called. The sys_fork_with_id() previously
> > > > cited can be replaced by
> > > > 1) set next_syscall_data to a target upid nr
> > > > 2) call fork().
> > >
> > > ...bloat task struct and
> > >
> > > > A new file is created in procfs: /proc/self/task/<my_tid>/next_syscall_data.
> > > > This makes it possible to avoid races between several threads belonging to
> > > > the same process.
> > >
> > > ...introducing this kind of uglyness.
> > >
> > > Actually, there were proposals for sys_indirect(), which is slightly
> > > less ugly, but IIRC we ended up with adding syscalls, too.
> >
> > Silly question...
> >
> > Oren, would you object to defining sys_fork_with_id(),
> > sys_msgget_with_id(), and sys_semget_with_id()?
> >
> > Eric, Pavel (Emelyanov), Dave, do you have preferences?
> >
> > For the cases Nadia has implemented here I'd be tempted to side with
> > Pavel Machek, but once we get to things like open() and socket(), (a)
> > the # new syscalls starts to jump, and (b) the per-syscall api starts to
> > seem a lot more cumbersome.
>
> You should not need to modify open/socket. You can already select fd
> by creatively using open/dup/close...
That's what we do right now in cryo. And if we end up patching up every
API with separate syscalls, then we wouldn't create open_with_id(). But
so long as the next_id were to exist, exploiting it in open is nigh on
trivial and much nicer.
-serge
next prev parent reply other threads:[~2008-07-08 21:50 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 14:40 [RFC PATCH 0/5] Resend - Use procfs to change a syscall behavior Nadia.Derbey-6ktuUTfB/bM
2008-07-03 14:40 ` [RFC PATCH 1/5] adds the procfs facilities Nadia.Derbey-6ktuUTfB/bM
[not found] ` <20080703144224.723883000-6ktuUTfB/bM@public.gmane.org>
2008-07-07 18:30 ` Serge E. Hallyn
[not found] ` <20080707183030.GA22937-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-08 5:25 ` Nadia Derbey
2008-07-03 14:40 ` [RFC PATCH 2/5] use next syscall data to predefine ipc objects ids Nadia.Derbey-6ktuUTfB/bM
[not found] ` <20080703144224.982195000-6ktuUTfB/bM@public.gmane.org>
2008-07-07 18:35 ` Serge E. Hallyn
[not found] ` <20080707183512.GB22937-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-08 5:30 ` Nadia Derbey
2008-07-03 14:40 ` [RFC PATCH 3/5] use next syscall data to predefine process ids Nadia.Derbey-6ktuUTfB/bM
[not found] ` <20080703144225.489624000-6ktuUTfB/bM@public.gmane.org>
2008-07-07 18:54 ` Serge E. Hallyn
[not found] ` <20080707185424.GA25934-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-08 5:44 ` Nadia Derbey
2008-07-03 14:40 ` [RFC PATCH 4/5] use next syscall data to change the behavior of IPC_SET Nadia.Derbey-6ktuUTfB/bM
2008-07-03 14:40 ` [RFC PATCH 5/5] use next syscall data to predefine the file descriptor value Nadia.Derbey-6ktuUTfB/bM
[not found] ` <20080703144013.737951000-6ktuUTfB/bM@public.gmane.org>
2008-07-04 10:27 ` [RFC PATCH 0/5] Resend - Use procfs to change a syscall behavior Pavel Machek
[not found] ` <20080704102702.GB4531-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-04 12:07 ` Nadia Derbey
[not found] ` <486E1276.2080605-6ktuUTfB/bM@public.gmane.org>
2008-07-08 10:51 ` Pavel Machek
[not found] ` <20080708105143.GA15311-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-08 21:47 ` Serge E. Hallyn
[not found] ` <20080708214721.GA1972-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-08 21:53 ` Pavel Machek
[not found] ` <20080708215315.GD17083-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-10 6:54 ` Nadia Derbey
[not found] ` <4875B212.5030604-6ktuUTfB/bM@public.gmane.org>
2008-07-10 7:01 ` [Devel] " Paul Menage
[not found] ` <6599ad830807100001j3f3a6cf2y7a19dda9382edb2c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-10 9:14 ` Nadia Derbey
[not found] ` <4875D2EA.4010407-6ktuUTfB/bM@public.gmane.org>
2008-07-10 9:30 ` Paul Menage
[not found] ` <6599ad830807100230k2f3f3551sa4b804f4c20b43fe-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-10 10:11 ` Nadia Derbey
2008-07-10 7:42 ` Nadia Derbey
[not found] ` <4875BD4B.2070402-6ktuUTfB/bM@public.gmane.org>
2008-07-10 8:54 ` Pavel Machek
[not found] ` <20080710085406.GA13258-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-10 9:29 ` Nadia Derbey
2008-07-10 17:53 ` Dave Hansen
2008-07-10 18:45 ` Pavel Machek
[not found] ` <20080710184512.GA19428-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-10 19:04 ` Dave Hansen
2008-07-10 19:27 ` Serge E. Hallyn
2008-07-07 19:01 ` Serge E. Hallyn
[not found] ` <20080707190119.GB25934-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-08 10:52 ` Pavel Machek
[not found] ` <20080708105228.GB15311-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-08 21:50 ` Serge E. Hallyn [this message]
[not found] ` <20080708215034.GB2179-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-08 21:58 ` Pavel Machek
[not found] ` <20080708215821.GE17083-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-07-09 2:20 ` Serge E. Hallyn
[not found] ` <20080709022035.GA21249-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-07-10 7:58 ` Nadia Derbey
[not found] ` <4875C138.5060506-6ktuUTfB/bM@public.gmane.org>
2008-07-10 8:34 ` [Devel] " Paul Menage
[not found] ` <6599ad830807100134l362ab98bt868e078eeb17b838-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-10 9:38 ` Nadia Derbey
2008-07-17 22:26 ` 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=20080708215034.GB2179@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=Nadia.Derbey-6ktuUTfB/bM@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@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