[PATCH 3/8] cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/ldt.c

From: Mike Travis
Date: Tue Jul 15 2008 - 17:15:34 EST


* Optimize various places where a pointer to the cpumask_of_cpu value
will result in reducing stack pressure.

Based on linux-2.6.tip/master at the following commit:

commit 0a91813e16ebd5c2d9b5c2acd5b7c91742112c4f
Merge: 9a635fa... 724dce0...
Author: Ingo Molnar <mingo@xxxxxxx>
Date: Tue Jul 15 14:55:17 2008 +0200

Signed-off-by: Mike Travis <travis@xxxxxxx>
---
arch/x86/kernel/ldt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.tip.orig/arch/x86/kernel/ldt.c
+++ linux-2.6.tip/arch/x86/kernel/ldt.c
@@ -62,12 +62,12 @@ static int alloc_ldt(mm_context_t *pc, i

if (reload) {
#ifdef CONFIG_SMP
- cpumask_t mask;
+ cpumask_of_cpu_ptr_declare(mask);

preempt_disable();
load_LDT(pc);
- mask = cpumask_of_cpu(smp_processor_id());
- if (!cpus_equal(current->mm->cpu_vm_mask, mask))
+ cpumask_of_cpu_ptr_next(mask, smp_processor_id());
+ if (!cpus_equal(current->mm->cpu_vm_mask, *mask))
smp_call_function(flush_ldt, current->mm, 1);
preempt_enable();
#else

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/