Skip to content

Commit

Permalink
timekeeping: Convert jiffies_seq to seqcount_raw_spinlock_t
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Davidlohr Bueso authored and Thomas Gleixner committed Oct 26, 2020
1 parent 3650b22 commit 1a2b85f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kernel/time/jiffies.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ static struct clocksource clocksource_jiffies = {
};

__cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(jiffies_lock);
__cacheline_aligned_in_smp seqcount_t jiffies_seq;
__cacheline_aligned_in_smp seqcount_raw_spinlock_t jiffies_seq =
SEQCNT_RAW_SPINLOCK_ZERO(jiffies_seq, &jiffies_lock);

#if (BITS_PER_LONG < 64)
u64 get_jiffies_64(void)
Expand Down
2 changes: 1 addition & 1 deletion kernel/time/timekeeping.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern void do_timer(unsigned long ticks);
extern void update_wall_time(void);

extern raw_spinlock_t jiffies_lock;
extern seqcount_t jiffies_seq;
extern seqcount_raw_spinlock_t jiffies_seq;

#define CS_NAME_LEN 32

Expand Down

0 comments on commit 1a2b85f

Please sign in to comment.