Revision history   OpenPOWER Library

 7.1. Time-Sliced Context Management Procedure

The basic procedure performed by the PSL and AFU for processing the scheduled processes is as follows:

  1.  The PSL reads the next process element from the scheduled processes area. (See Section 4.4.2, “PSL Queue Processing (Starting and Resuming Process Elements)”)

  2.  The PSL updates the associated privileged 1 and privileged 2 registers.

  3. The PSL requests that the AFU restore its state if required.

  4. The AFU restores the state if required.

  5. The PSL starts the AFU to perform the requested task.

  6. If the AFU task completes or the AFU yields the rest of the context time, continue with step 8.

  7.  After a configurable time (PSL_CtxTime_An[Context_Time]), the PSL preempts the AFU.

  8.  When at the precise state, the AFU saves the state if required.

  9.  The PSL updates the utilization records (HAUR and AUR).

  10.   If the AFU's task is not complete, the PSL writes a link to the process element and the status to the PSL queue of processes waiting to be restarted.

  11.   The PSL resets the AFU and continues with step 1.

 In step 7, the PSL sends a preemption request to the AFU. In response, the AFU attempts to reach a precise state where the job can be restarted. If needed, the AFU can request that the state be saved to system memory (step 8). After the AFU has reached the precise state and saved the context (if required), the AFU must indicate to the PSL that the AFU is idle and a new context can now be started (AFU_Idle).

 After sending the preemption request in step 8, the PSL waits a predetermined time period (PSL_CtxTime[Warn_OS]) for the AFU_idle indication. If the AFU_idle indication is not received during this time period, an interrupt is sent to the operating system. The action taken by the operating system is operating-system implementation specific.

 After the PSL_CtxTime[Warn_OS] time period expires, the PSL waits another predetermined time period (PSL_CtxTime[Warn_Hypervisor]) for the AFU_idle indication. If the AFU_idle indication is not received during this second time period, an interrupt is sent to the hypervisor. The action taken by the hypervisor is implementation specific but must include purging the current active job.

 The AFU is given a predetermined amount of time (PSL_CtxTime_An[Idle_Time]) from the preemption in step 7 to indicate AFU_idle. After this time period expires, the PSL starts to track the amount of time (in PSL_CtxTime_An[Context_Time] units) until the AFU_idle indication is received. The number of units is saved as part of the status in the PSL queue of processes waiting to be restarted in step 10. This value is then used to skip process elements that exceeded their allocation of the AFU. This is achieved by evaluating the queue entry in step 1. If the number of units in the status field is not zero, the PSL decrements the number of units by 1, and the procedure continues with step 1.

Note: For the PSL to reach step 9, all pending reads and writes of main storage must be complete. The PSL does not start a new process element until all pending reads and writes are complete. This includes any outstanding segment, page faults, or storage exceptions.


loading table of contents...