Skip to contentSkip to conversation

Multiprocessor Control Interfaces

RFC Jason Baietto 4 participants 5 messages Dec 11, 2001 – Dec 12, 2001

lore
Share & tools
lore
#0 lore raw

Some people have asked me for more information before they'll attempt to download and play with this stuff, so here's the --help output from the latest version of the run(1) command:

Usage: run [OPTIONS] { COMMAND [ARGS] | PROCESS_SPECIFIER } Set scheduling parameters and CPU bias for a new process or a list of existing processes.

OPTIONS can be one or more of the following options:

-b, --bias=LIST Set the CPU bias to the LIST of CPUs;
CPUs are numbered starting from 0

   -s, --policy=POLICY    Set the scheduling policy to POLICY
   -P, --priority=LEVEL   Set the scheduling priority to LEVEL
   -q, --quantum=QUANTUM  Set the SCHED_RR quantum to QUANTUM
   -v, --version          Output version information and exit
   -h, --help             Display this help and exit

PROCESS_SPECIFIER is exactly one of the following options:

-p, --pid=LIST Specify LIST of existing PIDs to modify
-g, --group=LIST Specify LIST of process groups to modify; all
existing processes in the groups will be modified
-u, --user=LIST Specify LIST of users to modify; all existing
processes owned by the users will be modified
-n, --name=LIST Specify LIST of existing process names to modify

Multiple comma separated values can be specified for all LISTs and ranges are allowed where appropriate (e.g. "run -b 0,1-3 autopilot").

See the run(1) man page for more information.

Take care,
Jason

Quoted 56 lines

Hello All,

I'm currently working on adding multiprocessor control interfaces to Linux. My current efforts can be found here:

http://www.ccur.com/realtime/oss

These are clean-room implementations of similar tools that have been available in our proprietary *nix for quite some time, and so the interfaces have a fair amount of mileage under their belts. Note that the scope is somewhat wider than just MP.

There has been some discussion of "chaff" and other interfaces recently on this list, so in an effort to hopefully move towards a standard more quickly I've gotten permission from my employer to GPL the code I've written. I'm very interested in comments and feedback on any or all of this work.

Here's the README file from the package:

This package contains:

run(1)
A multiprocessor control command line tool.

mpadvise(3)
A multiprocessor control library interface.

These services rely upon Robert Love's CPU Affinity patch (version 2.4.16-1 was used for testing) which is available here:

http://www.kernel.org/pub/linux/kernel/people/rml/cpu-affinity/v2.4/

To build the code, simply unpack it and type "make". The code has been tested on Red Hat 7.1 and 7.2 systems, though it is still fairly new and almost certainly contains bugs.

An attempt was made to abstract the "cpuset" representation of the current system in order to have binaries that in theory could work on systems with more than 32 cpus. For this to work, the run(1) command would need to be linked against a shared mpadvise(3) library (currently only a static library is made).

This code is being released in the hopes that it will become the basis for the Linux multiprocessor control standard interfaces. I am very interested in getting feedback on this package, so please contact me via email or LKML if you have any.

This source code is licensed under the GNU GPL Version 2. Copyright (C) 2001 Concurrent Computer Corporation

--
Jason Baietto
[email protected]
http://www.ccur.com/realtime/oss

#1 lore raw

Please check, also:

http://www.hockin.org/~thockin/pset. Not finished, but could be.

Quoted 103 lines

Some people have asked me for more information before they'll attempt to download and play with this stuff, so here's the --help output from the latest version of the run(1) command:

Usage: run [OPTIONS] { COMMAND [ARGS] | PROCESS_SPECIFIER } Set scheduling parameters and CPU bias for a new process or a list of existing processes.

OPTIONS can be one or more of the following options:

-b, --bias=LIST Set the CPU bias to the LIST of CPUs;
CPUs are numbered starting from 0

   -s, --policy=POLICY    Set the scheduling policy to POLICY
   -P, --priority=LEVEL   Set the scheduling priority to LEVEL
   -q, --quantum=QUANTUM  Set the SCHED_RR quantum to QUANTUM
   -v, --version          Output version information and exit
   -h, --help             Display this help and exit

