Frightening small children and disconcerting grown-ups: Concurrency in the Linux kernel— Companion MaterialJade Alglave Luc Maranget Paul E. McKenney Andrea Parri Alan Stern |
We provide a complete version of our article with appendices.
Our complete test base consists of 8238 tests. The test base has been constructed both by accumulating significant tests and by systematic generation from cycles of non-SC executions. Tests are in two languages:
Using the following files, and the memory model simulator herd7, run a test by:
% herd7 -macros kernel.def -bell kernel.bell -model kernel.cat [filename]+
Once the files above have been copied to the local directory, your can also use the configuration file kernel.cfg:
% herd7 -conf kernel.cfg [filename]+
We run our tests on machine using a dedicated python script and the klitmus tool. We have run a subset of 2576 tests of the complete test base. Limitations are as follows:
rcu_assign_pointer
.
Tested systems are “Power8”, a CHRP IBM pSeries machine with 8 POWER8E CPUs at 3.4GHz (Linux v4.4.40), “ARMv8”, a Amlogic ARMv8 board with 4 Cortex-A53 cores at 1.5GHz (Linux v3.14.29), “ARMv7”, a Raspberry Pi ARMv7 board with 4 Cortex-A7 cores at 900Mhz (Linux v4.9.20), and “X86”, a HP desktop computer with 2 (6-core) Intel Xeon E5-2620 v3 CPUs at 2.40GHz (Linux v3.16.04).
We here provide an actualized version of the result table of the paper
Model | Power8 | ARMv8 | X86 | ARMv7 | C11 | |
LB | Allow | No, 0/15G | No, 0/10G | No, 0/33G | No, 0/3.0G | Allow |
Allow unseen | Allow unseen | Allow unseen | Allow unseen | |||
LB+ctrl+mb | Forbid | Ok, 0/17G | Ok, 0/5.1G | Ok, 0/18G | Ok, 0/4.4G | Allow |
WRC | Allow | Ok, 741k/7.7G | Ok, 13k/5.2G | No, 0/17G | No, 0/1.6G | Allow |
Allow unseen | Allow unseen | |||||
WRC+wmb+acq | Allow | No, 0/7.5G | No, 0/4.6G | No, 0/16G | No, 0/1.6G | Forbid |
Allow unseen | Allow unseen | Allow unseen | Allow unseen | |||
WRC+po-rel+rmb | Forbid | Ok, 0/7.7G | Ok, 0/5.3G | Ok, 0/17G | Ok, 0/1.6G | Forbid |
SB | Allow | Ok, 4.4G/15G | Ok, 2.4G/10G | Ok, 765M/33G | Ok, 429M/3.0G | Allow |
SB+mbs | Forbid | Ok, 0/15G | Ok, 0/10G | Ok, 0/33G | Ok, 0/3.0G | Forbid |
MP | Allow | Ok, 57M/15G | Ok, 104M/10G | No, 0/33G | Ok, 3.0M/3.0G | Allow |
Allow unseen | ||||||
MP+wmb+rmb | Forbid | Ok, 0/15G | Ok, 0/9.4G | Ok, 0/33G | Ok, 0/2.6G | Forbid |
PeterZ-No-Synchro | Allow | Ok, 26M/4.6G | Ok, 3.6M/900M | Ok, 351k/7.2G | Ok, 10k/380M | Allow |
PeterZ | Forbid | Ok, 0/8.7G | Ok, 0/2.5G | Ok, 0/9.1G | Ok, 0/2.2G | Allow |
RCU-deferred-free | Forbid | Ok, 0/256M | Ok, 0/576M | Ok, 0/25M | Ok, 0/15M | — |
RCU-MP | Forbid | Ok, 0/672M | Ok, 0/336M | Ok, 0/336M | Ok, 0/336M | — |
RWC | Allow | Ok, 88M/11G | Ok, 94M/4.8G | Ok, 5.6M/17G | Ok, 7.5M/1.6G | Allow |
RWC+mbs | Forbid | Ok, 0/8.7G | Ok, 0/2.5G | Ok, 0/9.1G | Ok, 0/2.2G | Allow |
Our main experimental result is here: our model is experimentally sound as demonstrated by the empty table “Forbidden by model and observed” below.
In this section we compare the Linux model with the C11 model. The C11 CAT model is the default C11 model of herd7. This model is the second C11 model (partial order SC model) from “Overhauling SC atomics in C11 and OpenCL” (POPL’2016) by Mark Batty, Alastair F. Donaldson, and John Wickerson. The herd7 implementation of this model is adapted from the authors own CAT files.
Our main experimental result demonstrates that C11 SC fence
atomic_thread_fence(memory_order_seq_cst)
does not suffice to rule out all non-sequentially consistent executions —
see the table here.
By contrast and given our Linux model, smp_mb() suffices
to guarantee sequential consistency. One should notice that all modern
architectures provide such a strong fence that Linux implementations would
map smp_mb() onto.
Model | Model.Old | HardWare | |
C-WillDeacon-MP+o-r+ai-rmb-o | Allow | Forbid | No, 0/660M |
Allow unseen |
Model | Model.Old | HardWare | |
Luc17 | Forbid | Allow | No, 0/31G |
Allow unseen | |||
Luc19 | Forbid | Allow | No, 0/31G |
Allow unseen | |||
Luc15 | Forbid | Allow | No, 0/31G |
Allow unseen |
This document was translated from LATEX by HEVEA.