Skip to content

Commit 1a2b85f

Browse files
Davidlohr BuesoKAGA-KOKO
authored andcommitted
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. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201021190749.19363-1-dave@stgolabs.net
1 parent 3650b22 commit 1a2b85f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎kernel/time/jiffies.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static struct clocksource clocksource_jiffies = {
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‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extern void do_timer(unsigned long ticks);
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

0 commit comments

Comments
 (0)