Context Switching via Scheduler Register Swap

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional context switching techniques in computer architecture incur significant overhead due to memory access cycles and result in increased processor size, manufacturing cost, and power consumption, especially as the number of threads and contexts grow, making them inefficient and costly for scalable systems-on-chip (SoC).

Innovation Solution

A context switching system that includes a processor with a first register set, a data memory, and a scheduler, where the scheduler selects a second thread for execution while the first thread is being executed, and swaps the contexts between the first and second register sets in a single memory access cycle, eliminating the need for a context cache and reducing processor size and power consumption.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If a context cache is utilized in the processor for storing contexts, then context switching overhead is reduced, but processor size, manufacturing cost, and power consumption increase significantly

Engineering Contradiction:
Improvecontext switching overheadVSAvoidprocessor size
Core Design Contradiction:
Loss of timeVSVolume of stationary object

Solution Approach 1:

The patent extracts the context storage function from the processor core by utilizing external memory resources. The context information is stored in memory locations associated with the data memory rather than in a dedicated context cache within the processor, thereby reducing processor size while maintaining context switching capability.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent makes the data memory serve multiple functions: it stores both data operands for thread execution and context information for thread management. This eliminates the need for a separate context cache structure, reducing processor complexity and power consumption while enabling context switching.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Loss of time

If a context cache is utilized in the processor for storing contexts, then context switching overhead is reduced, but power consumption increases significantly

Engineering Contradiction:
Improvecontext switching overheadVSAvoidprocessor power consumption
Core Design Contradiction:
Loss of timeVSUse of energy by stationary object

Solution Approach 1:

The context storage function is extracted from the processor core and relocated to external memory resources. By storing context information in data memory rather than in a processor-internal context cache, the patent reduces the active transistor count and dynamic power consumption within the processor while maintaining context switching functionality.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The data memory is designed to serve dual purposes: storing data operands for thread execution and storing context information for thread management. This multi-functional approach eliminates the need for a separate context cache, thereby reducing power consumption without sacrificing context switching performance.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Adaptability or versatility

If the number of threads and contexts is increased for system scalability, then system capability improves, but processor size and manufacturing cost increase

Engineering Contradiction:
Improvesystem scalabilityVSAvoidprocessor size
Core Design Contradiction:
Adaptability or versatilityVSVolume of stationary object

Solution Approach 1:

The patent moves context storage from the spatial dimension (processor-internal cache) to the temporal dimension (external memory access). By utilizing memory resources that exist outside the processor core, the system can support an increasing number of threads and contexts without proportionally increasing processor size, as memory capacity can be scaled independently.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Solution Approach 2:

The data memory structure is designed to accommodate both data and context information dynamically. As the number of threads increases, the same memory resource can be allocated to store additional context information without requiring additional processor-internal cache structures, thereby enabling scalable multi-threading without proportional increases in processor size.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS12073221B2Context switching method and system for swapping contexts between register sets based on thread halt
Publication Date: 2024.08.27 NXP USA INC
  • US12073221B2 patent drawing
  • US12073221B2 patent drawing
  • US12073221B2 patent drawing

AI summary

A context switching system includes a processor and a scheduler. The processor is configured to execute a first thread. A first context associated with the first thread is stored in a register set of the processor. While the first thread is being executed, the scheduler is configured to select a second thread from a set of threads, and receive and store a second context associated with the second thread in a register set of the scheduler. The second thread is to be scheduled for execution after the first thread. The scheduler is further configured to swap the first and second contexts when the execution of the first thread is halted, thereby executing the context switching. Further, the processor is configured to execute the second thread based on the second context. While the second thread is being executed, the first context is stored in the data memory.