Skip to content

Commit dd17c8f

Browse files
rustyrussellhtejun
authored andcommitted
percpu: remove per_cpu__ prefix.
Now that the return from alloc_percpu is compatible with the address of per-cpu vars, it makes sense to hand around the address of per-cpu variables. To make this sane, we remove the per_cpu__ prefix we used created to stop people accidentally using these vars directly. Now we have sparse, we can use that (next patch). tj: * Updated to convert stuff which were missed by or added after the original patch. * Kill per_cpu_var() macro. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
1 parent 390dfd9 commit dd17c8f

24 files changed

Lines changed: 80 additions & 90 deletions

File tree

‎arch/blackfin/mach-common/entry.S‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,8 @@ ENDPROC(_resume)
835835

836836
ENTRY(_ret_from_exception)
837837
#ifdef CONFIG_IPIPE
838-
p2.l = _per_cpu__ipipe_percpu_domain;
839-
p2.h = _per_cpu__ipipe_percpu_domain;
838+
p2.l = _ipipe_percpu_domain;
839+
p2.h = _ipipe_percpu_domain;
840840
r0.l = _ipipe_root;
841841
r0.h = _ipipe_root;
842842
r2 = [p2];

‎arch/cris/arch-v10/kernel/entry.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ mmu_bus_fault:
358358
1: btstq 12, $r1 ; Refill?
359359
bpl 2f
360360
lsrq 24, $r1 ; Get PGD index (bit 24-31)
361-
move.d [per_cpu__current_pgd], $r0 ; PGD for the current process
361+
move.d [current_pgd], $r0 ; PGD for the current process
362362
move.d [$r0+$r1.d], $r0 ; Get PMD
363363
beq 2f
364364
nop

‎arch/cris/arch-v32/mm/mmu.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
#ifdef CONFIG_SMP
116116
move $s7, $acr ; PGD
117117
#else
118-
move.d per_cpu__current_pgd, $acr ; PGD
118+
move.d current_pgd, $acr ; PGD
119119
#endif
120120
; Look up PMD in PGD
121121
lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31)

‎arch/ia64/include/asm/percpu.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE
1010

1111
#ifdef __ASSEMBLY__
12-
# define THIS_CPU(var) (per_cpu__##var) /* use this to mark accesses to per-CPU variables... */
12+
# define THIS_CPU(var) (var) /* use this to mark accesses to per-CPU variables... */
1313
#else /* !__ASSEMBLY__ */
1414

1515

@@ -39,7 +39,7 @@ extern void *per_cpu_init(void);
3939
* On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
4040
* more efficient.
4141
*/
42-
#define __ia64_per_cpu_var(var) per_cpu__##var
42+
#define __ia64_per_cpu_var(var) var
4343

4444
#include <asm-generic/percpu.h>
4545

‎arch/ia64/kernel/ia64_ksyms.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic
3030
#endif
3131

3232
#include <asm/processor.h>
33-
EXPORT_SYMBOL(per_cpu__ia64_cpu_info);
33+
EXPORT_SYMBOL(ia64_cpu_info);
3434
#ifdef CONFIG_SMP
35-
EXPORT_SYMBOL(per_cpu__local_per_cpu_offset);
35+
EXPORT_SYMBOL(local_per_cpu_offset);
3636
#endif
3737

3838
#include <asm/uaccess.h>

‎arch/ia64/mm/discontig.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static void __init initialize_pernode_data(void)
459459
cpu = 0;
460460
node = node_cpuid[cpu].nid;
461461
cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
462-
((char *)&per_cpu__ia64_cpu_info - __per_cpu_start));
462+
((char *)&ia64_cpu_info - __per_cpu_start));
463463
cpu0_cpu_info->node_data = mem_data[node].node_data;
464464
}
465465
#endif /* CONFIG_SMP */

‎arch/microblaze/include/asm/entry.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* places
2222
*/
2323

24-
#define PER_CPU(var) per_cpu__##var
24+
#define PER_CPU(var) var
2525

2626
# ifndef __ASSEMBLY__
2727
DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */

‎arch/parisc/lib/fixup.S‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#endif
3737
/* t2 = &__per_cpu_offset[smp_processor_id()]; */
3838
LDREGX \t2(\t1),\t2
39-
addil LT%per_cpu__exception_data,%r27
40-
LDREG RT%per_cpu__exception_data(%r1),\t1
39+
addil LT%exception_data,%r27
40+
LDREG RT%exception_data(%r1),\t1
4141
/* t1 = &__get_cpu_var(exception_data) */
4242
add,l \t1,\t2,\t1
4343
/* t1 = t1->fault_ip */
@@ -46,8 +46,8 @@
4646
#else
4747
.macro get_fault_ip t1 t2
4848
/* t1 = &__get_cpu_var(exception_data) */
49-
addil LT%per_cpu__exception_data,%r27
50-
LDREG RT%per_cpu__exception_data(%r1),\t2
49+
addil LT%exception_data,%r27
50+
LDREG RT%exception_data(%r1),\t2
5151
/* t1 = t2->fault_ip */
5252
LDREG EXCDATA_IP(\t2), \t1
5353
.endm

‎arch/powerpc/platforms/pseries/hvCall.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
5555
/* calculate address of stat structure r4 = opcode */ \
5656
srdi r4,r4,2; /* index into array */ \
5757
mulli r4,r4,HCALL_STAT_SIZE; \
58-
LOAD_REG_ADDR(r7, per_cpu__hcall_stats); \
58+
LOAD_REG_ADDR(r7, hcall_stats); \
5959
add r4,r4,r7; \
6060
ld r7,PACA_DATA_OFFSET(r13); /* per cpu offset */ \
6161
add r4,r4,r7; \

‎arch/sparc/kernel/nmi.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
112112
touched = 1;
113113
}
114114
if (!touched && __get_cpu_var(last_irq_sum) == sum) {
115-
__this_cpu_inc(per_cpu_var(alert_counter));
116-
if (__this_cpu_read(per_cpu_var(alert_counter)) == 30 * nmi_hz)
115+
__this_cpu_inc(alert_counter);
116+
if (__this_cpu_read(alert_counter) == 30 * nmi_hz)
117117
die_nmi("BUG: NMI Watchdog detected LOCKUP",
118118
regs, panic_on_timeout);
119119
} else {
120120
__get_cpu_var(last_irq_sum) = sum;
121-
__this_cpu_write(per_cpu_var(alert_counter), 0);
121+
__this_cpu_write(alert_counter, 0);
122122
}
123123
if (__get_cpu_var(wd_enabled)) {
124124
write_pic(picl_value(nmi_hz));

0 commit comments

Comments
 (0)