Data Race Detection via CPU Register and Cache Metadata

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing data race detection technologies suffer from significant performance overhead and high false positive rates, making them unsuitable for commercialization.

Innovation Solution

A method for detecting data races using a data race detection apparatus that records instruction information in a CPU's destination register, sets access log field information for a cache line, and utilizes this information to detect data races with low overhead.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If existing data race detection technologies (TSAN, Inspector) are used, then data race detection capability is provided, but performance overhead increases significantly (12-200 times degradation)

Engineering Contradiction:
Improvedata race detection capabilityVSAvoidperformance overhead
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent extracts only the essential information needed for data race detection (thread ID, memory address, access type) and stores it compactly in cache line metadata and CPU registers, rather than using comprehensive logging approaches. This selective extraction reduces overhead while maintaining detection capability.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The detection mechanism is segmented into two parts: cache line-level tracking using bitmap fields for fine-grained memory region tracking, and CPU register-level tracking for instruction-level precision. This segmentation allows efficient detection without requiring full system-wide instrumentation.

Inventive Principle:
Principle #1Segmentation

2Reliability

If existing data race detection technologies are used, then data race detection is achieved, but false positive rates increase

Engineering Contradiction:
Improvedata race detection accuracyVSAvoidfalse positive rate
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent performs preliminary actions by pre-initializing cache line metadata with thread ID and access type information before actual memory access occurs. This allows the system to compare incoming access patterns against pre-established baselines, reducing false positives by distinguishing legitimate concurrent accesses from actual data races.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The detection mechanism uses feedback by continuously monitoring memory access patterns and comparing them against recorded information in cache lines and registers. When a potential data race is detected, the system provides feedback through interrupts or exceptions, allowing for verification and reduction of false positives through contextual analysis.

Inventive Principle:
Principle #23Feedback

3Measurement precision

If comprehensive memory access tracking is implemented, then detection accuracy improves, but device complexity increases

Engineering Contradiction:
Improvedetection accuracyVSAvoidsystem complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent makes the cache line structure universal by adding metadata fields (bitmap, thread ID, access type) that serve multiple functions: tracking memory access patterns, identifying owning threads, and detecting conflicts. This multi-functionality reduces the need for separate tracking structures, thereby reducing overall system complexity while maintaining high detection accuracy.

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

Solution Approach 2:

The cache lines and CPU registers serve themselves by automatically tracking and recording memory access information without requiring external monitoring infrastructure. The hardware itself maintains the detection state, eliminating the need for complex software agents or external debuggers, thus reducing system complexity while preserving measurement precision.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS20250036486A1Data race detection method and apparatus
Publication Date: 2025.01.30 ELECTRONICS & TELECOMM RES INST
  • US20250036486A1 patent drawing
  • US20250036486A1 patent drawing
  • US20250036486A1 patent drawing

AI summary

Disclosed herein are a data race detection method and apparatus. The data race detection method includes recording information about an instruction executed by a thread in a destination register in a Central Processing Unit (CPU) corresponding to the thread, setting information of an access log field corresponding to the instruction for a cache line of a cache memory, and detecting a data race using the information of the access log field and information of the destination register.