History

timekeeping: Convert jiffies_seq to seqcount_raw_spinlock_t

Use the new api and associate the seqcounter to the jiffies_lock enabling lockdep support - although for this particular case the write-side locking and non-preemptibility are quite obvious.

Davidlohr Bueso committed 6 years ago

Commit 1a2b85f1 parent 3650b222 files · +3 −2Browse files

Showing the changes to kernel (2 of 2 files). Show all

Unified · Split

2 files
  1. kernel/time/jiffies.c +2 −1
  2. kernel/time/timekeeping.h +1 −1
kernel/time/jiffies.c+2−1
@@ -59,7 +59,8 @@ static struct clocksource clocksource_jiffies = { · 58 unmodified lines
5959 };
6060
6161 __cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(jiffies_lock);
62−__cacheline_aligned_in_smp seqcount_t jiffies_seq;
62+__cacheline_aligned_in_smp seqcount_raw_spinlock_t jiffies_seq =
63+ SEQCNT_RAW_SPINLOCK_ZERO(jiffies_seq, &jiffies_lock);
6364
6465 #if (BITS_PER_LONG < 64)
6566 u64 get_jiffies_64(void)
kernel/time/timekeeping.h+1−1
@@ -26,7 +26,7 @@ extern void do_timer(unsigned long ticks); · 25 unmodified lines
2626 extern void update_wall_time(void);
2727
2828 extern raw_spinlock_t jiffies_lock;
29−extern seqcount_t jiffies_seq;
29+extern seqcount_raw_spinlock_t jiffies_seq;
3030
3131 #define CS_NAME_LEN 32
3232

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t