pfuLockCPU(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
NAME
pfuFreeAllCPUs, pfuRunProcOn, pfuLockDownProc, pfuLockDownApp,
pfuLockDownCull, pfuLockDownDraw, pfuLockDownLPoint, pfuPrioritizeProcs,
pfuRunDiskProcsOn - Priority, processes and processor assignment
functions.
FUNCTION SPECIFICATION
#include <Performer/pfutil.h>
int pfuFreeAllCPUs(void);
int pfuRunProcOn(int cpu);
int pfuLockDownProc(int cpu);
int pfuLockDownApp(void);
int pfuLockDownCull(pfPipe *);
int pfuLockDownDraw(pfPipe *);
int pfuLockDownLPoint(pfPipe *);
int pfuPrioritizeProcs(int pri);
int pfuRunDiskProcsOn(int cpu);
DESCRIPTION
These routines assign processes to CPUs and implement a policy
specifically designed for locking down the OpenGL Performer application,
cull, and draw processes. The routines implementing these features
utilize the IRIX REACT facilities. Refer to the IRIX REACT technical
report, and the sysmp(2) reference page for detailed information on these
concepts.
pfuFreeAllCPUs frees any CPUs which may have been previously restricted.
The routine pfuRunProcOn can be used to force a process to run on a
specified CPU and does not require super-user permission. This is often
used to force extra processes that can run asynchronously from the draw,
such as those receiving and generating input, onto CPU 0 without
isolating that CPU from standard UNIX scheduling. pfuRunProcOn forces
the calling process to run on the specified CPU and does not require
super-user permission.
All of the pfuLock<*> routines force a process to run on the specified
CPU. They also attempt to isolate the processor to run only those
processes that have specified that they must run on that CPU. Isolating
a CPU also protects it from seeing unnecessary cache and TLB flushes
generated by processes that have not specified that they must run on this
CPU.
Page 1
pfuLockCPU(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
pfuLockDownProc locks the calling process onto CPU cpu. The CPU is
isolated to running only processes that have specified that they must run
on this CPU. This CPU isolation requires super-user permission.
OBSOLETE
The process control functionality below is considered obsolete in
Performer 2.2. It is still provided for compatibility had has been
updated to include new processes and to use the POSIX scheduling if
available on the current system (requires 6.2 + patch1717, patchset 31
and patchset43 or 6.4 or later version of IRIX). However, this
functionality has been obsoleted by the much simpler and more extensible
pfuProcessManager.
The pfuLockDown<App,Cull,Draw> routines implement a policy for selecting
CPUs for different processors given the program and machine
configuration.
The locking and assignment policy implemented by these routines is
implemented in the various stages of an OpenGL Performer application as
follows.
1. CPU 0 is never isolated.
2. In the APPCULLDRAW mode, the processor assignment is handled by the
APP process which takes CPU 1.
3. In the APP_CULLDRAW mode, the processor assignment is handled
separately by the APP and DRAW processes.
4. In the APP_CULL_DRAW mode, each process handles itself.
When there is only one pipe, processors are mapped to processes as
follows. If there are three CPUs, each of APP, CULL and DRAW gets its own
process. If there are only two CPUs, APP is put on CPU 0, which is not
isolated, and DRAW and CULL share CPU 1. The LPOINT process is given its
own CPU if there are enough available CPUs. Otherwise, it will be given
then last CPU.
Multipipe mappings are as follows.
If NumCPUs >= 2 + 2*NumPipes
then each cull and draw process can have its own CPU, with the application
getting CPU 1, and 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
Page 2
pfuLockCPU(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
available CPUs. Otherwise, they are grouped together on a single CPU,
their own if there is on extra, else the last CPU.
If there are fewer CPUs then indicated above, then the application is
assigned to CPU 0 with UNIX, APP and CULL process are paired, and when
only one free CPU remains, all remaining processes are assigned to the
last CPU.
Each of these routines return 1 if successful and 0 if an error is
encountered. pfuLockDownApp locks the APP process to a CPU determined by
the policy above. The CPU is isolated to running only processes that
have specified that they must run on this CPU. This CPU isolation
requires super-user permission.
pfuLockDownCull locks the CULL process of a pfPipe (there is one CULL
process per pfPipe) to a CPU determined by the policy above. T policy
above. This routine should be called from application's pfConfigStage
callback for the PFPROC_CULL stage. The CPU is isolated to running only
processes that have specified that they must run on this CPU. This CPU
isolation requires super-user permission.
pfuLockDownDraw locks the DRAW process of a pfPipe (there is one draw
process per pfPipe) to a CPU determined by the policy above. This
routine should be called from application's pfConfigStage callback for
the PFPROC_DRAW stage. See the pfConfigStage reference page for more
information. The CPU is isolated to running only processes that have
specified that they must run on this CPU. This CPU isolation requires
super-user permission.
pfuLockDownLPoint locks the LPOINT process of a pfPipe (there up to one
optional light point process per pfPipe) to a CPU determined by the
policy above. This routine should be called from application's
pfConfigStage callback for the PFPROC_LPOINT stage. The is isolated to
running only processes that have specified that they must run on this
CPU. This CPU isolation requires super-user permission.
pfuRunDiskProcsOn forces all threads servicing pfQueue's to run on a
certain cpu. See the pfQueue man page for how pfQueue's can be used to
service disk threads. A value of -1 passed as the cpu argument will
cause the routine to choose cpu 2*NumPipes+3 if it exists or cpu 0
otherwise.
pfuPrioritizeProcs should be called after pfConfig and will set or remove
non-degrading priorities from all Performer processes. pri is a boolean:
if TRUE all OpenGL Performer processes will be assigned a non-degrading
priority of NDPHIMAX+2 (see schedctl); if FALSE any non-degrading
priorities will be removed. You must have super-user permission to
enable non-degrading priorities but not to remove them.
If you wish to assign different priorities to different processes, simply
Page 3
pfuLockCPU(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
modify pfuPrioritizeProcs to suit your needs.
NOTES
Processor lock-down functionality is not currently available under Linux.
Isolating a CPU to specific 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.
SEE ALSO
pfuProcessManager, pfConfig, pfConfigStage, sysmp, schedctl,
sched_setscheduler
Page 4