diff options
author | Mike Travis <travis@sgi.com> | 2008-12-16 20:34:05 -0500 |
---|---|---|
committer | Mike Travis <travis@sgi.com> | 2008-12-16 20:40:59 -0500 |
commit | e4d98207ea3f3d15eb664282df16d18c4ac86f80 (patch) | |
tree | c0534e71940014158123a320ea0d65d6810e1818 | |
parent | 4cd4601d592d07b26e4b7d2bb8fcd55bbfd6cf6e (diff) |
x86: xen: use smp_call_function_many()
Impact: use new API, remove cpumask from stack.
Change smp_call_function_mask() callers to smp_call_function_many().
This removes a cpumask from the stack, and falls back should allocating
the cpumask var fail (only possible with CONFIG_CPUMASKS_OFFSTACK).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: jeremy@xensource.com
-rw-r--r-- | arch/x86/xen/mmu.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 636ef4caa52d..e59e53b11e2b 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1079,7 +1079,7 @@ static void drop_other_mm_ref(void *info) | |||
1079 | 1079 | ||
1080 | static void xen_drop_mm_ref(struct mm_struct *mm) | 1080 | static void xen_drop_mm_ref(struct mm_struct *mm) |
1081 | { | 1081 | { |
1082 | cpumask_t mask; | 1082 | cpumask_var_t mask; |
1083 | unsigned cpu; | 1083 | unsigned cpu; |
1084 | 1084 | ||
1085 | if (current->active_mm == mm) { | 1085 | if (current->active_mm == mm) { |
@@ -1091,7 +1091,16 @@ static void xen_drop_mm_ref(struct mm_struct *mm) | |||
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | /* Get the "official" set of cpus referring to our pagetable. */ | 1093 | /* Get the "official" set of cpus referring to our pagetable. */ |
1094 | mask = mm->cpu_vm_mask; | 1094 | if (!alloc_cpumask_var(&mask, GFP_ATOMIC)) { |
1095 | for_each_online_cpu(cpu) { | ||
1096 | if (!cpumask_test_cpu(cpu, &mm->cpu_vm_mask) | ||
1097 | && per_cpu(xen_current_cr3, cpu) != __pa(mm->pgd)) | ||
1098 | continue; | ||
1099 | smp_call_function_single(cpu, drop_other_mm_ref, mm, 1); | ||
1100 | } | ||
1101 | return; | ||
1102 | } | ||
1103 | cpumask_copy(mask, &mm->cpu_vm_mask); | ||
1095 | 1104 | ||
1096 | /* It's possible that a vcpu may have a stale reference to our | 1105 | /* It's possible that a vcpu may have a stale reference to our |
1097 | cr3, because its in lazy mode, and it hasn't yet flushed | 1106 | cr3, because its in lazy mode, and it hasn't yet flushed |
@@ -1100,11 +1109,12 @@ static void xen_drop_mm_ref(struct mm_struct *mm) | |||
1100 | if needed. */ | 1109 | if needed. */ |
1101 | for_each_online_cpu(cpu) { | 1110 | for_each_online_cpu(cpu) { |
1102 | if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd)) | 1111 | if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd)) |
1103 | cpu_set(cpu, mask); | 1112 | cpumask_set_cpu(cpu, mask); |
1104 | } | 1113 | } |
1105 | 1114 | ||
1106 | if (!cpus_empty(mask)) | 1115 | if (!cpumask_empty(mask)) |
1107 | smp_call_function_mask(mask, drop_other_mm_ref, mm, 1); | 1116 | smp_call_function_many(mask, drop_other_mm_ref, mm, 1); |
1117 | free_cpumask_var(mask); | ||
1108 | } | 1118 | } |
1109 | #else | 1119 | #else |
1110 | static void xen_drop_mm_ref(struct mm_struct *mm) | 1120 | static void xen_drop_mm_ref(struct mm_struct *mm) |