* Exit a read section. */
| 140 | * Exit a read section. |
| 141 | */ |
| 142 | static inline void |
| 143 | smr_exit(smr_t smr) |
| 144 | { |
| 145 | |
| 146 | smr = zpcpu_get(smr); |
| 147 | CRITICAL_ASSERT(curthread); |
| 148 | KASSERT((smr->c_flags & SMR_LAZY) == 0, |
| 149 | ("smr_exit(%s) lazy smr.", smr->c_shared->s_name)); |
| 150 | KASSERT(smr->c_seq != SMR_SEQ_INVALID, |
| 151 | ("smr_exit(%s) not in a smr section.", smr->c_shared->s_name)); |
| 152 | |
| 153 | /* |
| 154 | * Clear the recorded sequence number. This allows poll() to |
| 155 | * detect CPUs not in read sections. |
| 156 | * |
| 157 | * Use release semantics to retire any stores before the sequence |
| 158 | * number is cleared. |
| 159 | */ |
| 160 | atomic_store_rel_int(&smr->c_seq, SMR_SEQ_INVALID); |
| 161 | critical_exit(); |
| 162 | } |
| 163 | |
| 164 | /* |
| 165 | * Enter a lazy smr section. This is used for read-mostly state that |
no test coverage detected