x86: Do not free zero sized per cpu areas
[safe/jmp/linux-2.6] / kernel / timer.c
index a7352b0..fc965ea 100644 (file)
@@ -37,7 +37,7 @@
 #include <linux/delay.h>
 #include <linux/tick.h>
 #include <linux/kallsyms.h>
-#include <linux/perf_counter.h>
+#include <linux/perf_event.h>
 #include <linux/sched.h>
 
 #include <asm/uaccess.h>
@@ -656,8 +656,6 @@ __mod_timer(struct timer_list *timer, unsigned long expires,
 
        debug_activate(timer, expires);
 
-       new_base = __get_cpu_var(tvec_bases);
-
        cpu = smp_processor_id();
 
 #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
@@ -882,6 +880,7 @@ int try_to_del_timer_sync(struct timer_list *timer)
        if (base->running_timer == timer)
                goto out;
 
+       timer_stats_timer_clear_start_info(timer);
        ret = 0;
        if (timer_pending(timer)) {
                detach_timer(timer, 1);
@@ -1198,9 +1197,9 @@ void update_process_times(int user_tick)
        /* Note: this timer irq context must be accounted for as well. */
        account_process_tick(p, user_tick);
        run_local_timers();
-       if (rcu_pending(cpu))
-               rcu_check_callbacks(cpu, user_tick);
+       rcu_check_callbacks(cpu, user_tick);
        printk_tick();
+       perf_event_do_pending();
        scheduler_tick();
        run_posix_cpu_timers(p);
 }
@@ -1212,8 +1211,6 @@ static void run_timer_softirq(struct softirq_action *h)
 {
        struct tvec_base *base = __get_cpu_var(tvec_bases);
 
-       perf_counter_do_pending();
-
        hrtimer_run_pending();
 
        if (time_after_eq(jiffies, base->timer_jiffies))