Commit 4755b9291204982ac908e069674d6e5eb45815b3

Authored by Mike Travis
Committed by Ingo Molnar
1 parent c18a41fbbc

cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.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 3 additions and 3 deletions Side-by-side Diff

lib/smp_processor_id.c
... ... @@ -11,7 +11,7 @@
11 11 {
12 12 unsigned long preempt_count = preempt_count();
13 13 int this_cpu = raw_smp_processor_id();
14   - cpumask_t this_mask;
  14 + cpumask_of_cpu_ptr_declare(this_mask);
15 15  
16 16 if (likely(preempt_count))
17 17 goto out;
18 18  
... ... @@ -23,9 +23,9 @@
23 23 * Kernel threads bound to a single CPU can safely use
24 24 * smp_processor_id():
25 25 */
26   - this_mask = cpumask_of_cpu(this_cpu);
  26 + cpumask_of_cpu_ptr_next(this_mask, cpu);
27 27  
28   - if (cpus_equal(current->cpus_allowed, this_mask))
  28 + if (cpus_equal(current->cpus_allowed, *this_mask))
29 29 goto out;
30 30  
31 31 /*