The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Paul Jackson <pj@sgi.com>
Cc: linux-kernel@vger.kernel.org, frankeh@watson.ibm.com,
	haveblue@us.ibm.com
Subject: Re: [RFC] [PATCH 00/13] Introduce task_pid api
Date: Mon, 14 Nov 2005 19:01:57 -0600	[thread overview]
Message-ID: <20051115010155.GA3792@IBM-BWN8ZTBWAO1> (raw)
In-Reply-To: <20051114153649.75e265e7.pj@sgi.com>

Quoting Paul Jackson (pj@sgi.com):
> How about adding the accessor routines in the first patch (still
> referencing task->pid), then doing all the changes as you did, then
> renaming task->pid to task->__pid and updating the accessor to that
> change, in the last patch?  Then it would build all the way through.

Ok, thanks - will send out a new patchset to do this.

> 
> Serge wrote:
> > The resulting object code seems to be identical in most cases, and is
> > actually shorter in cases where current->pid is used twice in a row,
> > as it does not dereference task-> twice.
> 
> You lost me here.  Why does using these accessor routines avoid the
> second reference?

Why, I don't know :)  I just looked at the resulting object code, and
the static inline causes task->pid to be dereferenced once and pushed
twice, whereas using task->pid causes it to be dereferenced twice.

> Have you crosstool'd built this for most arch's?  I could imagine

No - I've never used crosstool, but will it a shot.

> > Note that this does not change the kernel's
> > internal idea of pids, only what users see.
> 
> How can that be?  Doesn't it run all accesses to the task->pid
> field through the accessor, regardless of whether it's something
> the user will see, or something used within the kernel?

Ok...  our intent is to not change the kernel pid concept  :)  Of
course the accessor functions could be coded so as to change it, but
as far as I know we will not do so.

> How about other fields holding a pid, such as (one I happen to know
> about) kernel/cpuset.c marker_pid?  Grep for "pid_t" in include/linux
> for other such possible fields.  What about other kerel-user interfaces
> that deal with pids such as fcntl, msgctl, sched_setaffinity, semop,
> shmctl, sigaction, ...

Yes, our next patchset will introduce the actual pid to vpid translations
and place those functions in the right place.  What I meant to say was
that the kernel pids will still be pids just as they are now.  The barrier
between virtual pids and pids does not yet exist in this patchset.  This
patchset is to lay the groundwork to make those translations simpler.  We
switch task_pid() to task_vpid() in the right places, and use
task_pid_to_vpid() at the barriers between pids and vpids.

> How do you propose to synchronize incoming pid's with these potentially
> modified displayed pids?  There many invocations of find_task_by_pid()
> in the kernel, typically converting a user provided pid into a task

These are replaced with find_task_by_vpid(), which looks for a the given
vpid in the pid-space of the calling process.

> struct.  If doing "kill(getpid(), 1)" in user code didn't sighup
> myself, that would be uncool.
> 
> How do you intend to use these accessor routines in order to help solve
> the problems with checkpoint/restart?

Let's say we want to start a process group.  Start the first process in
a new pidspace.  (Hubertus or Dave can tell use exactly how this will be
done in the first prototype, but I would expect something like
	echo 5 > /proc/$$/childpidspace
	start_my_program   # This forks, and its children remain in pidspace 5
)
Now the processes in pidspace 5 are checkpointed and killed.  When they
are restarted, they will create a new pidspace for the group again, and
ask for their checkpointed pids within that pidspace.  Their kernelpids
will still be the same pid it would have been.  But when one of the
processes looks for process 10, task_vpid_to_pid(current, 10) will return
the real pid for the vpid 10 in current's pidspace.

thanks,
-serge


  reply	other threads:[~2005-11-15  0:42 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-14 21:23 [RFC] [PATCH 00/13] Introduce task_pid api Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 01/13] Change pid accesses: drivers Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 02/13] Change pid accesses: most archs Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 03/13] Change pid accesses: filesystems Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 04/13] Change pid accesses: include/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 05/13] Change pid accesses: ipc Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 06/13] Change pid accesses: kernel/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 07/13] Change pid accesses: lib/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 08/13] Change pid accesses: mm/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 09/13] Change pid accesses: net/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 10/13] Change pid accesses: security/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 11/13] Change pid accesses: sound/ Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 12/13] Change pid accesses: ia64 and mips Serge E. Hallyn
