Lock Unlock Operation Prioritization for Multi-Core Contention

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Kernel-based sleep mechanisms for lock/unlock operations can cause significant performance degradation, especially in multi-core processors, due to overhead and increased waiting times for threads competing for locks, leading to inefficiencies in managing contention among threads.

Innovation Solution

Implementing an 'active spinning' mechanism and prioritizing unlock operations over lock operations within the processor's hardware to reduce reliance on kernel-based sleep states and ensure fairness among threads, using a prediction mechanism to identify and prioritize unlock operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If kernel-based sleep mechanisms are used for lock operations, then thread blocking is achieved, but performance degradation occurs due to overhead and increased waiting times

Engineering Contradiction:
Improvelock mechanism reliabilityVSAvoidsystem performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent extracts the sleep mechanism dependency from the lock operation by implementing active spinning in hardware. Instead of relying on kernel-based sleep states, the system uses dedicated hardware circuits to continuously attempt lock acquisition, removing the performance overhead associated with kernel involvement and thread blocking.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the software-based kernel sleep mechanism with a hardware-based active spinning mechanism. The processor includes dedicated circuitry that automatically retries lock operations without involving the kernel, substituting the mechanical software scheduling system with a more efficient hardware-level solution.

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

2Productivity

If threads continuously retry lock operations, then lock acquisition is attempted actively, but contention overhead increases among competing threads

Engineering Contradiction:
Improvelock acquisition speedVSAvoidcontention overhead
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The hardware active spinning mechanism serves itself by automatically managing lock retry logic without requiring software intervention. The dedicated circuits independently handle continuous lock acquisition attempts, reducing the computational overhead that would otherwise be consumed by software-based retry mechanisms and kernel context switches.

Inventive Principle:
Principle #25Self-service

3Reliability

If lock operations are prioritized over unlock operations, then lock acquisition is ensured, but fairness among threads deteriorates as unlock operations are blocked

Engineering Contradiction:
Improvelock acquisition guaranteeVSAvoidthread fairness
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The patent inverts the traditional prioritization scheme by giving higher priority to unlock operations rather than lock operations. This inversion ensures that threads can release locks without being blocked by concurrent lock acquisition attempts, improving overall system fairness while maintaining efficient lock acquisition through hardware-based active spinning.

Inventive Principle:
Principle #13The other way round (Inversion)

Data Source

PatentUS10331500B2Managing fairness for lock and unlock operations using operation prioritization
Publication Date: 2019.06.25 MARVELL ASIA PTE LTD
  • US10331500B2 patent drawing
  • US10331500B2 patent drawing

AI summary

Managing lock and unlock operations for a first thread executing on a first processor core includes, for each instruction included in the first thread and identified as being associated with: (1) a lock operation corresponding to a particular lock stored in a particular memory location, in response to determining that the particular lock has already been acquired, continuing to perform the lock operation for multiple attempts using associated operation messages for accessing the particular memory location, or (2) an unlock operation corresponding to a particular lock stored in a particular memory location, releasing the particular lock from the first thread using an associated operation message for accessing the particular memory location. Selected operation messages associated with an unlock operation are prioritized over operation messages associated with a lock operation.