Lines Matching +full:write +full:- +full:to +full:- +full:read

8 Sequence counters are a reader-writer consistency mechanism with
9 lockless readers (read-only retry loops), and no writer starvation. They
10 are used for data that's rarely written to (e.g. system time), where the
11 reader wants a consistent set of information and is willing to retry if
15 read side critical section is even and the same sequence count value is
16 read again at the end of the critical section. The data in the set must
17 be copied out inside the read side critical section. If the sequence
23 is odd and indicates to the readers that an update is in progress. At
24 the end of the write side critical section the sequence count becomes
27 A sequence counter write side critical section must never be preempted
28 or interrupted by read side sections. Otherwise the reader will spin for
29 the entire scheduler tick due to the odd sequence count value and the
30 interrupted writer. If that reader belongs to a real-time scheduling
43 multiple writers. Write side critical sections must thus be serialized
46 If the write serialization primitive is not implicitly disabling
48 write side section. If the read section can be invoked from hardirq or
50 disabled before entering the write section.
52 If it's desired to automatically handle the sequence counter
53 requirements of writer serialization and non-preemptibility, use
70 Write path::
76 /* ... [[write-side critical section]] ... */
80 Read path::
85 /* ... [[read-side critical section]] ... */
93 -----------------------------------------------------------------
95 As discussed at :ref:`seqcount_t`, sequence count write side critical
96 sections must be serialized and non-preemptible. This variant of
98 initialization time, which enables lockdep to validate that the write
104 injected at the beginning of the write side critical section to validate
108 protection is enforced in the write side function.
112 - ``seqcount_spinlock_t``
113 - ``seqcount_raw_spinlock_t``
114 - ``seqcount_rwlock_t``
115 - ``seqcount_mutex_t``
116 - ``seqcount_ww_mutex_t``
118 The sequence counter read and write APIs can take either a plain
136 Write path: same as in :ref:`seqcount_t`, while running from a context
137 with the associated write serialization lock acquired.
139 Read path: same as in :ref:`seqcount_t`.
145 ----------------------------------------------
148 where the embedded seqcount_t counter even/odd value is used to switch
150 read path to safely interrupt its own write side critical section.
152 Use seqcount_latch_t when the write side sections cannot be protected
153 from interruption by readers. This is typically the case when the read
165 embedded spinlock for writer serialization and non-preemptibility.
167 If the read side section can be invoked from hardirq or softirq context,
168 use the write side function variants which disable interrupts or bottom
185 Write path::
189 /* ... [[write-side critical section]] ... */
193 Read path, three categories:
202 /* ... [[read-side critical section]] ... */
208 from entering its critical section. This read lock is
213 /* ... [[read-side critical section]] ... */
218 according to a passed marker. This is used to avoid lockless readers
219 starvation (too much retry loops) in case of a sharp spike in write
220 activity. First, a lockless read is tried (even marker passed). If
222 the next iteration marker), the lockless read is transformed to a
223 full locking read and no retry loop is necessary::
230 /* ... [[read-side critical section]] ... */
239 .. kernel-doc:: include/linux/seqlock.h