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
59};59};
60 60
61__cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(jiffies_lock);61__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);
63 64
64#if (BITS_PER_LONG < 64)65#if (BITS_PER_LONG < 64)
65u64 get_jiffies_64(void)66u64 get_jiffies_64(void)
kernel/time/timekeeping.h+1−1
@@ -26,7 +26,7 @@ extern void do_timer(unsigned long ticks); · 25 unmodified lines
26extern void update_wall_time(void);26extern void update_wall_time(void);
27 27
28extern raw_spinlock_t jiffies_lock;28extern raw_spinlock_t jiffies_lock;
29extern seqcount_t jiffies_seq;29extern seqcount_raw_spinlock_t jiffies_seq;
30 30
31#define CS_NAME_LEN 3231#define CS_NAME_LEN 32
32 32

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