NUMA-aware reader-writer locks reduce coherence traffic

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current locking mechanisms in multiprocessor environments, particularly in NUMA and CC-NUMA architectures, face issues with excessive coherence traffic and poor scalability due to frequent lock migration and contention, leading to performance degradation.

Innovation Solution

The implementation of NUMA-aware reader-writer locks using lock cohorting techniques, where writer threads hand off locks to local threads and reader threads can acquire locks in read mode simultaneously across nodes, reducing lock migration and coherence traffic by relaxing the FIFO ordering and promoting parallelism.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If traditional mutual exclusion locks are used in NUMA architectures, then lock ownership can be transferred between threads, but coherence traffic increases and scalability deteriorates

Engineering Contradiction:
Improvelock ownership transferVSAvoidsystem performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent segments the single global lock into multiple node-local locks, one for each NUMA node. Threads acquire locks locally on their node rather than contending for a global lock, which reduces coherence traffic across the interconnect. Each node maintains its own lock state independently, allowing parallel lock acquisitions on different nodes while preventing unnecessary remote cache invalidations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent makes lock acquisition local to each NUMA node by having threads acquire locks on their home node rather than accessing a remote global lock. This localizes the critical section to each node's memory hierarchy, ensuring that lock operations primarily access local cache and memory, thereby reducing remote memory access latency and coherence protocol traffic.

Inventive Principle:
Principle #3Local quality

2Ease of operation

If lock ownership migrates frequently between NUMA nodes, then thread flexibility increases, but coherence traffic and latency increase

Engineering Contradiction:
Improvethread flexibilityVSAvoidlock acquisition latency
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The patent performs preliminary binding of threads to NUMA nodes before lock acquisition. Each thread is assigned a home node in advance, and lock acquisition occurs locally on that node. This preliminary arrangement eliminates the need for dynamic lock migration decisions during runtime, ensuring that lock operations always occur on local memory without incurring remote access latency.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If FIFO ordering is enforced for lock acquisition, then fairness is improved, but parallelism and throughput decrease

Engineering Contradiction:
Improvelock fairnessVSAvoidlock throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent transitions from a single-dimensional global FIFO queue to a multi-dimensional structure where each NUMA node has its own independent lock queue. Threads on different nodes can acquire locks in parallel without interfering with each other's fairness guarantees. Each node maintains FIFO ordering locally, while the system as a whole achieves higher throughput through parallel lock acquisitions across multiple nodes.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS8966491B2System and method for implementing NUMA-aware reader-writer locks
Publication Date: 2015.02.24 ORACLE INT CORP
  • US8966491B2 patent drawing
  • US8966491B2 patent drawing
  • US8966491B2 patent drawing

AI summary

NUMA-aware reader-writer locks may leverage lock cohorting techniques to band together writer requests from a single NUMA node. The locks may relax the order in which the lock schedules the execution of critical sections of code by reader threads and writer threads, allowing lock ownership to remain resident on a single NUMA node for long periods, while also taking advantage of parallelism between reader threads. Threads may contend on node-level structures to get permission to acquire a globally shared reader-writer lock. Writer threads may follow a lock cohorting strategy of passing ownership of the lock in write mode from one thread to a cohort writer thread without releasing the shared lock, while reader threads from multiple NUMA nodes may simultaneously acquire the shared lock in read mode. The reader-writer lock may follow a writer-preference policy, a reader-preference policy or a hybrid policy.