PROCESS_SPECIFIER is exactly one of the following options:

-p, --pid=LIST Specify LIST of existing PIDs to modify
-g, --group=LIST Specify LIST of process groups to modify; all
existing processes in the groups will be modified
-u, --user=LIST Specify LIST of users to modify; all existing
processes owned by the users will be modified
-n, --name=LIST Specify LIST of existing process names to modify

Multiple comma separated values can be specified for all LISTs and ranges are allowed where appropriate (e.g. "run -b 0,1-3 autopilot").

See the run(1) man page for more information.

Take care,
Jason

Quoted 49 lines

Hello All,

I'm currently working on adding multiprocessor control interfaces to Linux. My current efforts can be found here:

http://www.ccur.com/realtime/oss

These are clean-room implementations of similar tools that have been available in our proprietary *nix for quite some time, and so the interfaces have a fair amount of mileage under their belts. Note that the scope is somewhat wider than just MP.

There has been some discussion of "chaff" and other interfaces recently on this list, so in an effort to hopefully move towards a standard more quickly I've gotten permission from my employer to GPL the code I've written. I'm very interested in comments and feedback on any or all of this work.

Here's the README file from the package:

This package contains:

run(1)
A multiprocessor control command line tool.

mpadvise(3)
A multiprocessor control library interface.

These services rely upon Robert Love's CPU Affinity patch (version 2.4.16-1 was used for testing) which is available here:

http://www.kernel.org/pub/linux/kernel/people/rml/cpu-affinity/v2.4/

To build the code, simply unpack it and type "make". The code has been tested on Red Hat 7.1 and 7.2 systems, though it is still fairly new and almost certainly contains bugs.

An attempt was made to abstract the "cpuset" representation of the current system in order to have binaries that in theory could work on systems with more than 32 cpus. For this to work, the run(1) command would need to be linked against a shared mpadvise(3) library (currently only a static library is made).

This code is being released in the hopes that it will become the basis for the Linux multiprocessor control standard interfaces. I am very interested in getting feedback on this package, so please contact me via email or LKML if you have any.

Quoted 7 lines

This source code is licensed under the GNU GPL Version 2. Copyright (C) 2001 Concurrent Computer Corporation

--
Jason Baietto
[email protected]
http://www.ccur.com/realtime/oss

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 2 lines · Tim Hockin

http://www.hockin.org/~thockin/pset. Not finished, but could be.

Yes, many similarities. I like the idea of having a single system call that provides so much multiprocessor control and information. If such a system call was ever standardized upon, I would gladly support it in my "run" tool, though I fear that it would always be functionally limited without /proc present.

#3 lore raw
In reply to Tim Hockin
Quoted 10 lines · Jason Baietto
Quoted 2 lines · Tim Hockin

http://www.hockin.org/~thockin/pset. Not finished, but could be.

Yes, many similarities. I like the idea of having a single system call that provides so much multiprocessor control and information. If such a system call was ever standardized upon, I would gladly support it in my "run" tool, though I fear that it would always be functionally limited without /proc present.

Adding /proc/ interfaces like cpus_allowed or similar is just gravy on top of pset, which I think is a good interface.

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
[email protected]
#4 lore raw
Quoted 7 lines · Tim Hockin
Quoted 2 lines · Jason Baietto

support it in my "run" tool, though I fear that it would always be functionally limited without /proc present.

Adding /proc/ interfaces like cpus_allowed or similar is just gravy on top of pset, which I think is a good interface.

Sorry for the ambiguity. My comment was about the functionality of the "run" tool itself being limited without /proc support.

Although I agree that ultimately "run" is gravy, our customers think it's pretty tasty gravy :-) It's very convenient to write a shell script to start up a complex application without having to reference pids anywhere and without having to modify any of the programs in the application to make them CPU affinity aware. Combined with run's ability to tune scheduling parameters, you have a very simple but powerful way to experiment with and tune application performance.

The run tool also allows you to quickly move processes around by specifying lists of pids, process names, process groups or users, but /proc is needed for anything more interesting than pids.

Take care,
Jason
--
Jason Baietto
[email protected]
http://www.ccur.com/realtime/oss