Understanding I/O Accounting

The system maintains several records of the I/O time accumulated by a process. More specifically, these are records of the time I/O devices devoted to executing I/Os for the process. This information is maintained in the ACCUMIOTIME task attribute. This information also appears in the Major Type 1, Minor Type 2 (EOJ) and Minor Type 4 (EOT) log entries.

If you are involved in writing billing systems or in evaluating the system workload, then you should be aware that the system logs all I/O time for shared logical files to the process that declared the file. The process that declared the file is not necessarily the process that is actually executing read and write statements that use the file. Consider the following ALGOL example:

BEGIN
FILE DATAFILE(KIND=DISK,NEWFILE=FALSE,DEPENDENTSPECS=TRUE);
TASK T;
PROCEDURE UPDATE;
BEGIN
  ARRAY LINE[0:79];
  WHILE NOT READ(DATAFILE,80,LINE) DO
  BEGIN
    REPLACE LINE BY “NEW DATA”;
    WRITE(DATAFILE,80,LINE);
  END;
END;
CALL UPDATE [T];
END.

In this example, the parent process initiates the procedure UPDATE as a synchronous task. UPDATE then reads each line of the file, modifies the data, and writes it back out to the file. Because the parent process was the declarer of DATAFILE, the ACCUMIOTIME attribute of the parent reflects all the I/O time logged by the UPDATE task.

Note that the system handles I/O accounting in a different manner for direct files. Suppose that one process declares a direct file, and that several other processes read from or write to that file using direct arrays. In this situation, the I/O time for each I/O operation is charged to the process that declares the direct array used for the I/O, rather than to the process that declares the direct file.