pfuProcessManager(3pf) OpenGL Performer 3.2.2 libpfutil C Reference Pages
NAME
pfuSelectProcessManager, pfuProcessManagerMode, pfuGetProcessManagerMode,
pfuProcessManagerCreateFunc, pfuGetProcessManagerCreateFunc,
pfuProcessManagerPlaceFunc, pfuGetProcessManagerPlaceFunc,
pfuProcessManagerPrioritizeFunc, pfuGetProcessManagerPrioritizeFunc,
pfuReconfigureProcessManager, pfuReleaseProcessManager,
pfuGetCurProcessManager, pfuInitDefaultProcessManager, pfuFreeAllCPUs -
Priority, processes and processor assignment functions
FUNCTION SPECIFICATION
#include <Performer/pfutil.h>
void -
pfuSelectProcessManager(pfuBaseProcessManager *);
void pfuProcessManagerMode(int mode, int val);
int pfuGetProcessManagerMode(int mode);
void -
pfuProcessManagerCreateFunc(pfuProcessHandlerFuncType func,
uint procMask);
void -
pfuGetProcessManagerCreateFunc(pfuProcessHandlerFuncType *func,
uint *procMask);
void -
pfuProcessManagerPlaceFunc(pfuProcessHandlerFuncType func,
uint procMask);
void -
pfuGetProcessManagerPlaceFunc(pfuProcessHandlerFuncType *func,
uint *procMask);
void -
pfuProcessManagerPrioritizeFunc(pfuProcessHandlerFuncType func,
uint procMask);
void -
pfuGetProcessManagerPrioritizeFunc(pfuProcessHandlerFuncType *func,
uint *procMask);
int pfuReconfigureProcessManager();
int pfuReleaseProcessManager();
pfuBaseProcessManager * pfuGetCurProcessManager(void);
void pfuInitDefaultProcessManager(void);
Page 1
pfuProcessManager(3pf) OpenGL Performer 3.2.2 libpfutil C Reference Pages
int pfuFreeAllCPUs(void);
typedef int (*pfuProcessHandlerFuncType)(int _pipe,
uint _stage, pid_t _pid);
DESCRIPTION
The pfuProcessManager class hierarchy implements an extensible process
manager framework bsed on the pfuBaseProcessManager class with a default
process manager class, pfuDefaultProcessManger. The currently active
process manager can be communicated with via the pfuProcessManager global
routines.
pfuSelectProcessManager will select the current process manager.
pfuGetCurProcessManager will return a pointer to the current process
manager.
pfuProcessManagerMode will set the specified mode for the currently
active process manager to the given value, val. The modes and associated
values are to be supported by all process managers are:
PFUPM_CONTINUOUS takes a boolean value to indicate
continuous operation and placement of new
processes, or if explicit calls to
reconfigure the process manager need to be
made to trigger process control.
PFUPM_LOCK_DOWN takes a boolean value to indicate if
locking of processes to processors and
potential isolation of those processors
should occur. The default value is FALSE.
PFUPM_PRIORITIES takes a boolean value to indicate if
processes should be given non-degrading
priorties. The default value is FALSE.
pfuGetProcessManagerMode will return the current value of mode for the
currently active process manager.
pfuReconfigureProcessManager will force the current process manager to do
a replacement of all registered processes according to the current mode
settings.
pfuReleaseProcessManager will force the release of isolated CPUs and
processes registered with the current process manager. Processes will
have non-degrading priorties removed and will be allowed to run on any
CPU.
pfuInitDefaultProcessManager will create and select a process manager
with a default policy. The pfuDefaultProcessManger uses the
pfCreateProcessFunc API to register a callback function with libpf that
will be called upone the creation of any OpenGL Performer process.
pfuGetProcessMiscCPU is used to determine which CPU is to be considered
the non-real-time miscellaneous CPU (typically CPU 0). The
Page 2
pfuProcessManager(3pf) OpenGL Performer 3.2.2 libpfutil C Reference Pages
pfuDefaultProcessManger will place Performer processes onto processors
and set non-degrading priorities on critical processes as described
below. The routines implementing these features utilize the IRIX REACT
facilities. Refer to the IRIX REACT technical report, and the sysmp(2)
and realtime(5) man pages for detailed information on these concepts.
The policy implemented by the pfuDefaultProcessManager is: 1. First, if
there are sufficient CPUs, each of APP, CULL and DRAW gets its own
processor and no critical path processes are placed on the Misc CPU. If
not, the APP is placed on CPU 0 which which will not be isolated. If
there are still not enough processors, cull and draw processes (if
separate) of a given pfPipe are paired to run on the same CPU. If there
are still not sufficient CPUs, extra cull and draw processes will be
placed on the last CPU. 2. Next, the LPOINT process(es) are given their
own CPUs if there are enough available CPUs. Otherwise, they will be
given the last CPU. 3. Next, ISECT and COMPUTE processes are given their
CPUs or paired if there is one additional CPU or else given the MISC CPU.
4. Finally, the DBASE and QUEUE process(es) are given their own CPUs or
paired if there is one additional CPU or else given the MISC CPU.
Multipipe mappings are as follows.
If NumCPUs >= 2 + 2*NumPipes
then each cull and draw process can have its own CPU and are placed together
on a CPU node. The application is placed on CPU 1 with UNIX getting CPU 0.
If NumCPUs == 1 + 2*NumPipes
then the application shares CPU 0 with UNIX.
Otherwise, if NumCPUs >= 2 + NumPipes
then cull and draw processes for each pipe are paired together.
The LPoint processes are also given their own CPUs if there are enough
available CPUs. Otherwise, they are grouped together on a single CPU,
their own if there is on extra, else the last CPU.
The pfuProcessManager provides 2 mechanisms of extensibility: C++
subclassing and C callbacks. The pfuBaseProcessManager and
pfuDefaultProcessManager can both be subclassed and new instances can be
made the current process manager. In addition, custom user callbacks can
be assigned to hand specific types of processes defined by the PFU_PROC_*
mask or unknown processes.
pfuProcessManagerCreateFunc sets a custom user callback for handling the
creation of new processes. The return value should be PFU_CB_CONT if the
user has decided to let the pfuProcessManager handle the function and
PFU_CB_TERM if the user has processed it. The current user function and
associated mask is gotten with pfuGetProcessManagerCreateFunc.
pfuProcessManagerPlaceFunc sets a custom user callback for handling the
Page 3
pfuProcessManager(3pf) OpenGL Performer 3.2.2 libpfutil C Reference Pages
processor placement of new processes. The placement function should
return the chosen CPU number or (-1) if the user has choosen to not
handle the process. The cpu placement will be done upon the explicit or
automatic call by the process manager to place processes.
pfuGetProcessManagerPlaceFunc will return the current user placement
function and process mask.
pfuProcessManagerPrioritizeFunc sets a custom user callback for handling
the processor prioritization of new processes. The function should
return the chosen priority relative to the app process or PFUMP_NOPRI if
the user has choosen to not handle the process. The process priority
will be set upon the explicit or automatic call by the process manager to
place processes. pfuGetProcessManagerPrioritizeFunc will return the
current user prioritization function and process mask.
The following example is taken from the sample application source code
provided in /usr/share/Performer/src/sample/C/common/main.c :
/* Initialization and start of pfuProcess Manager */
pfuInitDefaultProcessManager;
.....
//
// Configure OpenGL Performer and fork extra processes if
// configured for multiprocessing.
//
pfConfig();
// Tell ProcessManager to configure the system
pfuProcessManagerMode(PFUPM_CONTINUOUS, 1);
pfuProcessManagerMode(PFUPM_LOCK_DOWN, 1);
pfuProcessManagerMode(PFUPM_PRIORITIES, 1);
pfuReconfigureProcessManager;
NOTES
CPU isolation or restriction functionality is not currently supported
under Linux.
Isolating a CPU to run specific processes requires super-user permission.
Setting non-degrading priorities on processes requires super-user
permission.
CPU 0 should never be isolated.
A utility shell script is provided in
/usr/share/Performer/src/tools/freeproc that can be run as super-user to
clean up after a program that exits ungracefully.
The libpfutil source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
Page 4
pfuProcessManager(3pf) OpenGL Performer 3.2.2 libpfutil C Reference Pages
SEE ALSO
pfConfig, pfConfigStage, pfCreateProcessFunc, pfuGetProcessMiscCPU,
realtime, sysmp, schedctl, sched_setscheduler
Page 5