~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/memory-model/linux-kernel.bell

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/memory-model/linux-kernel.bell (Version linux-6.11.5) and /tools/memory-model/linux-kernel.bell (Version linux-5.9.16)


  1 // SPDX-License-Identifier: GPL-2.0+                1 // SPDX-License-Identifier: GPL-2.0+
  2 (*                                                  2 (*
  3  * Copyright (C) 2015 Jade Alglave <j.alglave@u      3  * Copyright (C) 2015 Jade Alglave <j.alglave@ucl.ac.uk>,
  4  * Copyright (C) 2016 Luc Maranget <luc.marange      4  * Copyright (C) 2016 Luc Maranget <luc.maranget@inria.fr> for Inria
  5  * Copyright (C) 2017 Alan Stern <stern@rowland      5  * Copyright (C) 2017 Alan Stern <stern@rowland.harvard.edu>,
  6  *                    Andrea Parri <parri.andre      6  *                    Andrea Parri <parri.andrea@gmail.com>
  7  *                                                  7  *
  8  * An earlier version of this file appeared in      8  * An earlier version of this file appeared in the companion webpage for
  9  * "Frightening small children and disconcerti      9  * "Frightening small children and disconcerting grown-ups: Concurrency
 10  * in the Linux kernel" by Alglave, Maranget,      10  * in the Linux kernel" by Alglave, Maranget, McKenney, Parri, and Stern,
 11  * which appeared in ASPLOS 2018.                  11  * which appeared in ASPLOS 2018.
 12  *)                                                12  *)
 13                                                    13 
 14 "Linux-kernel memory consistency model"            14 "Linux-kernel memory consistency model"
 15                                                    15 
 16 enum Accesses = 'once (*READ_ONCE,WRITE_ONCE*)     16 enum Accesses = 'once (*READ_ONCE,WRITE_ONCE*) ||
 17                 'release (*smp_store_release*)     17                 'release (*smp_store_release*) ||
 18                 'acquire (*smp_load_acquire*)      18                 'acquire (*smp_load_acquire*) ||
 19                 'noreturn (* R of non-return R     19                 'noreturn (* R of non-return RMW *)
 20 instructions R[{'once,'acquire,'noreturn}]         20 instructions R[{'once,'acquire,'noreturn}]
 21 instructions W[{'once,'release}]                   21 instructions W[{'once,'release}]
 22 instructions RMW[{'once,'acquire,'release}]        22 instructions RMW[{'once,'acquire,'release}]
 23                                                    23 
 24 enum Barriers = 'wmb (*smp_wmb*) ||                24 enum Barriers = 'wmb (*smp_wmb*) ||
 25                 'rmb (*smp_rmb*) ||                25                 'rmb (*smp_rmb*) ||
 26                 'mb (*smp_mb*) ||                  26                 'mb (*smp_mb*) ||
 27                 'barrier (*barrier*) ||            27                 'barrier (*barrier*) ||
 28                 'rcu-lock (*rcu_read_lock*)  |     28                 'rcu-lock (*rcu_read_lock*)  ||
 29                 'rcu-unlock (*rcu_read_unlock*     29                 'rcu-unlock (*rcu_read_unlock*) ||
 30                 'sync-rcu (*synchronize_rcu*)      30                 'sync-rcu (*synchronize_rcu*) ||
 31                 'before-atomic (*smp_mb__befor     31                 'before-atomic (*smp_mb__before_atomic*) ||
 32                 'after-atomic (*smp_mb__after_     32                 'after-atomic (*smp_mb__after_atomic*) ||
 33                 'after-spinlock (*smp_mb__afte     33                 'after-spinlock (*smp_mb__after_spinlock*) ||
 34                 'after-unlock-lock (*smp_mb__a !!  34                 'after-unlock-lock (*smp_mb__after_unlock_lock*)
 35                 'after-srcu-read-unlock (*smp_ << 
 36 instructions F[Barriers]                           35 instructions F[Barriers]
 37                                                    36 
 38 (* SRCU *)                                         37 (* SRCU *)
 39 enum SRCU = 'srcu-lock || 'srcu-unlock || 'syn     38 enum SRCU = 'srcu-lock || 'srcu-unlock || 'sync-srcu
 40 instructions SRCU[SRCU]                            39 instructions SRCU[SRCU]
 41 (* All srcu events *)                              40 (* All srcu events *)
 42 let Srcu = Srcu-lock | Srcu-unlock | Sync-srcu     41 let Srcu = Srcu-lock | Srcu-unlock | Sync-srcu
 43                                                    42 
 44 (* Compute matching pairs of nested Rcu-lock a     43 (* Compute matching pairs of nested Rcu-lock and Rcu-unlock *)
 45 let rcu-rscs = let rec                             44 let rcu-rscs = let rec
 46             unmatched-locks = Rcu-lock \ domai     45             unmatched-locks = Rcu-lock \ domain(matched)
 47         and unmatched-unlocks = Rcu-unlock \ r     46         and unmatched-unlocks = Rcu-unlock \ range(matched)
 48         and unmatched = unmatched-locks | unma     47         and unmatched = unmatched-locks | unmatched-unlocks
 49         and unmatched-po = [unmatched] ; po ;      48         and unmatched-po = [unmatched] ; po ; [unmatched]
 50         and unmatched-locks-to-unlocks =           49         and unmatched-locks-to-unlocks =
 51                 [unmatched-locks] ; po ; [unma     50                 [unmatched-locks] ; po ; [unmatched-unlocks]
 52         and matched = matched | (unmatched-loc     51         and matched = matched | (unmatched-locks-to-unlocks \
 53                 (unmatched-po ; unmatched-po))     52                 (unmatched-po ; unmatched-po))
 54         in matched                                 53         in matched
 55                                                    54 
 56 (* Validate nesting *)                             55 (* Validate nesting *)
 57 flag ~empty Rcu-lock \ domain(rcu-rscs) as unm !!  56 flag ~empty Rcu-lock \ domain(rcu-rscs) as unbalanced-rcu-locking
 58 flag ~empty Rcu-unlock \ range(rcu-rscs) as un !!  57 flag ~empty Rcu-unlock \ range(rcu-rscs) as unbalanced-rcu-locking
 59                                                    58 
 60 (* Compute matching pairs of nested Srcu-lock      59 (* Compute matching pairs of nested Srcu-lock and Srcu-unlock *)
 61 let carry-srcu-data = (data ; [~ Srcu-unlock]  !!  60 let srcu-rscs = let rec
 62 let srcu-rscs = ([Srcu-lock] ; carry-srcu-data !!  61             unmatched-locks = Srcu-lock \ domain(matched)
                                                   >>  62         and unmatched-unlocks = Srcu-unlock \ range(matched)
                                                   >>  63         and unmatched = unmatched-locks | unmatched-unlocks
                                                   >>  64         and unmatched-po = ([unmatched] ; po ; [unmatched]) & loc
                                                   >>  65         and unmatched-locks-to-unlocks =
                                                   >>  66                 ([unmatched-locks] ; po ; [unmatched-unlocks]) & loc
                                                   >>  67         and matched = matched | (unmatched-locks-to-unlocks \
                                                   >>  68                 (unmatched-po ; unmatched-po))
                                                   >>  69         in matched
 63                                                    70 
 64 (* Validate nesting *)                             71 (* Validate nesting *)
 65 flag ~empty Srcu-lock \ domain(srcu-rscs) as u !!  72 flag ~empty Srcu-lock \ domain(srcu-rscs) as unbalanced-srcu-locking
 66 flag ~empty Srcu-unlock \ range(srcu-rscs) as  !!  73 flag ~empty Srcu-unlock \ range(srcu-rscs) as unbalanced-srcu-locking
 67 flag ~empty (srcu-rscs^-1 ; srcu-rscs) \ id as << 
 68                                                    74 
 69 (* Check for use of synchronize_srcu() inside      75 (* Check for use of synchronize_srcu() inside an RCU critical section *)
 70 flag ~empty rcu-rscs & (po ; [Sync-srcu] ; po)     76 flag ~empty rcu-rscs & (po ; [Sync-srcu] ; po) as invalid-sleep
 71                                                    77 
 72 (* Validate SRCU dynamic match *)                  78 (* Validate SRCU dynamic match *)
 73 flag ~empty different-values(srcu-rscs) as src !!  79 flag ~empty different-values(srcu-rscs) as srcu-bad-nesting
 74                                                    80 
 75 (* Compute marked and plain memory accesses *)     81 (* Compute marked and plain memory accesses *)
 76 let Marked = (~M) | IW | Once | Release | Acqu     82 let Marked = (~M) | IW | Once | Release | Acquire | domain(rmw) | range(rmw) |
 77                 LKR | LKW | UL | LF | RL | RU  !!  83                 LKR | LKW | UL | LF | RL | RU
 78 let Plain = M \ Marked                             84 let Plain = M \ Marked
 79                                                << 
 80 (* Redefine dependencies to include those carr << 
 81 let carry-dep = (data ; [~ Srcu-unlock] ; rfi) << 
 82 let addr = carry-dep ; addr                    << 
 83 let ctrl = carry-dep ; ctrl                    << 
 84 let data = carry-dep ; data                    << 
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php