* Enter a lazy smr section. This is used for read-mostly state that * can tolerate a high free latency. */
| 166 | * can tolerate a high free latency. |
| 167 | */ |
| 168 | static inline void |
| 169 | smr_lazy_enter(smr_t smr) |
| 170 | { |
| 171 | |
| 172 | critical_enter(); |
| 173 | smr = zpcpu_get(smr); |
| 174 | KASSERT((smr->c_flags & SMR_LAZY) != 0, |
| 175 | ("smr_lazy_enter(%s) non-lazy smr.", smr->c_shared->s_name)); |
| 176 | KASSERT(smr->c_seq == 0, |
| 177 | ("smr_lazy_enter(%s) does not support recursion.", |
| 178 | smr->c_shared->s_name)); |
| 179 | |
| 180 | /* |
| 181 | * This needs no serialization. If an interrupt occurs before we |
| 182 | * assign sr_seq to c_seq any speculative loads will be discarded. |
| 183 | * If we assign a stale wr_seq value due to interrupt we use the |
| 184 | * same algorithm that renders smr_enter() safe. |
| 185 | */ |
| 186 | atomic_store_int(&smr->c_seq, smr_shared_current(smr->c_shared)); |
| 187 | } |
| 188 | |
| 189 | /* |
| 190 | * Exit a lazy smr section. This is used for read-mostly state that |
nothing calls this directly
no test coverage detected