rad_fork(3) Library Functions Manual rad_fork(3)NAME
rad_fork - Creates a new process on a Resource Affinity Domain (libnuma library)
SYNOPSIS
#include <numa.h>
pid_t rad_fork(
radid_t radid,
ulong_t flags );
PARAMETERS
Identifies a Resource Affinity Domain (RAD) on which to allocate data and schedule threads for a new process. Specifies options (a bit
mask) that affect the attachment or binding operation. See DESCRIPTION for details.
DESCRIPTION
The rad_fork() function behaves the same as nfork() when the latter specifies a resource type of R_RAD and a resource descriptor that
points to a RAD set containing a single RAD identifier. For a description of this behavior, refer to the description of the R_RAD resource
type in nfork(3).
The following option is specified for the flags argument: This option specifies that any processes later forked by the specified process
will not inherit the parent's RAD assignment.
By default, any child processes will be assigned to the same home RAD as their parent process, and will be attached or bound to that
RAD if the parent was attached or bound.
RETURN VALUES
Success (returned to the child process). In this case, the function also returns the process ID of the child process to the parent process.
The child process and all of its data structures are allocated on the RAD specified by the radid argument. In addition, the initial
thread of the child process is sceduled on one of the CPUs in the specified RAD. Failure (returned to the parent process). In this
case, no child process is created and the function sets errno to indicate the error.
ERRORS
The limit on the total number of processes executing for a single user would be exceeded. This limit can be exceeded by a process with
superuser privilege. The radid argument specifies an invalid RAD identifier. There is insufficient memory to create this process.
SEE ALSO
Functions: nfork(3), nloc(3), numa_intro(3), radsetops(3)
Files: numa_types(4)rad_fork(3)
Check Out this Related Man Page
nsg_attach_pid(3) Library Functions Manual nsg_attach_pid(3)NAME
nsg_attach_pid, nsg_detach_pid - Attaches a process to, or detaches a process from a NUMA Scheduling Group (libnuma library)
SYNOPSIS
#include <numa.h>
int nsg_attach_pid(
nsgid_t nsg,
pid_t pid,
ulong_t flags ); int nsg_detach_pid(
pid_t pid );
PARAMETERS
Specifies the NUMA Scheduling Group (NSG) to which the listed process will be attached. Specifies the process ID to attach to (or detach
from) the NSG. Specifies a bit mask of options that affect the attachment. The following options are defined for the flags argument: The
requested attachment and any implied reassignment is mandatory, overriding any prior attachment and/or binding of the specified processes.
Arrange for existing memory of the process that is assigned a new home RAD to be migrated to the new RAD. If this option is omitted, only
newly allocated pages will be allocated on the new home RAD. Existing pages will migrate if or when they experience a high rate of remote
cache misses. Migration will occur only for pages in memory objects that have inherited the process's default memory allocation policy.
Wait for the requested memory migration to be completed, if possible. If insufficient resources exist to satisfy the request, the function
will return without having completed the migration. If NSG_INSIST is also specified, memory not migrated will be paged out.
See DESCRIPTION for more detail about these options.
DESCRIPTION
The nsg_attach_pid() function attaches the process identified by the pid argument to an NSG. An NSG is a set of processes and/or threads
that will be constrained to reside on the same Resource Affinity Domain (RAD). That is, the "home RAD" for all of the processes or threads
in an NSG will be the same, and the entire group will be migrated together, if at all. The process identified by pid will be removed from
any NSG of which it might currently be a member, before adding it to the specified NSG.
If the pid argument is NULL, then the call is self-directed. That is, the function behaves as if the current process ID were specified.
The nsg_detach_pid() will remove pid from its current NSG, if any, and will not add pid to any new NSG. It is equivalent to the
nsg_attach_pid() function with the nsg argument of NSG_NONE.
RESTRICTIONS
The caller must have partition administration privilege and the process identified by pid must be in the caller's partition.
RETURN VALUES
Success. In this case, the nsg_attach_pid() function successfully attached to the NSG specified by nsg. Success. In this case, the
nsg_detach_pid() function successfully detached from its NSG. Failure. In this case, errno is set to indicate the error.
ERRORS
If the nsg_attach_pid() function fails, it sets errno to one of the following values for the condition specified: The caller does not have
execute permission required to attach processes to the NSG. The process specified by pid does not exist. The nsg argument does not spec-
ify a valid NSG, or one or more options in the flags argument are invalid. The specified process is hard attached (RAD_INSIST) to RADs or
has memory wired (locked) on its current RAD such that the process cannot be migrated to the RAD selected for the NSG. The NSG_INSIST and
NSG_MIGRATE options were specified and no RAD can be found with sufficient memory to accommodate the resulting group. The real or effec-
tive user ID of the caller does not match the real or effective user ID of the process specified in pid.
If the nsg_detach_pid() function fails, it sets errno to one of the following values for the condition specified: The caller does not have
execute permission, which is required to detach processes from the NSG. The process specified by pid does not exist. The process speci-
fied by pid is not a member of an NSG. The specified process is hard attached (RAD_INSIST) to RADs or has memory wired (locked) on its
current RAD such that the process cannot be detached. The real or effective user ID of the caller does not match the real or effective
user ID of the process specified in pid.
SEE ALSO
Functions: nsg_attach_thread(3), nsg_init(3), numa_intro(3)
Files: numa_types(4)nsg_attach_pid(3)