Dynamic Register Save Buffer Allocation for Context Saving

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing context saving functions in computer systems face challenges with CPU register management, as fixed-sized memory spaces are inadequate for new CPU registers, leading to performance issues and inefficiencies in storing and restoring process states.

Innovation Solution

A method is introduced where a compiler or application modifies context saving functions to dynamically allocate register save buffers at runtime, using system calls to determine and manage the size of these buffers, ensuring efficient storage and restoration of process states across CPU registers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If fixed-sized memory spaces are used for register save buffers, then the context saving function structure is simple, but the memory space is inadequate for new CPU registers

Engineering Contradiction:
Improvecontext saving function structureVSAvoidmemory space for register save buffers
Core Design Contradiction:
Device complexityVSQuantity of substance

Solution Approach 1:

The patent transforms the static fixed-sized register save buffer into a dynamic structure that can adapt its size at runtime. The system determines the actual number of CPU registers needed and allocates memory accordingly, allowing the buffer size to change based on the specific CPU architecture and requirements rather than being constrained by a predetermined fixed size.

Inventive Principle:
Principle #15Dynamics

2Ease of manufacture

If fixed-sized memory spaces are used for register save buffers, then the implementation is straightforward, but performance deteriorates due to inadequacy for new CPU registers

Engineering Contradiction:
Improveimplementation simplicityVSAvoidcontext saving performance
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The patent changes the key parameter of buffer size from a fixed compile-time constant to a dynamic runtime value. By determining the actual number of registers needed at runtime and allocating memory based on this parameter, the system optimizes performance for different CPU architectures while maintaining implementation feasibility through automated determination methods.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If new CPU registers are added, then the CPU architecture capability is enhanced, but the fixed-sized memory spaces become inadequate

Engineering Contradiction:
ImproveCPU architecture capabilityVSAvoidmemory space for register save buffers
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent creates a universal context saving mechanism that can accommodate different CPU architectures with varying numbers of registers. By determining the actual register count at runtime and allocating memory dynamically, the same implementation can support both traditional and newer CPU architectures with more registers, making the system multi-functional across different hardware platforms.

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

Data Source

PatentUS10496433B2Modification of context saving functions
Publication Date: 2019.12.03 RED HAT INC
  • US10496433B2 patent drawing
  • US10496433B2 patent drawing
  • US10496433B2 patent drawing

AI summary

A method for modifying a context saving function is disclosed. The method identifies a context saving function within a code fragment. The method further modifies the context saving function to determine a size of a register save buffer, allocate the register save buffer using the determined size, and save a register value in the register save buffer.