diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 21:46:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 21:46:12 -0400 |
commit | d3d52d687a770973b459d8a92ec1adbba3f60c4b (patch) | |
tree | 94318a62f25b970d604e29a9b8554afe82932d16 /arch/sparc/kernel/smp_32.c | |
parent | d17abcd5417d84cfa8a225160481203a37dc81d4 (diff) | |
parent | ed223129a30de7d244ca9b59819f5532c9caf039 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: Fix reset hangs on Niagara systems.
cpumask: use mm_cpumask() wrapper: sparc
cpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL.: sparc
cpumask: remove the now-obsoleted pcibus_to_cpumask(): sparc
cpumask: remove cpu_coregroup_map: sparc
cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.: sparc
cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.: sparc64
cpumask: Use accessors code.: sparc64
cpumask: Use accessors code: sparc
cpumask: arch_send_call_function_ipi_mask: sparc
cpumask: Use smp_call_function_many(): sparc64
Diffstat (limited to 'arch/sparc/kernel/smp_32.c')
-rw-r--r-- | arch/sparc/kernel/smp_32.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c index 1e5ac4e282e1..132d81fb2616 100644 --- a/arch/sparc/kernel/smp_32.c +++ b/arch/sparc/kernel/smp_32.c | |||
@@ -70,13 +70,12 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
70 | extern void smp4m_smp_done(void); | 70 | extern void smp4m_smp_done(void); |
71 | extern void smp4d_smp_done(void); | 71 | extern void smp4d_smp_done(void); |
72 | unsigned long bogosum = 0; | 72 | unsigned long bogosum = 0; |
73 | int cpu, num; | 73 | int cpu, num = 0; |
74 | 74 | ||
75 | for (cpu = 0, num = 0; cpu < NR_CPUS; cpu++) | 75 | for_each_online_cpu(cpu) { |
76 | if (cpu_online(cpu)) { | 76 | num++; |
77 | num++; | 77 | bogosum += cpu_data(cpu).udelay_val; |
78 | bogosum += cpu_data(cpu).udelay_val; | 78 | } |
79 | } | ||
80 | 79 | ||
81 | printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n", | 80 | printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n", |
82 | num, bogosum/(500000/HZ), | 81 | num, bogosum/(500000/HZ), |
@@ -144,7 +143,7 @@ void smp_flush_tlb_all(void) | |||
144 | void smp_flush_cache_mm(struct mm_struct *mm) | 143 | void smp_flush_cache_mm(struct mm_struct *mm) |
145 | { | 144 | { |
146 | if(mm->context != NO_CONTEXT) { | 145 | if(mm->context != NO_CONTEXT) { |
147 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 146 | cpumask_t cpu_mask = *mm_cpumask(mm); |
148 | cpu_clear(smp_processor_id(), cpu_mask); | 147 | cpu_clear(smp_processor_id(), cpu_mask); |
149 | if (!cpus_empty(cpu_mask)) | 148 | if (!cpus_empty(cpu_mask)) |
150 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); | 149 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); |
@@ -155,12 +154,13 @@ void smp_flush_cache_mm(struct mm_struct *mm) | |||
155 | void smp_flush_tlb_mm(struct mm_struct *mm) | 154 | void smp_flush_tlb_mm(struct mm_struct *mm) |
156 | { | 155 | { |
157 | if(mm->context != NO_CONTEXT) { | 156 | if(mm->context != NO_CONTEXT) { |
158 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 157 | cpumask_t cpu_mask = *mm_cpumask(mm); |
159 | cpu_clear(smp_processor_id(), cpu_mask); | 158 | cpu_clear(smp_processor_id(), cpu_mask); |
160 | if (!cpus_empty(cpu_mask)) { | 159 | if (!cpus_empty(cpu_mask)) { |
161 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); | 160 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); |
162 | if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) | 161 | if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) |
163 | mm->cpu_vm_mask = cpumask_of_cpu(smp_processor_id()); | 162 | cpumask_copy(mm_cpumask(mm), |
163 | cpumask_of(smp_processor_id())); | ||
164 | } | 164 | } |
165 | local_flush_tlb_mm(mm); | 165 | local_flush_tlb_mm(mm); |
166 | } | 166 | } |
@@ -172,7 +172,7 @@ void smp_flush_cache_range(struct vm_area_struct *vma, unsigned long start, | |||
172 | struct mm_struct *mm = vma->vm_mm; | 172 | struct mm_struct *mm = vma->vm_mm; |
173 | 173 | ||
174 | if (mm->context != NO_CONTEXT) { | 174 | if (mm->context != NO_CONTEXT) { |
175 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 175 | cpumask_t cpu_mask = *mm_cpumask(mm); |
176 | cpu_clear(smp_processor_id(), cpu_mask); | 176 | cpu_clear(smp_processor_id(), cpu_mask); |
177 | if (!cpus_empty(cpu_mask)) | 177 | if (!cpus_empty(cpu_mask)) |
178 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); | 178 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); |
@@ -186,7 +186,7 @@ void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | |||
186 | struct mm_struct *mm = vma->vm_mm; | 186 | struct mm_struct *mm = vma->vm_mm; |
187 | 187 | ||
188 | if (mm->context != NO_CONTEXT) { | 188 | if (mm->context != NO_CONTEXT) { |
189 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 189 | cpumask_t cpu_mask = *mm_cpumask(mm); |
190 | cpu_clear(smp_processor_id(), cpu_mask); | 190 | cpu_clear(smp_processor_id(), cpu_mask); |
191 | if (!cpus_empty(cpu_mask)) | 191 | if (!cpus_empty(cpu_mask)) |
192 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); | 192 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); |
@@ -199,7 +199,7 @@ void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page) | |||
199 | struct mm_struct *mm = vma->vm_mm; | 199 | struct mm_struct *mm = vma->vm_mm; |
200 | 200 | ||
201 | if(mm->context != NO_CONTEXT) { | 201 | if(mm->context != NO_CONTEXT) { |
202 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 202 | cpumask_t cpu_mask = *mm_cpumask(mm); |
203 | cpu_clear(smp_processor_id(), cpu_mask); | 203 | cpu_clear(smp_processor_id(), cpu_mask); |
204 | if (!cpus_empty(cpu_mask)) | 204 | if (!cpus_empty(cpu_mask)) |
205 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); | 205 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); |
@@ -212,7 +212,7 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | |||
212 | struct mm_struct *mm = vma->vm_mm; | 212 | struct mm_struct *mm = vma->vm_mm; |
213 | 213 | ||
214 | if(mm->context != NO_CONTEXT) { | 214 | if(mm->context != NO_CONTEXT) { |
215 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 215 | cpumask_t cpu_mask = *mm_cpumask(mm); |
216 | cpu_clear(smp_processor_id(), cpu_mask); | 216 | cpu_clear(smp_processor_id(), cpu_mask); |
217 | if (!cpus_empty(cpu_mask)) | 217 | if (!cpus_empty(cpu_mask)) |
218 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); | 218 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); |
@@ -241,7 +241,7 @@ void smp_flush_page_to_ram(unsigned long page) | |||
241 | 241 | ||
242 | void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) | 242 | void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) |
243 | { | 243 | { |
244 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 244 | cpumask_t cpu_mask = *mm_cpumask(mm); |
245 | cpu_clear(smp_processor_id(), cpu_mask); | 245 | cpu_clear(smp_processor_id(), cpu_mask); |
246 | if (!cpus_empty(cpu_mask)) | 246 | if (!cpus_empty(cpu_mask)) |
247 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); | 247 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); |
@@ -332,8 +332,8 @@ void __init smp_setup_cpu_possible_map(void) | |||
332 | instance = 0; | 332 | instance = 0; |
333 | while (!cpu_find_by_instance(instance, NULL, &mid)) { | 333 | while (!cpu_find_by_instance(instance, NULL, &mid)) { |
334 | if (mid < NR_CPUS) { | 334 | if (mid < NR_CPUS) { |
335 | cpu_set(mid, cpu_possible_map); | 335 | set_cpu_possible(mid, true); |
336 | cpu_set(mid, cpu_present_map); | 336 | set_cpu_present(mid, true); |
337 | } | 337 | } |
338 | instance++; | 338 | instance++; |
339 | } | 339 | } |
@@ -351,8 +351,8 @@ void __init smp_prepare_boot_cpu(void) | |||
351 | printk("boot cpu id != 0, this could work but is untested\n"); | 351 | printk("boot cpu id != 0, this could work but is untested\n"); |
352 | 352 | ||
353 | current_thread_info()->cpu = cpuid; | 353 | current_thread_info()->cpu = cpuid; |
354 | cpu_set(cpuid, cpu_online_map); | 354 | set_cpu_online(cpuid, true); |
355 | cpu_set(cpuid, cpu_possible_map); | 355 | set_cpu_possible(cpuid, true); |
356 | } | 356 | } |
357 | 357 | ||
358 | int __cpuinit __cpu_up(unsigned int cpu) | 358 | int __cpuinit __cpu_up(unsigned int cpu) |