aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-04 14:25:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-04 14:25:31 -0400
commitc22072bdf053b115a1126658100967dda00b5ecf (patch)
tree21520119dbbfce237a5005e9840105e86944c9cc /kernel
parent0640113be25d283e0ff77a9f041e1242182387f0 (diff)
parent62cf20b32aee4ae889a2eb40fd41c0eab73de970 (diff)
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
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/clockevents.c3
-rw-r--r--kernel/time/tick-sched.c18
2 files changed, 19 insertions, 2 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 9cd928f7a7c6..7e1ce012a851 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -297,8 +297,7 @@ void clockevents_register_device(struct clock_event_device *dev)
297} 297}
298EXPORT_SYMBOL_GPL(clockevents_register_device); 298EXPORT_SYMBOL_GPL(clockevents_register_device);
299 299
300static void clockevents_config(struct clock_event_device *dev, 300void clockevents_config(struct clock_event_device *dev, u32 freq)
301 u32 freq)
302{ 301{
303 u64 sec; 302 u64 sec;
304 303
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 6a3a5b9ff561..efd386667536 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -814,6 +814,16 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer)
814 return HRTIMER_RESTART; 814 return HRTIMER_RESTART;
815} 815}
816 816
817static int sched_skew_tick;
818
819static int __init skew_tick(char *str)
820{
821 get_option(&str, &sched_skew_tick);
822
823 return 0;
824}
825early_param("skew_tick", skew_tick);
826
817/** 827/**
818 * tick_setup_sched_timer - setup the tick emulation timer 828 * tick_setup_sched_timer - setup the tick emulation timer
819 */ 829 */
@@ -831,6 +841,14 @@ void tick_setup_sched_timer(void)
831 /* Get the next period (per cpu) */ 841 /* Get the next period (per cpu) */
832 hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); 842 hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update());
833 843
844 /* Offset the tick to avert xtime_lock contention. */
845 if (sched_skew_tick) {
846 u64 offset = ktime_to_ns(tick_period) >> 1;
847 do_div(offset, num_possible_cpus());
848 offset *= smp_processor_id();
849 hrtimer_add_expires_ns(&ts->sched_timer, offset);
850 }
851
834 for (;;) { 852 for (;;) {
835 hrtimer_forward(&ts->sched_timer, now, tick_period); 853 hrtimer_forward(&ts->sched_timer, now, tick_period);
836 hrtimer_start_expires(&ts->sched_timer, 854 hrtimer_start_expires(&ts->sched_timer,