]> asedeno.scripts.mit.edu Git - linux.git/commit
tools/memory-model: Add SRCU support
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 15 Nov 2018 16:20:37 +0000 (11:20 -0500)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 18 Mar 2019 17:27:52 +0000 (10:27 -0700)
commita3f600d92da564ad35f237c8aeab268ca49377cc
tree8b5cbb5e49d7b0556f2fdd1faf9667810c4d1941
parent284749b0aebbf3ab26ff92198545aea36165f6bf
tools/memory-model: Add SRCU support

Add support for SRCU.  Herd creates srcu events and linux-kernel.def
associates them with three possible annotations (srcu-lock,
srcu-unlock, and sync-srcu) corresponding to the API routines
srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu().

The linux-kernel.bell file now declares the annotations
and determines matching lock/unlock pairs delimiting SRCU read-side
critical sections, and it also checks for synchronize_srcu() calls
inside an RCU critical section (which would generate a "sleeping in
atomic context" error in real kernel code).  The linux-kernel.cat file
now adds SRCU-induced ordering, analogous to the existing RCU-induced
ordering, to the gp and rcu-fence relations.

Curiously enough, these small changes to the model's .cat code are all
that is needed to describe SRCU.

Portions of this patch (linux-kernel.def and the first hunk in
linux-kernel.bell) were written by Luc Maranget.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Luc Maranget <luc.maranget@inria.fr>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Tested-by: Andrea Parri <andrea.parri@amarulasolutions.com>
tools/memory-model/linux-kernel.bell
tools/memory-model/linux-kernel.cat
tools/memory-model/linux-kernel.def