[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

System Management Concepts: Operating System and Devices


Process to Class Assignment in WLM

In WLM, processes can be classified in either of two ways:

Automatic Assignment

The automatic assignment of processes to classes uses a set of class-assignment rules specified by a WLM administrator. There are two levels of assignment rules:

The assignment rules at both levels have exactly the same format.

Classification Attributes

The automatic assignment is based on the values of a set of process attributes. These attributes are as follows:

The tag is a process attribute, defined as a character string, that an application can set by program, using the WLM Application Programming Interface (API).

The classification is done by comparing the value of these process attributes at exec time against lists of possible values given in the class assignment rules file (called rules), to determine which rule is a match for the current value of the process attributes.

A class assignment is a text string with different fields separated by one or more blank spaces or tabs. The fields are as follows:

Name Must contain the name of a class which is defined in the class file corresponding to the level of the rules file (superclass or subclass). Class names can contain only uppercase and lowercase letters, numbers, and underscores and can be up to 16 characters in length. No assignment rule can be specified for the system defined classes Unclassified, Unmanaged and Shared.
Reserved Reserved for future extension. Its value must be a hyphen (-), and it must be present.
User May contain either a hyphen (-) or a list of valid user names (as defined in the /etc/passwd file). The list is composed of one or more names, separated by a comma (,). An exclamation mark (!) can be used before a name to exclude a given user from the class. Patterns can be specified to match a set of user names, using full Korn shell pattern-matching syntax.
Group May contain either a hyphen (-) or a list of valid group names (as defined in the /etc/group file). The list is composed of one or more names, separated by a comma (,). An exclamation mark (!) can be used before a name to exclude a given group from the class. Patterns can be specified to match a set of user names using full Korn shell pattern matching syntax.
Application May contain either a hyphen (-) or a list of application path names. This is the path name of the applications (programs) executed by processes included in the class. The application names will be either full path names or Korn shell patterns that match path names. The list is composed of one or more path names, separated by a comma (,). An exclamation mark (!) can be used before a name to exclude a given application.
Type May contain either a hyphen (-) or a list of process attributes. The possible values for these attributes are as follows:
  • 32bit: the process is a 32-bit process
  • 64bit: the process is a 64-bit process
  • plock: the process has called the plock subroutine to pin memory
  • fixed: the process is a fixed priority process (SCHED_FIFO or SCHED_RR)
The value of the type field can be a combination of one or more of the above attributes separated by a plus (+). 32bit and 64bit are mutually exclusive.
Tag May contain either a hyphen (-) or a list of application tags. An application tag is a string of up to 30 alphanumeric characters. The list is composed of one or more application tag values separated by commas.

Example of Assignment Rules

The following is an example of a top-level rules file for the configuration Config (/etc/wlm/Config/rules file):

* This file contains the rules used by WLM to
* assign a process to a superclass
*
* class resvd user    group   application     type  tag
db1      -      -       -    /usr/bin/oracle*      _DB1
db2      -      -       -    /usr/bin/oracle*      _DB2
devlt    -      -      dev        -            -    -
VPs      -   bob,ted    -         -            -    -
acctg    -      -     acct*       -            -    -
System   -    root      -         -            -    -
Default  -      -       -         -            -    -

The following is an example of the rules file for the devlt superclass in the /etc/wlm/Config/devlt/rules file:

* This file contains the rules used by WLM to
* assign a process to a subclass of the
* superclass devlt
*
* class  resvd   user    group  application         type       tag
hackers   -    jim,liz     -       -                 -          -
hogs      -       -        -       -             64bit+plock    -
editors   -     !sue       -   /bin/vi,/bin/emacs    -          -
build     -       -        -   /bin/make,/bin/cc     -          -
Default   -       -        -       -                 -          -

Note: The asterisk (*) is the comment character used in the rules file.

Automatic Classification

When a process is created (fork), it remains in the same class as its parent. Reclassification happens when the new process issues a system call which can modify one of the attributes of the process used for classification; for example, exec, setuid (and related calls), setgid (and related calls), setpri and plock.

Note: Special cases in which reclassification does not occur are cited when applicable.

To classify the process, WLM examines the top-level rules file for the active configuration to determine which superclass the process belongs. For each rule in the file, WLM checks the current values for the process attributes against the values and lists of values specified in the rule. Rules are checked in the order that they appear in the file. When a match is found, the process is assigned to the superclass named in the first field of the rule. Then the rules file for the superclass is examined in the same way to determine to which subclass the process should be assigned.

For a process to match one of the rules, each of its attributes must match the corresponding field in the rule. The following is a list of the criteria used to determine whether the value of an attribute matches the values in the field of the rules file:

At both superclass and subclass levels, WLM goes through the rules in the order in which they appear in the rules file, and classifies the process in the class corresponding to the first rule for which the process is a match. The order of the rules in the rules file is therefore extremely important. Use caution when you create or modify the rules file.

The following are examples using the rules files:

All of the preceding examples assume that the superclasses and subclasses described do not have the inheritance attribute set to yes. Otherwise, the new processes would simply inherit the superclass or subclass from their father.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]