1. Field of the Invention
The present invention relates generally to resource sets. Still more particularly, the present invention changes the way resource sets are represented.
2. Description of the Related Art
A resource set (RSET) is a structure that identifies physical resources. An RSET parameter issued in resource set application protocol interfaces (APIs) or commands is to either get information from the system regarding resources or to pass information about requested resources to the system. Applications and job schedulers can attach an RSET to a process. Attaching an RSET to a process limits the process to use only the resources contained in the RSET. The central processing unit (CPU) and memory resources in a resource set are represented by bitmaps. The primary use of RSETs is to perform CPU topology and affinity operations. CPUs are identified in RSETs by logical CPU IDs. For example, a partition with two multi-chip modules (MCMs) of eight processors each can have their 16 logical CPU IDs assigned in any order. Using RSET APIs, applications cannot assume that logical CPU IDs 0-7 are in one MCM and IDs 8-15 are contained in the other MCM.
The set of logical CPU IDs available in a system might not be contiguous. There can be gaps in logical CPU ID numbers. This can occur when CPUs are dynamically reconfigured out of a partition. Some systems allocate logical CPU IDs for the online CPUs sequentially at boot time. The main system-defined resource sets are:                System RSET and sys/sys: This resource set contains the available (online) CPU and memory pool resources in the system or partition. On partitionable machines, this RSET contains only the resources that are in the operating system's partition.        Node RSETs, sys/node.mm.nnnnn, or sys/node.nnnnn: These RSETs contain resources that are present at various system detail levels (mm) and indexes (nnnnn) in the system. For example, if system detail level 04 represents the level in the system topology that corresponds to a p690 MCM, RSET sys/node.04.00000 contains the resources in an MCM 0. RSET sys/node.04.00001 contains the resources in another MCM 1, and so on.        Atomic RSETS, sys/cpu.nnnnn, or sys/mem.nnnnn: These RSETs contain a single resource, either a CPU or memory pool. There are atomic resource sets for every available (online) resource contained in the operating system's partition.        
The resource set configuration is displayed with the lsRSET command. There are two types of RSET, the partition RSET and the effective RSET:                The partition RSET can only be attached, modified, or detached by a root user. Some managers attach a partition RSET when a process is classified with a work class that contains an RSET. There is only one partition RSET per process and it is updated by replacement. For example, a process is started with a specific class that attaches a partition RSET that contains CPUs 0-3. Later a root user attaches an RSET that contains CPUs 2-7. The partition RSET attached by manager is replaced by the new RSET. The process now runs on CPUs 2-7.        The effective RSET, generally used by applications, can be attached by root users and non-root users with a CAP_NUMA_ATTACH. Effective RSET limits a process to run only on the resources (CPUs, memory) contained in the RSET. This means that the effective RSET of a process cannot contain more resources than the process' partition RSET. For example, a process may have a partition RSET established by the WLM that limits the process to running only on CPUs 0-3. A user can attach an effective RSET with CPUs 2-3, and the process is limited to running only on CPUs 2-3. An attempt by the user to attach an effective RSET with CPUs 2-7 would be rejected because the user attempted to use resources outside its partition RSET.        
Only recently has the partition RSET been used. In the future, job schedulers may also use partition RSET. The RSET commands provide an easy way for system administrators to use system RSETs. Commands are provided to make, display, and remove RSETs from the system registry. Other commands allow RSETs to be attached to running processes or a command attached to an RSET.
Thus, the concept of an RSET is used to represent a subset of the system's physical resources such as CPUs. Once an RSET is created, it can be associated with logical resources such as a virtual memory object or a process. The operating system than restricts those logical resources to the physical resources contained within the RSET to which they are associated. For example, a process can use an RSET to attach itself to the CPU described in the RSET. Each element in the SRET describes a CPU, and the process attaches to all the elements.
Currently, the set of resources described by the RSET remains unchanged, or static, throughout the life of the RSET. However, in an environment where the system configuration is dynamically changing; processors and memory can be added and removed from the system. An RSET once created does not change to reflect changes in the system configuration. As an example of this problem is where using a RSET, a bind is made between a process and a set of CPUs that have an affinity with one another. A processor re-configuration operation can subsequently add another process that has an affinity to the CPUs in the processes RSET. But the process will remain bound only to those processors that are contained in the RSET and will not be dispatched on the additional processors that were added to the node dynamically. It may have been an administrator's intention to run the process on all CPUs that have the same affinity, but since the view changed, the information was lost to the process.
Thus, it would be advantageous to have an improved method, apparatus, and computer usable code that allows an RSET to be used in a dynamic environment.