 |
Index for Section 3 |
|
 |
Alphabetical listing for N |
|
 |
Bottom of page |
|
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
nsg Specifies the NUMA Scheduling Group (NSG) to which the listed process
will be attached.
pid Specifies the process ID to attach to (or detach from) the NSG.
flags
Specifies a bit mask of options that affect the attachment. The
following options are defined for the flags argument:
NSG_INSIST
The requested attachment and any implied reassignment is
mandatory, overriding any prior attachment and/or binding of
the specified processes.
NSG_MIGRATE
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.
NSG_NO_INHERIT
A child process will not inherit the NSG of the parent and,
therefore, can be assigned to any eligible RAD on the system.
NSG_WAIT
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
0 Success. In this case, the nsg_attach_pid() function successfully
attached to the NSG specified by nsg.
0 Success. In this case, the nsg_detach_pid() function successfully
detached from its NSG.
-1 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:
[EACCES]
The caller does not have execute permission required to attach
processes to the NSG.
[ESRCH]
The process specified by pid does not exist.
[EINVAL]
The nsg argument does not specify a valid NSG, or one or more options
in the flags argument are invalid.
[EBUSY]
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.
[ENOMEM]
The NSG_INSIST and NSG_MIGRATE options were specified and no RAD can be
found with sufficient memory to accommodate the resulting group.
[EPERM]
The real or effective 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:
[EACCES]
The caller does not have execute permission, which is required to
detach processes from the NSG.
[ESRCH]
The process specified by pid does not exist.
[EINVAL]
The process specified by pid is not a member of an NSG.
[EBUSY]
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.
[EPERM]
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_init(3), numa_intro(3), pthread_nsg_attach(3)
Files: numa_types(4)
 |
Index for Section 3 |
|
 |
Alphabetical listing for N |
|
 |
Top of page |
|