Subject: Linux/SGI and processor sets

From: "Stuart Herbert, GNQS Maintainer" <[email-masked]>
Date: Wed, 17 Jun 1998 20:57:17 +0100

Hi everyone,

I've joined the Linux/SGI mailing list looking for (at first)
information about a specific feature-set ... my apologies if I've come
to the wrong place.

IRIX 5.x, and IRIX 6.0-6.3 provides support for 'processor sets'
through the sysmp(2) system call, and the pset(1) binary.  This
particular feature-set is popular amongst users of Generic NQS, a
batch processing system I maintain.

It's so popular, in fact, that there's been a lot of interest amongst
my users in adding this feature-set to Linux.  It occurred to me that
the Linux/SGI port *might* include adding this support to Linux.

Is sysmp(2) and pset(1) on your TODO list?

If not, then I wrote a (crude - I'm not much of a kernel hacker) patch
which implemented all the pset stuff for sysmp(2), and a basic pset(1)
binary which may be of interest.  The patch is against an old 2.0
kernel, and needs a small fix to actually work (I don't actually have
a SMP box of my own).

Best regards,
Stu
--
Stuart Herbert                               [email-masked]
Generic NQS Maintainer                      http://www.shef.ac.uk/~nqs
--

---

From: [email-masked]
Date: Thu, 18 Jun 1998 03:54:23 +0200

> information about a specific feature-set ... my apologies if I've come

This is definately the right place.

> Is sysmp(2) and pset(1) on your TODO list?

We only support the uninteresting sysmp(2) operations MP_PGSIZE,
MP_NPROCS and MP_NAPROCS as part of the IRIX binary compatibility.

> kernel, and needs a small fix to actually work (I don't actually have

We don't yet support SMP - nobody has so far provided a SMP machine to
me plus the hardware documentation.  However I think you might also
consult about sysmp(2) and pset(1) with the people from
[email-masked], the stuff is definately of interest to the
users of Alpha, i386 and Sparc systems on which SMP is supported.

Linux/MIPS is so far not yet a very widespread OS, but if you nevertheless
wish to port your code to Linux/MIPS, then I as one of the core
developers would like to offer you my support.  I'd also like to point
out that Linux/MIPS as far as technically possible is binary compatible
beyond the machines of just one manufacturer.

  Ralf

---

From: "Stuart Herbert, GNQS Maintainer" <[email-masked]>
Date: Fri, 19 Jun 1998 00:05:37 +0100

Hi Ralf,

> MP_NPROCS and MP_NAPROCS as part of the IRIX binary compatibility.

My patch covers MP_NPROCS, MP_NAPROCS, MP_EMPOWER, MP_RESTRICT,
MP_MUSTRUN, MP_RUNANYWHERE, MP_PSET (with MPPS_CREATE, MPPS_DELETE,
MPPS_ADD, MPPS_REMOVE, and my own extension MPPS_ASSIGN).

I'm sure it isn't binary compatible, but it should be
operation-compatible with sysmp(2) on IRIX, with two exceptions :

  a)  You can remove processors from the 'all' processor set
  b)  I've added MPPS_ASSIGN to the MP_PSET command to provide an API
to
      associate a process with a process ID, because I couldn't find
the
      official SG way to do this with the documentation I had.

As I say, I'm no kernel hacker, so the patch probably has race
conditions or inefficiencies which I've simply never thought of.  My
crude implementation of sysmp(2) is also achieved using a user-space
wrapper.

> users of Alpha, i386 and Sparc systems on which SMP is supported.

Alan's said it can go into 2.3 ... I'm digging around to find out if
anyone more competent at kernel hacking has had a go at this first,
and the Linux/SGI list seemed the most obvious place to start ;-)

> developers would like to offer you my support.  I'd also
> like to point out that Linux/MIPS as far as technically possible is
> binary compatible beyond the machines of just one manufacturer.
>
>   Ralf

Thank you very much.

I guess the thing to do would be if you looked at the (admittedly old)
pset patch I already have:

ftp://ftp.shef.ac.uk/pub/uni/projects/nqs/linux-smp/pset-kit-0.3.tar.g
z

Against an early 2.0 kernel, it works out-of-the-box on a
uni-processor machine if you compile the kernel to be SMP.  On a true
SMP box, it doesn't work because it doesn't use the right CPU array -
I'm told this is a trivial fix.

I don't know what your baseline kernel release is; I'd be happy to put
the time in to produce a patch against your preferred kernel sources
if it would help.

Best regards,
Stu