Performance Monitoring Delay Timer After Context Swap

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In computer systems, performance monitoring hardware state information is often lost during context swaps, making it difficult to accurately monitor task performance that is resumed after being off-loaded, as the state may reflect execution of the operating system or hypervisor rather than the application.

Innovation Solution

A method where performance monitoring is postponed until a timer elapses after a context swap, ensuring that the monitoring reflects application execution by starting a timer when the application privilege level is entered, and only then analyzing performance data, which prevents invalid data from previous sessions from influencing the results.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If performance monitoring is performed immediately after context swap, then monitoring responsiveness is improved, but measurement precision deteriorates because the state reflects OS/hypervisor execution rather than application execution

Engineering Contradiction:
Improvemonitoring responsivenessVSAvoidperformance measurement accuracy
Core Design Contradiction:
Loss of timeVSMeasurement precision

Solution Approach 1:

The system performs preliminary actions by detecting context swap events and initiating a delay period before enabling performance monitoring. This preliminary delay allows the application to execute for a predetermined number of instructions or time period, ensuring that the performance state reflects actual application execution rather than OS/hypervisor activities. The delay mechanism is set up in advance through configuration registers that specify the required delay parameters.

Inventive Principle:
Principle #10Preliminary action

2Duration of action of stationary object

If performance monitoring state is retained across context swaps, then monitoring continuity is improved, but reliability deteriorates because invalid state information from previous tasks contaminates the monitoring data

Engineering Contradiction:
Improvemonitoring continuityVSAvoidperformance monitoring validity
Core Design Contradiction:
Duration of action of stationary objectVSReliability

Solution Approach 1:

The system extracts and isolates the performance monitoring state information from the general processor state that is saved and restored during context swaps. By separating the performance monitoring state into a distinct entity that can be independently controlled, the system prevents contamination from previous task executions while allowing selective retention or clearing of monitoring data based on the delay mechanism.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system applies preliminary anti-action by detecting context swap events and proactively clearing or invalidating the performance monitoring state before the corrupted data can affect monitoring accuracy. The delay mechanism serves as a preventive measure that blocks invalid state information from being used, ensuring that only clean, application-specific performance data is collected.

Inventive Principle:
Principle #9Preliminary anti-action

3Measurement precision

If a delay mechanism is implemented after context swap, then measurement precision is improved, but productivity deteriorates due to postponed performance analysis

Engineering Contradiction:
Improveperformance measurement accuracyVSAvoidperformance analysis throughput
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The system implements periodic action by using a predetermined delay period or instruction count that repeats consistently after each context swap event. This periodic delay ensures that performance monitoring is synchronized with application execution cycles, collecting data at regular intervals when the application is actually running, thereby maintaining measurement precision without excessive delays.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS9342432B2Hardware performance-monitoring facility usage after context swaps
Publication Date: 2016.05.17 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US9342432B2 patent drawing
  • US9342432B2 patent drawing
  • US9342432B2 patent drawing

AI summary

A performance monitoring technique provides task-switch immune operation without requiring storage and retrieval of the performance monitor state when a task switch occurs and provides accurate performance monitoring information. When a hypervisor signals that a task is being resumed and the application privilege level has been entered, it provides an indication, which starts a delay timer. The delay timer is resettable in case a predetermined time period has not elapsed when the next task switch occurs. After the delay timer expires, analysis of the performance monitor measurements is resumed, which prevents an initial state, a state due to execution of the operating system or hypervisor, or a state remaining from a previous task from corrupting the performance monitoring results. The performance monitor may be or include an execution trace unit that collects branch information in a current program execution trace.