]> git.karo-electronics.de Git - linux-beck.git/commitdiff
timer: Store cpu-number in struct tvec_base
authorViresh Kumar <viresh.kumar@linaro.org>
Sat, 21 Jun 2014 23:29:13 +0000 (01:29 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 23 Jun 2014 09:23:46 +0000 (11:23 +0200)
Timers are serviced by the tick. But when a timer is enqueued on a
dynticks target, we need to kick it in order to make it reconsider the
next tick to schedule to correctly handle the timer's expiring time.

Now while this kick is correctly performed for add_timer_on(), the
mod_timer*() family has been a bit neglected.

To prepare for fixing this, we need internal_add_timer() to be able to
resolve the CPU target associated to a timer's object 'base' so that the
kick can be centralized there.

This can't be passed as an argument as not all the callers know the CPU
number of a timer's base. So lets store it in the struct tvec_base to
resolve the CPU without much overhead. It is set once for good at every
CPU's first boot.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1403393357-2070-2-git-send-email-fweisbec@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/time/timer.c

index 3bb01a323b2a3e0ae9291271f4dc0322f01bfd80..9e5f4f25dcc03957da8b19960ce038a2a030a3e9 100644 (file)
@@ -82,6 +82,7 @@ struct tvec_base {
        unsigned long next_timer;
        unsigned long active_timers;
        unsigned long all_timers;
+       int cpu;
        struct tvec_root tv1;
        struct tvec tv2;
        struct tvec tv3;
@@ -1568,6 +1569,7 @@ static int init_timers_cpu(int cpu)
                }
                spin_lock_init(&base->lock);
                tvec_base_done[cpu] = 1;
+               base->cpu = cpu;
        } else {
                base = per_cpu(tvec_bases, cpu);
        }