2005-11-15 23:08   ` Keith Owens
2005-11-16 11:58     ` Serge E. Hallyn
2005-11-16 13:53     ` Serge E. Hallyn
2005-11-14 21:23 ` [RFC] [PATCH 13/13] Define new task_pid api Serge E. Hallyn
2005-11-14 23:36 ` [RFC] [PATCH 00/13] Introduce " Paul Jackson
2005-11-15  1:01   ` Serge E. Hallyn [this message]
2005-11-15  1:35     ` Paul Jackson
2005-11-15  1:51     ` Paul Jackson
2005-11-15  2:29       ` Serge E. Hallyn
2005-11-15  3:37         ` Paul Jackson
2005-11-15  5:15           ` Serge E. Hallyn
2005-11-15  6:35             ` Paul Jackson
2005-11-15  8:11               ` Serge E. Hallyn
2005-11-15  9:06                 ` Paul Jackson
2005-11-15 10:07                   ` Dave Hansen
2005-11-15 18:10                     ` Paul Jackson
2005-11-15 11:59                   ` Robin Holt
2005-11-15 13:32                   ` Serge E. Hallyn
2005-11-15 14:37                     ` Hubertus Franke
2005-11-15 18:39                       ` Paul Jackson
2005-11-15 18:54                         ` Hubertus Franke
2005-11-15 19:00                   ` Serge E. Hallyn
2005-11-15 19:17                     ` Hubertus Franke
2005-11-15 22:11                     ` Paul Jackson
2005-11-15 23:15                       ` Cedric Le Goater
2005-11-15 23:28                         ` Paul Jackson
2005-11-15 16:47             ` Greg KH
2005-11-15 17:08               ` Serge E. Hallyn
2005-11-15 17:33               ` Dave Hansen
2005-11-15  5:51   ` Serge E. Hallyn
2005-11-13 15:22     ` Pavel Machek
2005-11-16 19:36       ` Kyle Moffett
2005-11-16 20:36         ` Pavel Machek
2005-11-16 20:48           ` Dave Hansen
2005-11-19 23:30             ` Pavel Machek
2005-11-20 22:38               ` Serge E. Hallyn
2005-12-07 14:53                 ` Eric W. Biederman
2005-11-20 23:29               ` Nix
2005-11-16 21:07           ` Paul Jackson
2005-11-16 20:24       ` Dave Hansen
2005-11-15 13:34   ` Serge E. Hallyn
2005-11-15 11:17 ` Robin Holt
2005-11-15 12:01   ` Dave Hansen
2005-11-15 19:21 ` Ray Bryant
2005-11-15 19:41   ` Serge E. Hallyn
2005-11-15 20:30     ` Ray Bryant
2005-11-15 21:05       ` Serge E. Hallyn
2005-11-15 22:43         ` Paul Jackson
2005-11-15 22:55       ` Cedric Le Goater
2005-11-16  1:12         ` Paul Jackson
2005-12-07 14:46 ` Eric W. Biederman
2005-12-07 17:47   ` Dave Hansen
2005-12-07 17:55     ` Arjan van de Ven
2005-12-07 18:09       ` Dave Hansen
2005-12-07 19:00         ` Arjan van de Ven
2005-12-07 19:42           ` Eric W. Biederman
2005-12-07 22:13           ` Dave Hansen
2005-12-07 22:20             ` Arjan van de Ven
2005-12-12 10:55               ` Dave Airlie
2005-12-19 14:04                 ` Eric W. Biederman
2005-12-07 19:19     ` Eric W. Biederman
2005-12-07 21:40       ` Dave Hansen
2005-12-07 22:17         ` Eric W. Biederman
2004-12-14 15:23           ` Pavel Machek
2005-12-14 13:40             ` Arjan van de Ven
2005-12-14 16:29               ` Serge E. Hallyn
2005-12-07 22:31           ` Dave Hansen
2005-12-07 22:51             ` Eric W. Biederman
2005-12-08  5:42             ` Jeff Dike
2005-12-08 10:09             ` Andi Kleen
2005-12-07 22:17       ` Cedric Le Goater
  -- strict thread matches above, loose matches on Subject: below --
2005-11-16  2:24 Hua Zhong (hzhong)
2005-11-16 17:52 ` Bernard Blackham

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=20051115010155.GA3792@IBM-BWN8ZTBWAO1 \
    --to=serue@us.ibm.com \
    --cc=frankeh@watson.ibm.com \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox