Hierarchical Spin Locks for Multiprocessing Systems

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Spin-lock operations in distributed shared memory architectures lead to high latency and network traffic due to contention among processors, with existing optimizations often neglecting the Non-Uniform Communication Architecture (NUCA) characteristics, resulting in inefficiencies for both contended and uncontended locks.

Innovation Solution

Implementing hierarchical spin locks that prioritize node locality by allowing processors within the same node to acquire a lock before remote nodes, using local and remote lock states to manage lock acquisition and release, and incorporating exponential backoff delays to reduce contention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If simple spin-lock implementations are used, then lock acquisition is straightforward, but network traffic becomes very bursty and latency increases

Engineering Contradiction:
Improvelock acquisition simplicityVSAvoidnetwork traffic
Core Design Contradiction:
Ease of operationVSLoss of energy

Solution Approach 1:

The patent segments the spin-lock mechanism into two distinct modes: local spin-lock for同一节点 processors and remote spin-lock for different nodes. This segmentation allows the system to handle lock operations differently based on processor location, reducing unnecessary network traffic for local operations while maintaining proper locking semantics for remote operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements local quality by allowing processors within the same node to acquire locks without generating network traffic, while remote processors follow standard spin-lock protocols. The lock state includes a node identifier that determines whether access should be local or remote, optimizing performance for local operations while maintaining correctness for remote operations.

Inventive Principle:
Principle #3Local quality

2Productivity

If processors continuously spin on locked memory regions, then lock acquisition is attempted aggressively, but latency and network traffic increase due to contention

Engineering Contradiction:
Improvelock acquisition speedVSAvoidlock latency
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent implements dynamic behavior by having processors adapt their spin-lock strategy based on the lock's node identifier. If the lock belongs to the local node, processors spin locally without network traffic. If the lock belongs to a remote node, processors use exponential backoff and generate network traffic only when necessary, dynamically adjusting behavior to minimize latency.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent introduces an intermediary mechanism where the lock state itself (specifically the node identifier field) acts as a mediator that directs processors to appropriate spin-lock behavior. This intermediary allows the system to resolve contention efficiently by routing local contending processors to spin locally while remote processors follow standard protocols.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If locks migrate frequently between nodes, then processor utilization is maximized, but network traffic and coherency invalidations increase

Engineering Contradiction:
Improveprocessor utilizationVSAvoidnetwork traffic
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent applies preliminary action by pre-assigning locks to specific nodes based on the owning processor's node identifier when the lock is acquired. This pre-assignment reduces frequent lock migration between nodes, as subsequent acquirers from the same node can obtain the lock without triggering network traffic or coherency invalidations, while still allowing productive utilization of local processors.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS7529844B2Multiprocessing systems employing hierarchical spin locks
Publication Date: 2009.05.05 ORACLE AMERICAN INC
  • US7529844B2 patent drawing
  • US7529844B2 patent drawing
  • US7529844B2 patent drawing

AI summary

A method for controlling a software lock acquirable by processors in a plurality of nodes of a multiprocessing system is disclosed. The method comprises a first processor of a first node of the plurality of nodes acquiring the lock, and the first processor selectively releasing the lock in a first state that allows other processors within the first node to acquire the lock but that prevents processors in a remote node of the plurality of nodes from obtaining the lock. In another embodiment, a method comprises a first processor of a first node attempting to acquire the lock, the first processor determining whether another processor within the same node is remotely spinning on the lock, and the first processor remotely spinning on the lock in response to determining that another processor in the same node is not remotely spinning on the software lock.