aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
commit0429fbc0bdc297d64188483ba029a23773ae07b0 (patch)
tree67de46978c90f37540dd6ded1db20eb53a569030 /arch/ia64/sn
parent6929c358972facf2999f8768815c40dd88514fc2 (diff)
parent513d1a2884a49654f368b5fa25ef186e976bdada (diff)
Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull percpu consistent-ops changes from Tejun Heo: "Way back, before the current percpu allocator was implemented, static and dynamic percpu memory areas were allocated and handled separately and had their own accessors. The distinction has been gone for many years now; however, the now duplicate two sets of accessors remained with the pointer based ones - this_cpu_*() - evolving various other operations over time. During the process, we also accumulated other inconsistent operations. This pull request contains Christoph's patches to clean up the duplicate accessor situation. __get_cpu_var() uses are replaced with with this_cpu_ptr() and __this_cpu_ptr() with raw_cpu_ptr(). Unfortunately, the former sometimes is tricky thanks to C being a bit messy with the distinction between lvalues and pointers, which led to a rather ugly solution for cpumask_var_t involving the introduction of this_cpu_cpumask_var_ptr(). This converts most of the uses but not all. Christoph will follow up with the remaining conversions in this merge window and hopefully remove the obsolete accessors" * 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (38 commits) irqchip: Properly fetch the per cpu offset percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t -fix ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write. percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t Revert "powerpc: Replace __get_cpu_var uses" percpu: Remove __this_cpu_ptr clocksource: Replace __this_cpu_ptr with raw_cpu_ptr sparc: Replace __get_cpu_var uses avr32: Replace __get_cpu_var with __this_cpu_write blackfin: Replace __get_cpu_var uses tile: Use this_cpu_ptr() for hardware counters tile: Replace __get_cpu_var uses powerpc: Replace __get_cpu_var uses alpha: Replace __get_cpu_var ia64: Replace __get_cpu_var uses s390: cio driver &__get_cpu_var replacements s390: Replace __get_cpu_var uses mips: Replace __get_cpu_var uses MIPS: Replace __get_cpu_var uses in FPU emulator. arm: Replace __this_cpu_ptr with raw_cpu_ptr ...
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c28
2 files changed, 15 insertions, 15 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 36182c84363c..5f6b6b48c1d5 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -629,7 +629,7 @@ void sn_cpu_init(void)
629 629
630 cnode = nasid_to_cnodeid(nasid); 630 cnode = nasid_to_cnodeid(nasid);
631 631
632 sn_nodepda = nodepdaindr[cnode]; 632 __this_cpu_write(__sn_nodepda, nodepdaindr[cnode]);
633 633
634 pda->led_address = 634 pda->led_address =
635 (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); 635 (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT));
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 68c845411624..f9c8d9fc5939 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -134,8 +134,8 @@ sn2_ipi_flush_all_tlb(struct mm_struct *mm)
134 itc = ia64_get_itc(); 134 itc = ia64_get_itc();
135 smp_flush_tlb_cpumask(*mm_cpumask(mm)); 135 smp_flush_tlb_cpumask(*mm_cpumask(mm));
136 itc = ia64_get_itc() - itc; 136 itc = ia64_get_itc() - itc;
137 __get_cpu_var(ptcstats).shub_ipi_flushes_itc_clocks += itc; 137 __this_cpu_add(ptcstats.shub_ipi_flushes_itc_clocks, itc);
138 __get_cpu_var(ptcstats).shub_ipi_flushes++; 138 __this_cpu_inc(ptcstats.shub_ipi_flushes);
139} 139}
140 140
141/** 141/**
@@ -199,14 +199,14 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
199 start += (1UL << nbits); 199 start += (1UL << nbits);
200 } while (start < end); 200 } while (start < end);
201 ia64_srlz_i(); 201 ia64_srlz_i();
202 __get_cpu_var(ptcstats).ptc_l++; 202 __this_cpu_inc(ptcstats.ptc_l);
203 preempt_enable(); 203 preempt_enable();
204 return; 204 return;
205 } 205 }
206 206
207 if (atomic_read(&mm->mm_users) == 1 && mymm) { 207 if (atomic_read(&mm->mm_users) == 1 && mymm) {
208 flush_tlb_mm(mm); 208 flush_tlb_mm(mm);
209 __get_cpu_var(ptcstats).change_rid++; 209 __this_cpu_inc(ptcstats.change_rid);
210 preempt_enable(); 210 preempt_enable();
211 return; 211 return;
212 } 212 }
@@ -250,11 +250,11 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
250 spin_lock_irqsave(PTC_LOCK(shub1), flags); 250 spin_lock_irqsave(PTC_LOCK(shub1), flags);
251 itc2 = ia64_get_itc(); 251 itc2 = ia64_get_itc();
252 252
253 __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc; 253 __this_cpu_add(ptcstats.lock_itc_clocks, itc2 - itc);
254 __get_cpu_var(ptcstats).shub_ptc_flushes++; 254 __this_cpu_inc(ptcstats.shub_ptc_flushes);
255 __get_cpu_var(ptcstats).nodes_flushed += nix; 255 __this_cpu_add(ptcstats.nodes_flushed, nix);
256 if (!mymm) 256 if (!mymm)
257 __get_cpu_var(ptcstats).shub_ptc_flushes_not_my_mm++; 257 __this_cpu_inc(ptcstats.shub_ptc_flushes_not_my_mm);
258 258
259 if (use_cpu_ptcga && !mymm) { 259 if (use_cpu_ptcga && !mymm) {
260 old_rr = ia64_get_rr(start); 260 old_rr = ia64_get_rr(start);
@@ -299,9 +299,9 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
299 299
300done: 300done:
301 itc2 = ia64_get_itc() - itc2; 301 itc2 = ia64_get_itc() - itc2;
302 __get_cpu_var(ptcstats).shub_itc_clocks += itc2; 302 __this_cpu_add(ptcstats.shub_itc_clocks, itc2);
303 if (itc2 > __get_cpu_var(ptcstats).shub_itc_clocks_max) 303 if (itc2 > __this_cpu_read(ptcstats.shub_itc_clocks_max))
304 __get_cpu_var(ptcstats).shub_itc_clocks_max = itc2; 304 __this_cpu_write(ptcstats.shub_itc_clocks_max, itc2);
305 305
306 if (old_rr) { 306 if (old_rr) {
307 ia64_set_rr(start, old_rr); 307 ia64_set_rr(start, old_rr);
@@ -311,7 +311,7 @@ done:
311 spin_unlock_irqrestore(PTC_LOCK(shub1), flags); 311 spin_unlock_irqrestore(PTC_LOCK(shub1), flags);
312 312
313 if (flush_opt == 1 && deadlock) { 313 if (flush_opt == 1 && deadlock) {
314 __get_cpu_var(ptcstats).deadlocks++; 314 __this_cpu_inc(ptcstats.deadlocks);
315 sn2_ipi_flush_all_tlb(mm); 315 sn2_ipi_flush_all_tlb(mm);
316 } 316 }
317 317
@@ -334,7 +334,7 @@ sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid,
334 short nasid, i; 334 short nasid, i;
335 unsigned long *piows, zeroval, n; 335 unsigned long *piows, zeroval, n;
336 336
337 __get_cpu_var(ptcstats).deadlocks++; 337 __this_cpu_inc(ptcstats.deadlocks);
338 338
339 piows = (unsigned long *) pda->pio_write_status_addr; 339 piows = (unsigned long *) pda->pio_write_status_addr;
340 zeroval = pda->pio_write_status_val; 340 zeroval = pda->pio_write_status_val;
@@ -349,7 +349,7 @@ sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid,
349 ptc1 = CHANGE_NASID(nasid, ptc1); 349 ptc1 = CHANGE_NASID(nasid, ptc1);
350 350
351 n = sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval); 351 n = sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval);
352 __get_cpu_var(ptcstats).deadlocks2 += n; 352 __this_cpu_add(ptcstats.deadlocks2, n);
353 } 353 }
354 354
355} 355}