All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Pavel Emelyanov <xemul@parallels.com>
Cc: Oleg Nesterov <oleg@redhat.com>, Tejun Heo <tj@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Cyrill Gorcunov <gorcunov@openvz.org>,
	James Bottomley <jbottomley@parallels.com>
Subject: Re: [RFC][PATCH 0/3] fork: Add the ability to create tasks  with	given pids
Date: Fri, 25 Nov 2011 22:36:39 +0000	[thread overview]
Message-ID: <201111252236.40246.pedro@codesourcery.com> (raw)
In-Reply-To: <4ECFCA5E.1020307@parallels.com>

On Friday 25 November 2011 17:03:26, Pavel Emelyanov wrote:
> On 11/25/2011 08:54 PM, Oleg Nesterov wrote:
> > How you can restore the multithread tracee?
> 
> Don't know :) But if this approach sounds promising (I see, that now it's not, but...) I
> can think more on it.
> 
> > You need to unreserve/reserve the previous pid, and we have the same problems again, no?
> 
> With the existing patch - yes, but as I said above - we need to decide which direction to
> go and then I'll think further.

Thanks for thinking about all this.  Being able to reserve pids would be
nice, but I won't pretend to know the kernel's internals enough to be able
to suggest a sane and acceptable way to do it.  We'd have to be able
to restore multi-threaded tracees (which would also mean that there are
pids which leaders and others which are clones), and, we'd have to support
a single-threaded tracer debugging (and spawning) more than one process,
while not all tracees are involved in C/R.  Maybe this (reservation) issue
should be be considered an orthogonal mechanism for now.

> By now your opinion is to better stay where we are ;) but if moving is unavoidable, then
> it's better to take the CLONE_CHILD_USEPIDS route. That's my position as well.

>From the perspective of a client that is
going to use this on a live system, CLONE_CHILD_USEPIDS seems a little better,
in that the pid race is only against another task reusing the same pid,
while with setting last_pid, you have a try/whoops-not-the-pid-I-want/kill/retry/rinse/repeat/
loop racing against all fork/clone's in the system, along with possibly
needing to first to do a kill(PID, 0) to check whether the PID is
available (unless setting last_pid already detects that).

BTW, it's not only GDB that would want this for live systems.
Check out Berkeley Lab's C/R (https://ftg.lbl.gov/projects/CheckpointRestart/),
where these guys use mixed kernel/userspace C/R in clusters for high-end
scientific computing to e.g., migrate tasks between nodes, and pause/resume
parallel MPI jobs (on live systems).  (Apologies if everyone already knows
about this :-) .)

>From what I read from their papers, in their approach, from userspace, they
spawn new children as usual, with whatever pids the kernel wants, and then
afterwards (from userspace, but through a kernel module), magically change
the process and threads's pids to the pids they really want.  They also fixup
the parent pids, and session ids after the fact, along the way.

-- 
Pedro Alves

  reply	other threads:[~2011-11-25 22:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-17 11:41 [RFC][PATCH 0/3] fork: Add the ability to create tasks with given pids Pavel Emelyanov
2011-11-17 11:42 ` [PATCH 1/3] pids: Make alloc_pid return error Pavel Emelyanov
2011-11-17 11:42 ` [PATCH 2/3] pids: Split alloc_pidmap into parts Pavel Emelyanov
2011-11-17 11:43 ` [PATCH 3/3] pids: Make it possible to clone tasks with given pids Pavel Emelyanov
2011-11-17 15:32   ` Oleg Nesterov
2011-11-17 15:49     ` Pavel Emelyanov
2011-11-17 16:00       ` Oleg Nesterov
2011-11-17 17:28   ` Linus Torvalds
2011-11-17 19:04     ` Oleg Nesterov
2011-11-17 18:36   ` Oleg Nesterov
2011-11-18 10:05     ` Pavel Emelyanov
2011-11-17 15:49 ` [RFC][PATCH 0/3] fork: Add the ability to create " Oleg Nesterov
2011-11-17 16:01   ` Pavel Emelyanov
2011-11-17 16:02     ` Oleg Nesterov
2011-11-18 23:30     ` Tejun Heo
2011-11-21  9:15       ` Pavel Emelyanov
2011-11-21 22:50         ` Tejun Heo
2011-11-22 11:11           ` Pavel Emelyanov
2011-11-22 12:04             ` Pedro Alves
2011-11-22 15:33               ` Tejun Heo
2011-11-23 16:20                 ` Pedro Alves
2011-11-23 16:24                   ` Tejun Heo
2011-11-23 17:26                     ` Oleg Nesterov
2011-11-23 17:37                       ` Tejun Heo
2011-11-23 18:19                     ` Pavel Emelyanov
2011-11-23 20:14                       ` Pavel Emelyanov
2011-11-24 17:31                         ` Oleg Nesterov
2011-11-25 10:14                           ` Pavel Emelyanov
2011-11-25 16:22                             ` Oleg Nesterov
2011-11-25 16:44                               ` Pavel Emelyanov
2011-11-25 16:54                                 ` Oleg Nesterov
2011-11-25 17:03                                   ` Pavel Emelyanov
2011-11-25 22:36                                     ` Pedro Alves [this message]
2011-11-27 16:24                                       ` [RFC][PATCH 0/3] fork: Add the ability to create tasks with?given pids Oleg Nesterov
2011-11-27  9:41                             ` [RFC][PATCH 0/3] fork: Add the ability to create tasks with given pids Konstantin Khlebnikov
2011-11-27 17:34                               ` Oleg Nesterov
2011-11-27 18:47                             ` Tejun Heo
2011-11-28 10:38                               ` Pavel Emelyanov
2011-11-28 16:25                                 ` Tejun Heo
2011-11-22 15:23             ` Tejun Heo
2011-11-22 15:29               ` Tejun Heo
2011-11-22 16:30               ` Pavel Emelyanov
2011-11-22 16:44                 ` Linus Torvalds
2011-11-22 19:29                   ` Pavel Emelyanov
2012-01-26 23:28                   ` Kay Sievers
2011-11-22 21:16           ` Oleg Nesterov

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=201111252236.40246.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gorcunov@openvz.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=tj@kernel.org \
    --cc=xemul@parallels.com \
    /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.