Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_rad_attach(3) [osf1 man page]

pthread_rad_attach(3)					     Library Functions Manual					     pthread_rad_attach(3)

NAME
pthread_rad_attach, pthread_rad_bind - Attaches or binds a thread to a NUMA Resource Affinity Domain (libpthread library) SYNOPSIS
#include <numa.h> int pthread_rad_attach( pthread_t thread, radset_t radset, ulong_t flags ); int pthread_rad_bind( pthread_t thread, radset_t radset, ulong_t flags ); PARAMETERS
Identifies the thread to be attached or bound to the specified set of Resource Affinity Domains (RADs). Identifies the RAD set to which the thread is to be attached or bound. DESCRIPTION
The pthread_rad_attach() function attaches the thread specified by the thread argument to the RAD set specified by the radset argument. The pthread_rad_bind() function binds the specified thread to the specified RAD set. While both functions assign a home RAD for the thread, an attach operation allows remote execution on other RADs while a bind operation restricts execution to the home RAD. In the following paragraphs, the term "assign" is used when the description refers equally to both the attach and the bind operations. The memory allocation policy for the process will be set to MPOL_THREAD. The home RAD for the process will be selected by the system sched- uler from among the RADs included in radset based on current system load balance and the flags argument. The overflow set (mattr_radset) for the process will be set to radset. The following symbolic values are defined for the flags argument: The requested assignments are mandatory. If this option is not set, the system will consider the request to be a "hint" and may take no action for any or all of specified processes. The thread has small memory requirements, so the system should (for the home RAD) favor those RADs with light CPU loads, independent of their available memory. The thread has large memory requirements, so the system should (for the home RAD) favor those RADs with more available memory, independent of their CPU loads. If the caller does not have partition administration privilege and if the radset argument contains RADs that are not in the caller's parti- tion, an error will be returned. NOTES
The value for the radset argument could be obtained from an nloc() call to assign or migrate the process to a RAD close (or closer) to a particular resource. When obtained in this manner, the radset value will identify RADs that were in the caller's partition at the time of the nloc() call. The partition configuration could change between the call to nloc() and a subsequent call to pthread_rad_attach(), result- ing in an error. An application should be prepared to handle this error, even though it should not be a frequent occurrence. RETURN VALUES
Success. Failure. In this case, the integer value indicates the type of error. Possible errors are as follows: The thread is hard attached (RAD_INSIST) to RADs or has memory wired (locked) on its current RAD such that it cannot be migrated to the specified RAD set. One of more of the RADs in the radset argument or options in the flags argument are invalid. RAD_INSIST and RAD_MIGRATE were specified, and the thread cannot be migrated because insufficient memory exists on RADs in the specified RAD set. The caller does not have appropriate privileges to assign processes to RADs in the specified RAD set. The thread specified by thread does not exist. ERRORS
None. SEE ALSO
Functions: nloc(3), pthread_rad_detach(3) pthread_rad_attach(3)

Check Out this Related Man Page

rad_attach_pid(3)					     Library Functions Manual						 rad_attach_pid(3)

NAME
rad_attach_pid, rad_bind_pid - Attaches or binds a process to a Resource Affinity Domain by process ID (libnuma library) SYNOPSIS
#include <numa.h> int rad_attach_pid( pid_t pid, radset_t radset, ulong_t flags ); int rad_bind_pid( pid_t pid, radset_t radset, ulong_t flags ); PARAMETERS
Identifies the process to be attached or bound to the specified set of Resource Affinity Domains (RADs). Specifies the RAD set to which the process will be attached or bound. Specifies options (a bit mask) that affect the attachment or binding operation. See DESCRIPTION for details. DESCRIPTION
The rad_attach_pid() function attaches the process specified by pid to the set of RADs specified by radset. The rad_bind_pid() function binds the process specified by pid to the set of RADs specified by radset. While both functions assign a "home" RAD for the process, an attach operation allows remote execution on other RADs while a bind operation restricts execution to the "home" RAD. For both functions, if the pid argument is NULL, the call is self-directed. That is, the function behaves as if pid identified the calling process. The memory allocation policy for the process will be set to MPOL_THREAD. The home RAD for the process will be selected by the system sched- uler from among the RADs included in radset and will be based on current system load balance and the flags argument. The overflow set (mattr_radset) for the process will be set to radset. If the process has multiple threads, then any of those threads that have inherited the process's default memory allocation policy will be attached or bound by using the same new memory allocation policy as used for the process that contains them. The threads of the specified process will be scheduled on one of the CPUs associated with the selected RAD, except for threads that have been explicitly bound to some other processor. The CPU will be selected by the scheduler from among those CPUs associated with the selected RAD in the process's partition. (This partition might not be the same as the caller's partition if the caller has appropriate privilege.) The selection will be determined by the loading of the CPUs. The following options are defined for the flags argument: Any processes later forked by the specified process will inherit its home RAD assignment; that is, the child processes will be assigned to the same home RAD as their parent process. If the parent process was attached, the child processes will be attached. If the parent process was bound, the child processes will be bound. By default, processes that are later forked by the process specified in a rad_attach_pid() or rad_bind_pid() call inherit the RAD assignment of their parent. The requested attachments or bindings are mandatory. If this option is not set, the system will con- sider the request to be a "hint" and may take no action for the specified process or, if applicable, any child processes that the specified process contains. The process has small memory requirements, so the system should favor (for the home RAD) those RADs with light CPU loads, independent of their available memory. The process has large memory requirements, so the system should favor (for the home RAD) those RADs with more available memory, independent of their CPU loads. Arrange for existing memory of the process to be migrated to the new home RAD. If RAD_MIGRATE 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. Effectively, this specifies "migrate now!". If the caller does not have partition administration privilege and if pid is not in the caller's partition, or if the radset argument con- tains RADs that are not in the caller's partition, an error will be returned. The value for the radset argument could be obtained from a prior call to nloc() that assigned or migrated the process to a RAD close or closer to a particular resource. When obtained this way, radset will contain only the RADs in the caller's partition at the time of the nloc() call. The partition configuration could change between a call to nloc() and a subsequent call to rad_attach_pid() or rad_bind_pid(), resulting in an error. This error is not likely to occur often, but a robust application should handle it. RETURN VALUES
Success. Failure. In this case, the functions set errno to indicate the error. ERRORS
If either of these functions fail, errno is set to one of the following values for the condition specified: RAD_INSIST and RAD_MIGRATE were specified and the specified process cannot be migrated for some reason. For example, memory is wired (locked) on the process's current RAD. The radset argument points to an invalid address. One or more of the RADs in the radset argument or options in the flags argument are invalid. RAD_INSIST and RAD_MIGRATE were specified and the specified process cannot be migrated because insufficient memory exists on the specified RAD set. The real or effective user ID of the caller does not match the real or effective user ID of the specified process, or the caller does not have appropriate privileges to assign processes to RADs. The process specified by pid does not exist. SEE ALSO
Functions: nloc(3), rad_detach_pid(3) rad_attach_pid(3)
Man Page