[Paper Review] An Evaluation of Coarse-Grained Locking for Multicore Microkernels
This paper evaluates coarse-grained locking (big lock) in multicore microkernels, showing it achieves scalability comparable to fine-grained locking on tightly-coupled, shared-cache architectures like x86 and ARM, especially when enhanced with Intel TSX hardware transactional memory. The key finding is that a single kernel lock, combined with transactional memory, delivers near-optimal performance while simplifying code and enabling formal verification.
The trade-off between coarse- and fine-grained locking is a well understood issue in operating systems. Coarse-grained locking provides lower overhead under low contention, fine-grained locking provides higher scalability under contention, though at the expense of implementation complexity and re- duced best-case performance. We revisit this trade-off in the context of microkernels and tightly-coupled cores with shared caches and low inter-core migration latencies. We evaluate performance on two architectures: x86 and ARM MPCore, in the former case also utilising transactional memory (Intel TSX). Our thesis is that on such hardware, a well-designed microkernel, with short system calls, can take advantage of coarse-grained locking on modern hardware, avoid the run-time and complexity cost of multiple locks, enable formal verification, and still achieve scalability comparable to fine-grained locking.
Motivation & Objective
- To assess whether coarse-grained locking can achieve scalability comparable to fine-grained locking in modern multicore microkernels.
- To evaluate the performance impact of lock overhead in microkernels with very short system call latencies (hundreds of cycles).
- To investigate whether hardware transactional memory (Intel TSX) can eliminate the need for complex fine-grained locking while maintaining high performance.
- To determine if a big-lock design remains viable for tightly-coupled, shared-cache multicore systems where inter-core communication is fast.
- To explore the trade-off between implementation complexity, performance, and formal verification feasibility in microkernel design.
Proposed method
- The authors implement and evaluate three versions of the seL4 microkernel: one with a big kernel lock (BKL), one with fine-grained locking, and one using Intel TSX for lock elision.
- They conduct microbenchmarks and a macrobenchmark on two platforms: an x86 server and an ARM MPCore embedded processor.
- A queueing-theoretic model is developed and validated experimentally to predict and analyze scalability under different locking regimes.
- Hardware transactional memory (Intel TSX) is used to elide the big lock, allowing the entire system call to be wrapped in a transaction.
- The model accounts for inter-core cache-line migration costs and system call latencies to estimate theoretical performance limits.
- The evaluation compares performance across different core counts and workloads, measuring throughput and overhead.
Experimental results
Research questions
- RQ1Can a coarse-grained lock in a microkernel achieve scalability comparable to fine-grained locking on modern, tightly-coupled multicore systems?
- RQ2How significant is the performance overhead of lock acquisition in microkernels with very short system call latencies?
- RQ3To what extent does hardware transactional memory (Intel TSX) enable the performance benefits of fine-grained locking without its complexity?
- RQ4Does the inter-core cache-line migration cost significantly affect scalability in a shared-kernel microkernel design?
- RQ5Can a big-lock microkernel maintain high performance and remain amenable to formal verification, unlike fine-grained alternatives?
Key findings
- On the x86 platform, the big lock (BKL) performs within 25% of fine-grained locking under high contention, but plateaus at four cores due to high inter-core cache-line migration costs.
- On the ARM platform, the BKL scales perfectly to four cores even with a 500-cycle average inter-syscall time, indicating that cache coherency costs are more favorable.
- Lock overhead is significant in microkernels: the BKL incurs 23% overhead on ARM and up to several percent on x86, making lock cost a critical factor.
- Hardware transactional memory (Intel TSX) enables perfect scaling for embarrassingly parallel workloads, with minimal overhead and no serialization.
- In a realistic macrobenchmark, RTM upper-bounds the performance of both BKL and fine-grained locking, showing it can deliver the best of both worlds.
- The BKL design outperforms fine-grained locking under less extreme workloads and enables formal verification, which is infeasible with fine-grained locking due to complexity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.