Commit a94a3303 authored by Ravikiran G. Thirumalai's avatar Ravikiran G. Thirumalai Committed by Linus Torvalds

[PATCH] Ensure xtime_lock and timerlist_lock are on difft cachelines

I've noticed that xtime_lock and timerlist_lock ends up on the same
cacheline  all the time (atleaset on x86).  Not a good thing for
loads with high xxx_timer and do_gettimeofday counts I guess (networking etc).

Here's a trivial fix.
parent 4966a3c5
......@@ -169,7 +169,7 @@ static inline void internal_add_timer(struct timer_list *timer)
}
/* Initialize both explicitly - let's try to have them in the same cache line */
spinlock_t timerlist_lock = SPIN_LOCK_UNLOCKED;
spinlock_t timerlist_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
#ifdef CONFIG_SMP
volatile struct timer_list * volatile running_timer;
......@@ -327,7 +327,7 @@ static inline void run_timer_list(void)
spin_unlock_irq(&timerlist_lock);
}
spinlock_t tqueue_lock = SPIN_LOCK_UNLOCKED;
spinlock_t tqueue_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
void tqueue_bh(void)
{
......@@ -633,7 +633,7 @@ unsigned long wall_jiffies;
* This read-write spinlock protects us from races in SMP while
* playing with xtime and avenrun.
*/
rwlock_t xtime_lock = RW_LOCK_UNLOCKED;
rwlock_t xtime_lock __cacheline_aligned_in_smp = RW_LOCK_UNLOCKED;
unsigned long last_time_offset;
static inline void update_times(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment