__pset_rtctl(2) __pset_rtctl(2)
NAME [Toc] [Back]
__pset_rtctl - real-time processor set control
SYNOPSIS [Toc] [Back]
#include <sys/rtpset.h>
int __pset_rtctl(
pset_rt_req_t request,
psetid_t pset,
int arg,
);
DESCRIPTION [Toc] [Back]
HP-UX Processor Sets allow a subset of processors in the system to be
isolated for exclusive use by specified threads and processes. Only
the threads bound to a processor set can execute on processors in that
processor set (see pset_create(2)).
The __pset_rtctl() function extends processor set functionality for
real-time applications to minimize operating system activities in a
processor set. A processor set can be configured as a real-time
processor set (referred to as RTE processor set). An RTE processor set
has the following special features that are not available in standard
processor sets:
No Kernel Daemons [Toc] [Back]
The scheduler does not schedule kernel daemons on processors in
the RTE processor set. Kernel daemons are restricted to
processors in non-RTE processor sets.
No External I/O Interrupts
External I/O interrupts on processors in RTE processor set are
disabled. The system is reconfigured to not deliver any external
I/O interrupts to processors in the RTE processor set. (The clock
interrupt still continues to come on each processor though).
This feature may not be supported on all platforms (see
intctl(1M) for details).
Callouts Migration [Toc] [Back]
All pending callouts on processors in the RTE processor set are
reassigned to processors in non-RTE processor sets. However, if a
real-time application in an RTE processor set requests a service
which requires callout support in the kernel, such callouts may
execute on RTE processors.
The system always has at least one non-RTE processor set. The system
default processor set (see pset_create(2)) cannot be configured as an
RTE processor set. Since the system default processor set is never
empty, there is always at least one processor in a non-RTE processor
set to execute the kernel daemons, I/O interrupts and callouts for the
system.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
__pset_rtctl(2) __pset_rtctl(2)
The request argument specifies the operation to perform on the
processor set pset for real time extension. The following values are
supported:
RTE_PSET_CONFIG Configure the specified processor set, pset, as
an RTE processor set. The processor set may or
may not have processors assigned at this point.
If pset has processors assigned to it at time of
this request, these processors are made
unavailable to the kernel daemons. External I/O
interrupts and pending callouts on processors in
pset are reassigned to processors in non-RTE
processor sets in the system. The processor set
attribute values are changed to default values
for an RTE processor set. If pset has any
assigned workload, it continues to execute in
that processor set. The arg argument is ignored.
RTE_PSET_UNCONFIG Unconfigure the specified processor set pset as
an RTE processor set. The processors, if any, in
this processor set are made available to the
kernel daemons. The system may redistribute the
external I/O interrupts with availability of
these processors. Pending callouts in the system
are not redistributed to these processors. The
processor set attribute values are restored to
default values for a non-RTE processor set as
applicable. If pset has any assigned workload,
it continues to execute in that processor set.
The arg argument is ignored.
RTE_PSET_GETFIRSTPSET Return the ID of the first RTE processor set in
the system. The pset and arg arguments are
ignored.
RTE_PSET_GETNEXTPSET Return the ID of the next RTE processor set in
the system after pset. The arg argument is
ignored.
Typically, RTE_PSET_GETFIRSTPSET is called to
determine the first RTE processor set.
RTE_PSET_GETNEXTPSET is then called in a loop
(until the call returns -1) to determine the IDs
of the remaining RTE processor sets in the
system.
See pset_ctl(2) for additional processor set query operations. The
pset_ctl() function allows users query all processor sets in the
system, processors in a specific processor set, processor set given a
processor, etc.
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
__pset_rtctl(2) __pset_rtctl(2)
A processor may be added to an RTE processor set using the
pset_assign() function. In this case, the processor is made
unavailable to the kernel daemons; external I/O interrupts and pending
callouts on this processor are reassigned to processors in non-RTE
processor sets in the system. Conversely, if a processor is removed
from an RTE processor set and added to a non-RTE processor set, it is
made available to the kernel daemons and for external I/O interrupts.
Similarly, if a non-empty RTE processor set is destroyed, its
processors are made available to the kernel daemons and for external
I/O interrupts.
Only a superuser may configure and unconfigure an RTE processor set.
However, any user may query the IDs and configuration of RTE processor
sets. The PRIV_PSET privilege user has no special privileges for RTE
processor sets. Only a superuser may reassign processors into or out
of an RTE processor set, or change attribute values, or destroy an RTE
processor set. Any user with EXEC permissions in an RTE processor set
may run applications in that RTE processor set.
HP-UX processor sets define processor set attributes to provide users
explicit control in managing their processor set configuration and
work load assignment among many users and applications (see
pset_getattr(2) for details). A processor set is assigned default
values for these attributes at creation time. The RTE processor sets
attributes are assigned different default values at time of
configuration. The supported attributes and their default values are:
PSET_ATTR_OWNID UID of the processor set owner. The superuser is
the owner of an RTE processor set. This
attribute cannot be changed for an RTE processor
set.
PSET_ATTR_GRPID GID of processor set's owner group. The
superuser's group-id is assigned by default.
PSET_ATTR_PERM Access permissions for the processor set. For
RTE processor sets, the processor set owner has
all permissions, group has READ and EXEC
permissions, whereas others have only READ
permissions. The group and others cannot be
given WRITE permissions.
PSET_ATTR_EMPTY Indicates the behavior on a request to bind a
process or a thread to a processor set that does
not contain any processors. For RTE processor
sets, such a request will always be rejected.
PSET_ATTR_IOINTR A flag to indicate if processors in the
processor set are configured to receive external
I/O interrupts or not. All processors in an RTE
processor set are disabled to receive
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003
__pset_rtctl(2) __pset_rtctl(2)
interrupts. This attribute cannot be enabled
until the processor set is unconfigured as RTE
processor set.
PSET_ATTR_LASTSPU Indicates the behavior on a request to remove
the last processor from a processor set if there
are active processes and threads bound to the
processor set. For RTE processor sets, such a
request will be rejected by default. However,
the superuser can change the value of this
attribute to allow removal of the last processor
from an RTE processor set even if the processor
set is busy. Refer to pset_setattr() for
supported values.
PSET_ATTR_NONEMPTY Indicates the behavior on a request to destroy a
non-empty processor set. A non-empty processor
set has at least one processor assigned to it.
For RTE processor sets, such a request will be
rejected by default. However, superuser can
change the value of this attribute to allow
deletion of an RTE processor set in use. Refer
to pset_setattr() for supported values.
Processor Set Support [Toc] [Back]
Use sysconf() with _SC_PSET_SUPPORT to see if the processor set
functionality is supported by the underlying HP-UX operating system
version.
Use sysconf() with _SC_PSET_RTE_SUPPORT to see if the RTE processor
set functionality is supported by the underlying HP-UX operating
system version.
EXAMPLES [Toc] [Back]
Create a new processor set, and configure it as RTE processor set:
#include <sys/rtpset.h>
psetid_t new_psetid;
int ret;
if ((ret = pset_create(&new_psetid)) < 0) {
perror("pset_create()");
exit(1);
}
if ((ret = __pset_rtctl(RTE_PSET_CONFIG, new_psetid, 0)) < 0) {
perror("__pset_rtctl()");
exit(2);
}
Hewlett-Packard Company - 4 - HP-UX 11i Version 2: August 2003
__pset_rtctl(2) __pset_rtctl(2)
RETURN VALUE [Toc] [Back]
__pset_rtctl() returns zero on successful completion for
RTE_PSET_CONFIG and RTE_PSET_UNCONFIG requests.
For RTE_PSET_GETFIRSTPSET and RTE_PSET_GETNEXTPSET requests, the ID of
an RTE processor set is returned if one is found.
Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS [Toc] [Back]
__pset_rtctl fails if one or more of the following is true:
[EALREADY] The specified processor set pset is already configured
as RTE processor set, and the RTE_PSET_CONFIG request is
issued.
[EINVAL] The request is invalid.
[EINVAL] The specified processor set pset is invalid.
[EINVAL] The specified processor set pset is not an RTE processor
set, and RTE_PSET_UNCONFIG request is issued.
[EINVAL] The request is RTE_PSET_GETNEXTPSET and there is no
other RTE processor set after pset.
[ENOSYS] The RTE processor set functionality is not supported by
the underlying HP-UX version.
[EPERM] The user does not have necessary permissions to perform
the requested operation.
[EPERM] The specified processor set, pset, is a special,
reserved processor set, and cannot be configured as an
RTE processor set.
SEE ALSO [Toc] [Back]
psrset(1M), pset_assign(2), pset_bind(2), pset_ctl(2),
pset_destroy(2), pset_getattr(2), pset_setattr(2), sysconf(2).
Hewlett-Packard Company - 5 - HP-UX 11i Version 2: August 2003 [ Back ] |