Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "The clocksource driver is pure hardware enablement and the skew option is default off, well tested and non dangerous." * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tick: Move skew_tick option into the HIGH_RES_TIMER section clocksource: em_sti: Add DT support clocksource: em_sti: Emma Mobile STI driver clockevents: Make clockevents_config() a global symbol tick: Add tick skew boot option
This commit is contained in:
@@ -297,8 +297,7 @@ void clockevents_register_device(struct clock_event_device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clockevents_register_device);
|
||||
|
||||
static void clockevents_config(struct clock_event_device *dev,
|
||||
u32 freq)
|
||||
void clockevents_config(struct clock_event_device *dev, u32 freq)
|
||||
{
|
||||
u64 sec;
|
||||
|
||||
|
@@ -814,6 +814,16 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer)
|
||||
return HRTIMER_RESTART;
|
||||
}
|
||||
|
||||
static int sched_skew_tick;
|
||||
|
||||
static int __init skew_tick(char *str)
|
||||
{
|
||||
get_option(&str, &sched_skew_tick);
|
||||
|
||||
return 0;
|
||||
}
|
||||
early_param("skew_tick", skew_tick);
|
||||
|
||||
/**
|
||||
* tick_setup_sched_timer - setup the tick emulation timer
|
||||
*/
|
||||
@@ -831,6 +841,14 @@ void tick_setup_sched_timer(void)
|
||||
/* Get the next period (per cpu) */
|
||||
hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update());
|
||||
|
||||
/* Offset the tick to avert xtime_lock contention. */
|
||||
if (sched_skew_tick) {
|
||||
u64 offset = ktime_to_ns(tick_period) >> 1;
|
||||
do_div(offset, num_possible_cpus());
|
||||
offset *= smp_processor_id();
|
||||
hrtimer_add_expires_ns(&ts->sched_timer, offset);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
hrtimer_forward(&ts->sched_timer, now, tick_period);
|
||||
hrtimer_start_expires(&ts->sched_timer,
|
||||
|
Reference in New Issue
Block a user