Activating and deactivating tasks comprises the following specific functions:
Activation
Allocation of the authorization to use main memory to an executable (inactive, ready) task.Deactivation
Withdrawal of the right to use main memory when expecting long wait periods or after providing certain system services.Forced deactivation
Automatic deactivation of a task due to a resource overload.Preemption
Activation of one task at the cost of deactivating another task.Control functions within the framework of main memory management
Activation Control Function (ACF)
Preemption Control Function (PCF)
Paging Load Control Function (PLC)
System Service Slice Runout Control
Waiting Time Runout Control
All the functions mentioned above are only of significance in the rare case of a main memory bottleneck.
Activation
Activation is possible only when permitted by the Activation Control Function (ACF) on the basis of the CPU and main memory workload measurement and the paging activity (see "Control functions within the framework of main memory management").
The primary goal is to attain the MIN MPL value (MINIMUM-ACTIVE-TASKS) specified by the user in each category.
The task to be activated is defined by this process:
- Filtering out all task categories in which no tasks are ready for processing
- Assigning priorities to the remaining categories:
Priority 1: categories that have not yet reached MIN MPL
Priority 2: categories that have reached or exceeded MIN MPL, but not yet reached MAX MPL
Priority 2: categories that have reached or exceeded MAX MPL
- Only the highest priority categories are considered. That means tasks in categories with priority 2 can only be activated, if no priority 1 categories exist.
- If more than one category is left, the one with the lowest category index (see below) is selected.
- Of this category, the task with the highest activation priority (see below) is selected.
Tasks with system priorities are always activated immediately. Here, too, the ACF control function decides whether this is possible within an activation operation or whether preemption should take place.
Category index
Calculation of the category index:
Index = (NAT + 1 - N) / WEIGHT
where:
NAT = Number Active Tasks
WEIGHT = Parameter WEIGHT-CODE
N = 0, if MPL < MIN MPL
N = MIN MPL, if MIN MPL <= MPL < MAX MPL
N = MAX MPL, if MAX MPL <= MPL
Activation priority
For variable external priorities, activation priority is dependent on:
the variable internal priority
the CPU state (TU or TPR)
the point in time tA when the most recent activation occurred (in each case the difference D is determined) and
a configuration factor C
Variable activation priority = (Variable internal priority + P) * DtA(Elapsed time) / (DtA(CPU time) * C)
Tasks waiting for authorization to use main memory and in CPU state TPR receive a higher activation priority; this is expressed by the constant P.
P = 5 P = 0 | If in TPR If in TU |
The configuration factor C depends on the server type used and it is increased dynamically as the paging rate increases.
Fixed activation priority = Fixed internal priority
Deactivation
Deactivation of active tasks makes main memory available for inactive ready tasks.
Criteria for deactivating active tasks:
further processing is impossible,
e.g. due to wait calls in the program (PASS, VPASS) or waiting for terminal input in interactive mode (WRTRD, RDATA)wait periods were exceeded while waiting for events,
e.g. waiting for terminal input in TP modeDCAM: YRECEIVE
UTM: KDCWAIT
Task communication:
ITC: REVNT
TU eventing: SOLSIG
Forward eventing: RSOFEI
(See “Control functions within the framework of main memory management”: "WaitingTime Runout Control".)
certain system services in the form of CPU time and the number of I/O operations have been rendered (see “Control functions within the framework of main memory management”: "System Service Slice Runout Control").
Deactivation is suppressed when the function “No Deactivation” (TINF macro: DEACT parameter) is switched on.
Exception: the wait call VPASS n always causes deactivation.
Forced deactivation
Forced deactivation of tasks occurs when the Activation Control Function (ACF) detects an excessive workload on the resources CPU and main memory or an excessively high paging rate in relation to the CPU type (matrix decision).
Within an ACF measurement interval, only one task is deactivated at a time.
The following category attributes are used to determine the category from which a task is to be forcibly deactivated:
MIN MPL
MAX MPL
WEIGHT
For the most part, forced deactivation applies to low-priority tasks which are in the process of building up their working set (see below). As a result, non-productive system overhead is kept to a minimum.
Forced deactivation will not occur for:
tasks with a fixed priority
tasks in CPU state TPR
tasks which have switched on the “No deactivation” function.
Preemption
Preemption can take place whenever an activation request exists but the ACF control function forbids further activation in light of the CPU and main memory workload and the size of the paging rate.
Preemptions are set out in the report group PRIOR-ACF of openSM2. They should be avoided at all costs. They may be caused when:
The MIN MPL values are set too high.
There are two many tasks with a fixed priority.
There are two types of preemption:
Active task A is preempted by inactive task B belonging to another category. This occurs when:
for the category with inactive task B has MPL < MIN MPL
at the same time that the category with active task A has MPL >= MIN MPL
Preemption of tasks from different categories:
Activation of a task from a category with MPL < MIN MPL and the lowest category index number. The task with the highest priority from this category will be activated.
Forced deactivation of a task from a category with MPL >= MIN MPL
(see "Forced deactivation")
Active task A and inactive task B belong to the same category. This is only possible when:
inactive task B has a fixed priority
active task A has a variable priority.
Preemption of tasks within the same category:
Forced deactivation of a variable-priority task from this category
(see "Forced deactivation")Activation of a fixed-priority task.
Control functions within the framework of main memory management
Activation Control Function (ACF)
ACF measures the CPU and main memory workloads and the paging activity at periodic intervals (--> INVOCATION LONG = INVOCL, see report group PRIOR-ACF of openSM2).
The polling interval lies between 0.25 and 2 seconds, depending on the CPU workload.CPU-UTILIZATION
Value calculated on the basis of the CPU workload measured during the interval and the time spent waiting for CPU allocation.
MEMORY-UTILIZATION
Ratio of working set requirement estimated by the system for all active tasks (sum of PPC values) to the number of pages available for paging (NPP = Number of Pageable Pages).
Calculation of the PPC value (planned page count) is therefore approximate: the UPG value (used pages) is compared with an assumed mean working set value, dependent on the category type.
Since as many pages as possible are kept active, the total UPG value is practically always in the magnitude of the available paging main memory and has only limited relevance. The working set requirements are expressed exclusively by the PPC value. This value represents only a rough estimate. With todays large memory configurations advantages result from the fact that no outlay is necessary for estimating exact memory requirements, as they are superfluous.
PAGING-UTILIZATION
Paging rate.
The measured values are divided into the following classes:
H (High)
M (Medium)
L (Low)
The reference values for utilization are given in the report group PRIOR-ACF of openSM2. The limit values for these classes are defined at system startup on the basis of the server used (CPU speed, main memory configuration).
Depending on the resource workload and the specified category attributes or task priorities, the system decides on the basis of a matrix whether further activation is permitted or whether forced deactivation, preemption, or even no action at all should take place.
Before a task is actually activated, ACF makes an additional measurement regarding solely the main memory workload in order to ensure that the workload on main memory will permit further activation (INVOCATION SHORT = INVOCS, see report group PRIOR-ACF of openSM2).
Preemption Control Function (PCF)
Task preemption at the activation level is time-consuming since the working set of the preempted task must be reconstructed during reactivation. In order to keep the resultant overhead within reasonable limits, the system tries to keep the preemption rate as low as possible.
PCF periodically monitors the flattened preemption rate per interval. Depending on the hardware used, the polling interval lies between 20 and 48 seconds.
If at least one preemption occurs during this interval, the MAX MPL OPTION will be switched on. This means that from this point on the MAX MPL value must be regarded as an inviolable boundary beyond which activation will not take place. (The MAX MPL OPTION is switched off when no preemption occurs over several intervals).PCF takes countermeasures to keep the preemption rate low. The strategy behind these measures is to carry out preemption requests, wherever possible, as additional activations rather than as preemptions. To do this, PCF reserves main memory areas for preemption requests whenever a certain preemption rate per interval (preemption limit) is exceeded.
The memory area reserved for preemption requests is enlarged step by step as the preemption rate increases (5% to 15% of the real main memory configuration depending on the size of main memory). This simulates a heavier main memory workload, with the result that tasks with no preemption request will not be activated, leaving sufficient main memory to activate tasks with a preemption request.
The system distinguishes between 4 different levels (preemption levels 0 to 3), which are displayed with the message EXC0455 TASK PREEMPTION LEVEL=(&00):
Level 0
Normal state (preemption rate < preemption limit)
Level 1, 2
Short-term overloads
The preemption level continues to climb ifpreemption rate > preemption limit
preemption rate in interval n + 1 > preemption rate in interval n.
Level 3
Long-term overload. (This can arise when the MIN MPL parameters are set too high: tasks from categories which have not yet reached MIN MPL automatically issue a preemption request.)
The operator is told that preemption level 3 has been reached and as of this point receives notification of every change made to the preemption level. If the system discovers by means of a lowered degree of multiprogramming that the MIN MPL parameter setting is too high, the operator will be asked to check this setting and to lower the MIN MPL value of suitable categories.As the preemption rate decreases, reserved main memory will be released step by step. Once the normal state has been reached, the operator receives the message:
EXC0456 PREEMPTION CONTROL FUNCTION TERMINATED
If preemption messages are output, steps should be taken to remedy the situation (see "Preemption").
Paging Load Control Function (PLC)
PLC carries out long-term measurements of paging activities (polling interval 20 to 48 seconds, depending on the speed of the CPU).It can be seen as a supplement to ACF. While ACF measures the current paging rate and compares it to the predefined limit values in order to make short-term decisions, PLC affects the limit values defined at system startup, depending on the workload combination.
If the workload is dialog-oriented, higher paging activities are allowed as compared to workloads oriented towards TP or TP/batch tasks. This minimizes the negative effect of paging activities on TP-oriented workloads and optimizes throughput in the case of batch-oriented workloads.
PLC keeps statistics regarding the frequency with which the states
underload
medium load
overload
occur per polling interval with respect to paging activities. If the “overload” state occurs once per polling interval, the MAX MPL OPTION will be switched on. The MAX MPL OPTION will be switched off if the “paging overload” state fails to occur in the course of several intervals, the predominant preemption level is 0 and the preemption rate is less than 1.
System Service Slice Runout Control
The “system service slice” is used to add up the system services received by an active task in the form of CPU time (in CPU states TU and TPR) and of I/O operations performed.
System service is calculated using the formula SERVICE = (A * B * C) + D, where:
A: Mean instruction execution time (depending on CPU speed).
B: Mean number of instructions per I/O request.
C: Number of I/O operations since last activation.
D: CPU time since last activation.
The size of the “system service slice” depends on the category and the server.
The polling interval for “system service slice runout control” is 2 seconds.
For purposes of recovery action, a distinction is made between two types of system service slice runout, depending on whether the task is in the TU or TPR CPU state:
system service slice runout – CPU state TU
Deactivation will occur only when an inactive ready task with higher priority is available in the same category.
system service slice runout – CPU state TPR
Deactivation will take place when “system service slice runout” occurs for the 2. time if there is an inactive ready task with a higher priority in the same category. If the task switches to state TU after the first runout, it is immediately handled as a runout in TU.
Waiting Time Runout Control
The “waiting time limit” function is used to monitor tasks which are waiting for an event (bourse or inter-task communication events) and thereby occupy main memory.
The “waiting time runout control” function is only called when more than 25% of pageable main memory is occupied by tasks waiting for bourse events (e.g. DCAM: YRECEIVE, UTM: KDCWAIT, TU eventing: SOLSIG, forward eventing: RSOFEI) or ITC events (inter-task communication: REVNT). The polling interval lasts from 1 to 7 seconds, depending on the main memory workload.
If the “waiting time limit” is exceeded for one or more tasks, deactivation will take place in the following manner:
Variable-priority tasks belonging to a category whose MPL value is greater than or equal to MIN MPL are deactivated first (provided deactivation is permitted in connection with “waiting time runout”: DWTR parameter in the TINF macro).
The process is terminated as soon as the amount of pageable main memory bound by the waiting tasks falls beneath the 25% limit.If this action is not sufficient to fall beneath the 25% limit, the deactivation process will be extended to include waiting tasks with fixed priority as well as categories whose MPL value is less than MIN MPL (provided deactivation is allowed). Regardless of the 25% limit, all tasks which satisfy the specified conditions and have been waiting for longer than 30 seconds will be deactivated.