Skip to content

Commit a690ed0

Browse files
a-darwishPeter Zijlstra
authored andcommitted
time/sched_clock: Use seqcount_latch_t
Latch sequence counters have unique read and write APIs, and thus seqcount_latch_t was recently introduced at seqlock.h. Use that new data type instead of plain seqcount_t. This adds the necessary type-safety and ensures only latching-safe seqcount APIs are to be used. Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20200827114044.11173-5-a.darwish@linutronix.de
1 parent 80793c3 commit a690ed0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/time/sched_clock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* into a single 64-byte cache line.
3636
*/
3737
struct clock_data {
38-
seqcount_t seq;
38+
seqcount_latch_t seq;
3939
struct clock_read_data read_data[2];
4040
ktime_t wrap_kt;
4141
unsigned long rate;
@@ -76,7 +76,7 @@ struct clock_read_data *sched_clock_read_begin(unsigned int *seq)
7676

7777
int sched_clock_read_retry(unsigned int seq)
7878
{
79-
return read_seqcount_retry(&cd.seq, seq);
79+
return read_seqcount_latch_retry(&cd.seq, seq);
8080
}
8181

8282
unsigned long long notrace sched_clock(void)

0 commit comments

Comments
 (0)