Commit c18a41fbbc500ac0307ffd2b0ae73c2af9d0b0ab

Authored by Mike Travis
Committed by Ingo Molnar
1 parent 333cdd1f0e

cpumask: Optimize cpumask_of_cpu in kernel/time/tick-common.c

* 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>

Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff

kernel/time/tick-common.c
... ... @@ -135,7 +135,7 @@
135 135 */
136 136 static void tick_setup_device(struct tick_device *td,
137 137 struct clock_event_device *newdev, int cpu,
138   - cpumask_t cpumask)
  138 + const cpumask_t *cpumask)
139 139 {
140 140 ktime_t next_event;
141 141 void (*handler)(struct clock_event_device *) = NULL;
... ... @@ -169,8 +169,8 @@
169 169 * When the device is not per cpu, pin the interrupt to the
170 170 * current cpu:
171 171 */
172   - if (!cpus_equal(newdev->cpumask, cpumask))
173   - irq_set_affinity(newdev->irq, cpumask);
  172 + if (!cpus_equal(newdev->cpumask, *cpumask))
  173 + irq_set_affinity(newdev->irq, *cpumask);
174 174  
175 175 /*
176 176 * When global broadcasting is active, check if the current
177 177  
178 178  
179 179  
... ... @@ -196,20 +196,20 @@
196 196 struct tick_device *td;
197 197 int cpu, ret = NOTIFY_OK;
198 198 unsigned long flags;
199   - cpumask_t cpumask;
  199 + cpumask_of_cpu_ptr_declare(cpumask);
200 200  
201 201 spin_lock_irqsave(&tick_device_lock, flags);
202 202  
203 203 cpu = smp_processor_id();
  204 + cpumask_of_cpu_ptr_next(cpumask, cpu);
204 205 if (!cpu_isset(cpu, newdev->cpumask))
205 206 goto out_bc;
206 207  
207 208 td = &per_cpu(tick_cpu_device, cpu);
208 209 curdev = td->evtdev;
209   - cpumask = cpumask_of_cpu(cpu);
210 210  
211 211 /* cpu local device ? */
212   - if (!cpus_equal(newdev->cpumask, cpumask)) {
  212 + if (!cpus_equal(newdev->cpumask, *cpumask)) {
213 213  
214 214 /*
215 215 * If the cpu affinity of the device interrupt can not
... ... @@ -222,7 +222,7 @@
222 222 * If we have a cpu local device already, do not replace it
223 223 * by a non cpu local device
224 224 */
225   - if (curdev && cpus_equal(curdev->cpumask, cpumask))
  225 + if (curdev && cpus_equal(curdev->cpumask, *cpumask))
226 226 goto out_bc;
227 227 }
228 228