]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cpumask: Optimize cpumask_of_cpu in kernel/time/tick-common.c
authorMike Travis <travis@sgi.com>
Tue, 15 Jul 2008 21:14:34 +0000 (14:14 -0700)
committerIngo Molnar <mingo@elte.hu>
Fri, 18 Jul 2008 20:02:59 +0000 (22:02 +0200)
  * Optimize various places where a pointer to the cpumask_of_cpu value
    will result in reducing stack pressure.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/time/tick-common.c

index 4f3886562b8cb919c48110cc8c198c65ea93e54a..bf43284d6855ad083319d653d1b0fbc3235dde08 100644 (file)
@@ -135,7 +135,7 @@ void tick_setup_periodic(struct clock_event_device *dev, int broadcast)
  */
 static void tick_setup_device(struct tick_device *td,
                              struct clock_event_device *newdev, int cpu,
-                             cpumask_t cpumask)
+                             const cpumask_t *cpumask)
 {
        ktime_t next_event;
        void (*handler)(struct clock_event_device *) = NULL;
@@ -169,8 +169,8 @@ static void tick_setup_device(struct tick_device *td,
         * When the device is not per cpu, pin the interrupt to the
         * current cpu:
         */
-       if (!cpus_equal(newdev->cpumask, cpumask))
-               irq_set_affinity(newdev->irq, cpumask);
+       if (!cpus_equal(newdev->cpumask, *cpumask))
+               irq_set_affinity(newdev->irq, *cpumask);
 
        /*
         * When global broadcasting is active, check if the current
@@ -196,20 +196,20 @@ static int tick_check_new_device(struct clock_event_device *newdev)
        struct tick_device *td;
        int cpu, ret = NOTIFY_OK;
        unsigned long flags;
-       cpumask_t cpumask;
+       cpumask_of_cpu_ptr_declare(cpumask);
 
        spin_lock_irqsave(&tick_device_lock, flags);
 
        cpu = smp_processor_id();
+       cpumask_of_cpu_ptr_next(cpumask, cpu);
        if (!cpu_isset(cpu, newdev->cpumask))
                goto out_bc;
 
        td = &per_cpu(tick_cpu_device, cpu);
        curdev = td->evtdev;
-       cpumask = cpumask_of_cpu(cpu);
 
        /* cpu local device ? */
-       if (!cpus_equal(newdev->cpumask, cpumask)) {
+       if (!cpus_equal(newdev->cpumask, *cpumask)) {
 
                /*
                 * If the cpu affinity of the device interrupt can not
@@ -222,7 +222,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)
                 * If we have a cpu local device already, do not replace it
                 * by a non cpu local device
                 */
-               if (curdev && cpus_equal(curdev->cpumask, cpumask))
+               if (curdev && cpus_equal(curdev->cpumask, *cpumask))
                        goto out_bc;
        }