Beginning on r16.2, DCMT DIS SUBTASK can be used to display CPU Efficiency for IDMS subtasks. This document details the way this is calculated, and the reason the value can at times exceed 100%
Release: All supported releases.
Overview
The CPU effectiveness is calculated using the elapsed time and CPU time accumulated for a subtask up until the time the DCMT command is issued. The CPU effectiveness is the ratio between these two measures (the CPU received and the elapsed time required to receive the CPU). This provides a measure of the amount of time that IDMS was forced into an involuntary wait for CPU resources.
The CPU time used and the elapsed time used are displayed for each subtask. The CPU effectiveness percent (displayed in the "% CPU" column) is the CPU time divided by the elapsed time described as a percent. The CPU effectiveness is listed for both TCB mode and SRB mode. SRB mode will only have non-zero values if one or more zIIP processors are being used.
Values used in % CPU calculation
Statistic time values are kept for time spent while a subtask is executing on the standard processor (TCB mode) and time spent executing under control of an enclave service request block (SRB mode). Work operating under the control of an enclave SRB is eligible to be run on a zIIP processor. SRB mode values are only non-zero when one or more zIIP processors are being used. Note: all values are in TOD format.
TCB values
Elapsed time is calculated whenever the subtask is executing on the standard processor (CP). IDMS accumulates the elapsed time intervals by subtracting the STCKE value issued at the start of the executing interval from the STCKE value issued at the end of the executing interval.
CPU time is gotten by issuing the IBM TIMEUSED macro which returns the total CPU time used for the TCB up until the time the macro is issued.
SRB values (if applicable; zIIP only)
Elapsed time is calculated whenever the subtask is executing in SRB mode. IDMS accumulates the elapsed time intervals by subtracting the STCKE value issued at the start of the executing interval from the STCKE value issued at the end of the executing interval.
CPU time is retrieved by issuing the IBM IWMEQTME macro. The CPUTIME parameter is used to retrieve the total CPU time for the enclave associated with the executing subtask. This value is normalized to the CPU speed of the standard processor and therefore can be greater than the elapsed time.
The % CPU calculation
The statistic time values described above are used to calculate the % CPU effectiveness at the time the DCMT command is issued. The % CPU effectiveness is calculated by dividing the CPU time by the elapsed time and representing the result as a percent. The lower order three nibbles of the doublewords containing the CPU and elapsed time in TOD format are shifted out (bit 51 represents a microsecond in TOD format) before the calculation takes place.
Why the % CPU can be greater than 100
For SRB mode, the resulting value of % CPU can be greater than 100 due to the possibility of the CPU time being greater than the elapsed time. Again, the CPU time returned from the IBM query time macro IWMEQTME is returned adjusted by a normalization factor for the processor type, if one exists. (Specialty processors such as zIIP always run at full speed and may be faster than standard processors). The CPU time on the zIIP processor is converted into the equivalent time on the standard processor.
The statistic time values are calculated independently of one another. A small amount of time can elapse during which we are actually consuming resources to set the timers before they begin tracking the time. Therefore, it is possible for the ratio to appear to be over 100%. Typically, this is seen when a subtask has hardly been used or if a report is run very soon after the system has just started up. Since some elapsed time is not included in what is tracked, the result may be a higher number being reported.