From: Andrew Morton Signed-off-by: Andrew Morton --- arch/i386/kernel/apic.c | 2 - include/linux/hrtimer.h | 7 ---- kernel/hrtimer.c | 53 +++++++---------------------------- kernel/time/tick-oneshot.c | 13 -------- kernel/time/timer_list.c | 23 --------------- 5 files changed, 14 insertions(+), 84 deletions(-) diff -puN arch/i386/kernel/apic.c~revert-mm-only-hrtimers-debug-patch arch/i386/kernel/apic.c --- a/arch/i386/kernel/apic.c~revert-mm-only-hrtimers-debug-patch +++ a/arch/i386/kernel/apic.c @@ -525,8 +525,6 @@ void __init setup_boot_APIC_clock(void) */ if (nmi_watchdog != NMI_IO_APIC) lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY; - else - printk(KERN_WARNING "APIC timer registered as dummy, due to nmi_watchdog=1!\n"); } /* Setup the lapic or request the broadcast */ diff -puN include/linux/hrtimer.h~revert-mm-only-hrtimers-debug-patch include/linux/hrtimer.h --- a/include/linux/hrtimer.h~revert-mm-only-hrtimers-debug-patch +++ a/include/linux/hrtimer.h @@ -15,7 +15,6 @@ #ifndef _LINUX_HRTIMER_H #define _LINUX_HRTIMER_H -#include #include #include #include @@ -197,12 +196,6 @@ struct hrtimer_cpu_base { struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; #ifdef CONFIG_HIGH_RES_TIMERS ktime_t expires_next; -# define HRTIMERS_STACK_TRACE_DEPTH 32 -# ifdef CONFIG_STACKTRACE - struct stack_trace exp_trace; - unsigned long exp_entries[HRTIMERS_STACK_TRACE_DEPTH]; -# endif - ktime_t exp_prev; int hres_active; struct list_head cb_pending; unsigned long nr_events; diff -puN kernel/hrtimer.c~revert-mm-only-hrtimers-debug-patch kernel/hrtimer.c --- a/kernel/hrtimer.c~revert-mm-only-hrtimers-debug-patch +++ a/kernel/hrtimer.c @@ -305,26 +305,6 @@ unsigned long ktime_divns(const ktime_t /* High resolution timer related functions */ #ifdef CONFIG_HIGH_RES_TIMERS -static void update_cpu_base_expires_next(struct hrtimer_cpu_base *cpu_base, - ktime_t expires_next) -{ - cpu_base->exp_prev = cpu_base->expires_next; - cpu_base->expires_next = expires_next; - -#ifdef CONFIG_STACKTRACE - { - struct stack_trace *trace = &cpu_base->exp_trace; - - trace->nr_entries = 0; - trace->entries = cpu_base->exp_entries; - trace->max_entries = HRTIMERS_STACK_TRACE_DEPTH; - trace->skip = 1; - - save_stack_trace(trace); - } -#endif -} - /* * High resolution timer enabled ? */ @@ -373,7 +353,7 @@ static void hrtimer_force_reprogram(stru struct hrtimer_clock_base *base = cpu_base->clock_base; ktime_t expires; - update_cpu_base_expires_next(cpu_base, (ktime_t){ .tv64 = KTIME_MAX }); + cpu_base->expires_next.tv64 = KTIME_MAX; for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++, base++) { struct hrtimer *timer; @@ -383,7 +363,7 @@ static void hrtimer_force_reprogram(stru timer = rb_entry(base->first, struct hrtimer, node); expires = ktime_sub(timer->expires, base->offset); if (expires.tv64 < cpu_base->expires_next.tv64) - update_cpu_base_expires_next(cpu_base, expires); + cpu_base->expires_next = expires; } if (cpu_base->expires_next.tv64 != KTIME_MAX) @@ -402,7 +382,7 @@ static void hrtimer_force_reprogram(stru static int hrtimer_reprogram(struct hrtimer *timer, struct hrtimer_clock_base *base) { - struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); + ktime_t *expires_next = &__get_cpu_var(hrtimer_bases).expires_next; ktime_t expires = ktime_sub(timer->expires, base->offset); int res; @@ -416,7 +396,7 @@ static int hrtimer_reprogram(struct hrti if (hrtimer_callback_running(timer)) return 0; - if (expires.tv64 >= cpu_base->expires_next.tv64) + if (expires.tv64 >= expires_next->tv64) return 0; /* @@ -424,7 +404,7 @@ static int hrtimer_reprogram(struct hrti */ res = tick_program_event(expires, 0); if (!IS_ERR_VALUE(res)) - update_cpu_base_expires_next(cpu_base, expires); + *expires_next = expires; return res; } @@ -499,7 +479,7 @@ static inline void hrtimer_remove_cb_pen */ static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) { - update_cpu_base_expires_next(base, (ktime_t){ .tv64 = KTIME_MAX }); + base->expires_next.tv64 = KTIME_MAX; base->hres_active = 0; INIT_LIST_HEAD(&base->cb_pending); } @@ -563,8 +543,7 @@ static inline int hrtimer_enqueue_reprog */ static int hrtimer_switch_to_hres(void) { - int cpu = smp_processor_id(); - struct hrtimer_cpu_base *base = &per_cpu(hrtimer_bases, cpu); + struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); unsigned long flags; if (base->hres_active) @@ -574,8 +553,6 @@ static int hrtimer_switch_to_hres(void) if (tick_init_highres()) { local_irq_restore(flags); - printk(KERN_WARNING "Could not switch to high resolution " - "mode on CPU %d\n", cpu); return 0; } base->hres_active = 1; @@ -690,7 +667,6 @@ static void enqueue_hrtimer(struct hrtim struct rb_node **link = &base->active.rb_node; struct rb_node *parent = NULL; struct hrtimer *entry; - int leftmost = 1; /* * Find the right place in the rbtree: @@ -702,19 +678,18 @@ static void enqueue_hrtimer(struct hrtim * We dont care about collisions. Nodes with * the same expiry time stay together. */ - if (timer->expires.tv64 < entry->expires.tv64) { + if (timer->expires.tv64 < entry->expires.tv64) link = &(*link)->rb_left; - } else { + else link = &(*link)->rb_right; - leftmost = 0; - } } /* * Insert the timer to the rbtree and check whether it * replaces the first pending timer */ - if (leftmost) { + if (!base->first || timer->expires.tv64 < + rb_entry(base->first, struct hrtimer, node)->expires.tv64) { /* * Reprogram the clock event device. When the timer is already * expired hrtimer_enqueue_reprogram has either called the @@ -731,9 +706,6 @@ static void enqueue_hrtimer(struct hrtim rb_link_node(&timer->node, parent, link); rb_insert_color(&timer->node, &base->active); - - WARN_ON(base->first != rb_first(&base->active)); - /* * HRTIMER_STATE_ENQUEUED is or'ed to the current state to preserve the * state of a possibly running callback. @@ -770,7 +742,6 @@ static void __remove_hrtimer(struct hrti hrtimer_force_reprogram(base->cpu_base); } rb_erase(&timer->node, &base->active); - WARN_ON(base->first != rb_first(&base->active)); } timer->state = newstate; } @@ -1087,7 +1058,7 @@ void hrtimer_interrupt(struct clock_even base++; } - update_cpu_base_expires_next(cpu_base, expires_next); + cpu_base->expires_next = expires_next; /* Reprogramming necessary ? */ if (expires_next.tv64 != KTIME_MAX) { diff -puN kernel/time/tick-oneshot.c~revert-mm-only-hrtimers-debug-patch kernel/time/tick-oneshot.c --- a/kernel/time/tick-oneshot.c~revert-mm-only-hrtimers-debug-patch +++ a/kernel/time/tick-oneshot.c @@ -73,19 +73,8 @@ int tick_switch_to_oneshot(void (*handle struct clock_event_device *dev = td->evtdev; if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT) || - !tick_device_is_functional(dev)) { - - printk("could not switch to one-shot clockevents mode.\n"); - if (!dev) { - printk("because no tick device\n"); - } else { - if (!(dev->features & CLOCK_EVT_FEAT_ONESHOT)) - printk("because %s does not support one-shot mode.\n", dev->name); - if (!tick_device_is_functional(dev)) - printk("because %s is not functional.\n", dev->name); - } + !tick_device_is_functional(dev)) return -EINVAL; - } td->mode = TICKDEV_MODE_ONESHOT; dev->event_handler = handler; diff -puN kernel/time/timer_list.c~revert-mm-only-hrtimers-debug-patch kernel/time/timer_list.c --- a/kernel/time/timer_list.c~revert-mm-only-hrtimers-debug-patch +++ a/kernel/time/timer_list.c @@ -46,7 +46,7 @@ static void print_name_offset(struct seq sym_name = kallsyms_lookup(addr, &size, &offset, &modname, namebuf); if (sym_name) - SEQ_printf(m, "%s+%lx/%lx", sym_name, offset, size); + SEQ_printf(m, "%s", sym_name); else SEQ_printf(m, "<%p>", sym); } @@ -129,25 +129,6 @@ print_base(struct seq_file *m, struct hr print_active_timers(m, base, now); } -#ifdef CONFIG_HIGH_RES_TIMERS -static void print_cpu_base_stack_trace(struct seq_file *m, - struct hrtimer_cpu_base *cpu_base) -{ -#ifdef CONFIG_STACKTRACE - struct stack_trace *trace = &cpu_base->exp_trace; - int i; - - SEQ_printf(m, " last expires_next stacktrace:\n"); - for (i = 0; i < trace->nr_entries; i++) { - SEQ_printf(m, " "); - print_name_offset(m, (void *)trace->entries[i]); - SEQ_printf(m, "\n"); - } - SEQ_printf(m, "\n"); -#endif -} -#endif - static void print_cpu(struct seq_file *m, int cpu, u64 now) { struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu); @@ -166,8 +147,6 @@ static void print_cpu(struct seq_file *m #ifdef CONFIG_HIGH_RES_TIMERS P_ns(expires_next); - P_ns(exp_prev); - print_cpu_base_stack_trace(m, cpu_base); P(hres_active); P(nr_events); #endif _