Simulating Exclusive Instructions via Compare-and-Swap

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Data processing apparatuses that do not support exclusive instructions face challenges in simulating atomic updates of memory locations, leading to performance issues and overhead costs due to limitations in existing methods such as ensuring single CPU execution, memory protection, and disabling direct memory access.

Innovation Solution

The method involves mapping load-exclusive instructions to load instructions and emulating store-exclusive instructions using atomic compare-and-swap instructions, where the compare value is the value loaded from the memory location, allowing for efficient simulation without relying on other threads' behavior and enabling parallel processing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If existing methods such as ensuring single CPU execution, memory protection, and disabling direct memory access are used to simulate atomic updates, then atomicity is achieved, but performance deteriorates and overhead increases

Engineering Contradiction:
ImproveatomicityVSAvoidperformance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent changes the fundamental approach from using hardware-level restrictions (single CPU execution, memory protection, disabling DMA) to using software-level atomic operations (compare-and-swap instructions). This parameter change allows the system to achieve atomicity through logical operations rather than physical constraints, thereby improving performance while maintaining reliability

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces mechanical/hardware-based mechanisms (CPU execution control, memory protection hardware, DMA disabling) with software-based mechanisms (compare-and-swap instructions, metadata management). This substitution eliminates the performance overhead associated with hardware restrictions while preserving the atomicity guarantee through software-controlled logic

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Reliability

If existing methods are used to simulate exclusive instructions, then atomic updates are achieved, but device complexity increases due to overhead mechanisms

Engineering Contradiction:
ImproveatomicityVSAvoidoverhead
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts the essential function of atomic updates from complex hardware mechanisms and implements it through simple compare-and-swap instructions. By taking out only the necessary logical operation (compare-and-swap) rather than implementing entire hardware control systems, the solution achieves atomicity with minimal overhead and reduced device complexity

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent uses lightweight metadata structures that are created and discarded as needed for each atomic operation. These temporary metadata objects provide the necessary tracking information for atomicity without creating permanent complex data structures, thereby reducing overall device complexity and overhead

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

3Reliability

If existing methods are used to simulate exclusive instructions, then atomicity is ensured, but adaptability decreases due to dependency on other threads' correct behavior

Engineering Contradiction:
ImproveatomicityVSAvoidindependence from thread behavior
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent implements a feedback mechanism through metadata that tracks the state of memory locations and the progress of atomic operations. This feedback allows the system to detect and handle interference from other threads, ensuring atomicity without requiring those threads to behave correctly. The metadata provides real-time information about operation status, enabling adaptive response to various thread behaviors

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent performs preliminary actions by establishing metadata and tracking structures before atomic operations begin. This preliminary setup allows the system to proactively manage and detect interference from other threads, ensuring atomicity is maintained regardless of how other threads behave, thereby increasing adaptability and independence

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10853071B2Simulation of exclusive instructions
Publication Date: 2020.12.01 ARM LTD
  • US10853071B2 patent drawing
  • US10853071B2 patent drawing
  • US10853071B2 patent drawing

AI summary

A method and apparatus for simulating target program code on a host data processing apparatus, the simulation mapping load-exclusive instructions in the target program code to load instructions, and mapping store-exclusive instructions in the target program code to compare-and-swap instructions.