Cache Priming Program for Multi-Threaded Processor Latency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multi-threaded processors, cache latency issues arise when instructions and resources for newer threads are not loaded into the cache promptly, leading to idle processor resources and increased thread latency due to high-latency instruction fetch operations.

Innovation Solution

Implementing a 'cache priming program' that executes an extra fetch for the first thread to preload necessary resources into the cache, allowing subsequent threads to utilize these resources immediately, thereby reducing cache latency and optimizing processor resource utilization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If instructions for older threads are executed before instructions for newer threads, then instruction latency is reduced, but processor resources go unused when instruction fetch is pending for newer threads

Engineering Contradiction:
Improveinstruction latencyVSAvoidprocessor resource utilization
Core Design Contradiction:
Loss of timeVSProductivity

Solution Approach 1:

The system performs preliminary action by executing a cache priming program that pre-loads instructions and data into the instruction cache and data cache before the newer thread actually needs them. This preliminary loading ensures that when the thread transitions to execute instructions for the newer thread, the resources are already available in cache, eliminating the idle processor resource problem while maintaining low latency.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If pre-fetching instructions or data into cache is performed, then processor resource idle time is reduced, but hardware complexity and chip area increase significantly

Engineering Contradiction:
Improveprocessor resource utilizationVSAvoidhardware complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system implements self-service by having the processor automatically detect cache misses during normal thread execution and dynamically switch to a cache priming program that loads the required instructions and data. This self-service mechanism eliminates the need for complex external pre-fetching hardware, as the processor uses its own computational resources to perform the loading operation when needed, thereby reducing hardware complexity while maintaining high resource utilization.

Inventive Principle:
Principle #25Self-service

3Productivity

If multiple threads are switched during instruction fetch, then processor computational resources are maximized, but thread latency increases due to frequent context switching

Engineering Contradiction:
Improvecomputational resource usageVSAvoidthread latency
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system ensures continuity of useful action by maintaining thread state information in registers and allowing rapid resumption of thread execution after cache priming. The multi-threaded processor continues to execute other threads during the cache loading phase, and when the primed thread is resumed, it can continue execution without significant context switching overhead, thus maintaining both high computational resource usage and low thread latency.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS9015720B2Efficient state transition among multiple programs on multi-threaded processors by executing cache priming program
Publication Date: 2015.04.21 ADVANCED MICRO DEVICES INC
  • US9015720B2 patent drawing
  • US9015720B2 patent drawing
  • US9015720B2 patent drawing

AI summary

A system and method to optimize processor performance and minimizing average thread latency by selectively loading a cache when a program state, resources required for execution of a program or the program itself change, is described. An embodiment of the invention supports a “cache priming program” that is selectively executed for a first thread/program/sub-routine of each process. Such a program is optimized for situations when instructions and other program data are not yet resident in cache(s), and/or whenever resources required for program execution or the program itself changes. By pre-loading the cache with two resources required for two instructions for only a first thread, average thread latency is reduced because the resources are already present in the cache. Since, such a mechanism is carried out only for one thread in a program cycle, pitfalls of a conventional general pre-fetch scheme that involves parsing of the program in advance to determine which resources and instructions will be needed at a later time, are avoided.