public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: hendriks@lanl.gov
To: Christoph Hellwig <hch@infradead.org>,
	torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: Syscall numbers for BProc
Date: Fri, 4 Apr 2003 13:43:45 -0700	[thread overview]
Message-ID: <20030404204344.GF15620@lanl.gov> (raw)
In-Reply-To: <20030404203531.A29501@infradead.org>

On Fri, Apr 04, 2003 at 08:35:31PM +0100, Christoph Hellwig wrote:
> On Fri, Apr 04, 2003 at 12:32:18PM -0700, Erik Hendriks wrote:
> > Is it possible to get a Linux system call number allocated for BProc?
> > (http://sourceforge.net/projects/bproc) I've been using arbitrary
> > system call numbers for a while but there have been collisions with
> > new kernel features.  I'd like to avoid that in the future.  BProc
> > currently works on 2.4.x kernels on x86, alpha and ppc (32bit).
> 
> Please explain why you need syscalls and the exact APIs.

bproc provides a bunch of transparent remote management for remote
processes in a cluster.  (i.e. 'ps' shows everythign in the cluster,
kills work remotely, etc.)  There are also process migration
mechanisms to place processes on different nodes in the cluster.

The process migration stuff is what I want the system call for.  The
simplest case is the "bproc_move(int x)" call which a process uses to
move itself to another node.  In order to migrate a process to another
node, BProc needs access to ALL the processors's state.  Normally,
this stuff is saved at system call entry and it appears on the stack
for the system call handler.  However, on some architectures
(e.g. alpha) not all the cpu state is saved there.  Some of the
registers (the callee-saved ones - I'm a little fuzzy on terminology
here) are saved elsewhere (to unpredictable locations on the stack)
and I can't get to them anymore if the syscall handler doesn't get
called directly.

As a result, on alpha, I have a special bit of ASM code as the syscall
handler which saves all the registers right away.  This system call
entry is very similar to the special system call entry for fork on
that architecture.

The same problem exists on the receiving end of the process migration
- except in that case the process registers need to be written.

On most architectures you might be able to get away with the
assumption that registers are at offset X from the beginning of the
kernel stack.  I would regard that as pretty ugly though.

- Erik




BProc's process migration and 
The way it's implemented today, the process migration calls depend on
stack build-up at syscall entry.

  Specifically, if bproc is going to
replace the contents of a process it needs to be able to modify all
the registers in the user process.

On some architectures (e.g. alpha) not everything is saved at syscall entry.

- Erik

  reply	other threads:[~2003-04-04 20:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04 19:32 Syscall numbers for BProc Erik Hendriks
2003-04-04 19:35 ` Christoph Hellwig
2003-04-04 20:43   ` hendriks [this message]
2003-04-04 21:54     ` H. Peter Anvin
2003-04-05  0:44   ` hendriks
2003-04-05  5:45     ` Christoph Hellwig
2003-04-05 20:15       ` hendriks
2003-04-08 19:19         ` H. Peter Anvin
2003-04-10  6:29         ` Christoph Hellwig
2003-04-14 17:18           ` hendriks
2003-04-14 17:32             ` Richard B. Johnson

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=20030404204344.GF15620@lanl.gov \
    --to=hendriks@lanl.gov \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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