Per-Core Spinlock Segmentation for Multi-Reader Writer Concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Spinlocks in multi-core computer systems face performance degradation due to cache line access issues and limited bit usage, leading to busy waiting and false sharing, especially when accessed by multiple cores, and require efficient management to prevent race conditions.

Innovation Solution

Implementing a multi-reader/single writer spinlock system where each core has a spinlock on a separate cache line, allowing simultaneous readers to avoid busy waiting while writers must acquire all locks, and using a dynamic multi-reader/single writer lock arrangement to optimize cache line usage and reduce false sharing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If a traditional spinlock is used in a multi-core system, then the lock mechanism is simple to implement, but performance degrades significantly due to cache line contention and false sharing when multiple cores access the lock

Engineering Contradiction:
Improveease of implementationVSAvoidsystem performance
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The patent divides a single shared spinlock into multiple per-core spinlocks, with each core having its own lock variable stored in a separate cache line. This segmentation eliminates false sharing between cores while maintaining the simplicity of spinlock implementation, as each core independently manages its own lock without interfering with other cores' cache lines.

Inventive Principle:
Principle #1Segmentation

2Reliability

If multiple cores access the same spinlock, then the lock provides centralized control, but cache line invalidation causes performance degradation due to false sharing

Engineering Contradiction:
Improvelock controlVSAvoidperformance degradation
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

By allocating separate cache lines for each core's spinlock variable, the patent eliminates cache line invalidation between cores. Each core's lock operations only affect its own cache line, preventing the false sharing performance degradation that occurs when multiple cores access a shared lock variable.

Inventive Principle:
Principle #1Segmentation

3Duration of action of moving object

If a spinlock is held for a long duration, then the thread can complete its critical section, but other threads waste time spinning and the system loses productivity

Engineering Contradiction:
Improvelock hold durationVSAvoidthread throughput
Core Design Contradiction:
Duration of action of moving objectVSProductivity

Solution Approach 1:

The patent changes the state parameter of the spinlock system by introducing per-core locks with distinct cache line addresses. This allows the system to track and manage lock states more efficiently, reducing unnecessary spinning when locks are available and improving overall thread throughput while maintaining appropriate lock hold durations.

Inventive Principle:
Principle #35Parameter changes

4Device complexity

If a single spinlock is shared across all cores, then the implementation is straightforward, but race conditions become difficult to prevent correctly

Engineering Contradiction:
Improvelock structureVSAvoidrace condition prevention
Core Design Contradiction:
Device complexityVSReliability

Solution Approach 1:

The patent segments the single shared lock into multiple per-core locks, each with its own memory location. This segmentation simplifies race condition prevention because each core has a dedicated lock variable, eliminating the complex coordination and atomic operations required when multiple cores access a shared lock variable simultaneously.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8868845B1Dynamic single/multi-reader, single-writer spinlocks
Publication Date: 2014.10.21 EMC IP HLDG CO LLC
  • US8868845B1 patent drawing
  • US8868845B1 patent drawing
  • US8868845B1 patent drawing

AI summary

Example embodiments of the present invention include a method, system and computer program product for managing spinlocks in a multi-core computer system. The method comprises providing a spinlock per core in the multi-core computer system and storing each spinlock in a respective memory location configured to be access independently by respective cores of the multi-core computer system. A request is then received at a core in the multi-core computer system to perform an operation on a spinlock in the multi-core computer system. A multi-reader/single writer spinlock is obtained in response to the request.