diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 14:53:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 14:53:42 -0400 |
commit | 5129df03d0c44b2d5a5f9d7d52f3b079706b9a8f (patch) | |
tree | 799e309a7db032cb7abe9f0fa910c2989c3fdab5 | |
parent | 4d429480352c63db2228489f0db9fd381cdc3c9c (diff) | |
parent | 6988f20fe04e9ef3aea488cb8ab57fbeb78e12f0 (diff) |
Merge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
* 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
percpu: Unify input section names
percpu: Avoid extra NOP in percpu_cmpxchg16b_double
percpu: Cast away printk format warning
percpu: Always align percpu output section to PAGE_SIZE
Fix up fairly trivial conflict in arch/x86/include/asm/percpu.h as per Tejun
-rw-r--r-- | arch/alpha/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/blackfin/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/cris/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/frv/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/m32r/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/mn10300/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/s390/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/sh/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/tile/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/um/include/asm/common.lds.S | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/percpu.h | 7 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 61 | ||||
-rw-r--r-- | kernel/workqueue.c | 4 | ||||
-rw-r--r-- | mm/percpu.c | 6 |
21 files changed, 60 insertions, 52 deletions
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index 3d890a98a08b..f937ad123852 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S | |||
@@ -39,7 +39,7 @@ SECTIONS | |||
39 | __init_begin = ALIGN(PAGE_SIZE); | 39 | __init_begin = ALIGN(PAGE_SIZE); |
40 | INIT_TEXT_SECTION(PAGE_SIZE) | 40 | INIT_TEXT_SECTION(PAGE_SIZE) |
41 | INIT_DATA_SECTION(16) | 41 | INIT_DATA_SECTION(16) |
42 | PERCPU(L1_CACHE_BYTES, PAGE_SIZE) | 42 | PERCPU_SECTION(L1_CACHE_BYTES) |
43 | /* Align to THREAD_SIZE rather than PAGE_SIZE here so any padding page | 43 | /* Align to THREAD_SIZE rather than PAGE_SIZE here so any padding page |
44 | needed for the THREAD_SIZE aligned init_task gets freed after init */ | 44 | needed for the THREAD_SIZE aligned init_task gets freed after init */ |
45 | . = ALIGN(THREAD_SIZE); | 45 | . = ALIGN(THREAD_SIZE); |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index b4348e62ef06..e5287f21badc 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -82,7 +82,7 @@ SECTIONS | |||
82 | #endif | 82 | #endif |
83 | } | 83 | } |
84 | 84 | ||
85 | PERCPU(32, PAGE_SIZE) | 85 | PERCPU_SECTION(32) |
86 | 86 | ||
87 | #ifndef CONFIG_XIP_KERNEL | 87 | #ifndef CONFIG_XIP_KERNEL |
88 | . = ALIGN(PAGE_SIZE); | 88 | . = ALIGN(PAGE_SIZE); |
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 854fa49f1c3e..8d85c8c6f857 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S | |||
@@ -136,7 +136,7 @@ SECTIONS | |||
136 | 136 | ||
137 | . = ALIGN(16); | 137 | . = ALIGN(16); |
138 | INIT_DATA_SECTION(16) | 138 | INIT_DATA_SECTION(16) |
139 | PERCPU(32, PAGE_SIZE) | 139 | PERCPU_SECTION(32) |
140 | 140 | ||
141 | .exit.data : | 141 | .exit.data : |
142 | { | 142 | { |
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S index 728bbd9e7d4c..a6990cb0f098 100644 --- a/arch/cris/kernel/vmlinux.lds.S +++ b/arch/cris/kernel/vmlinux.lds.S | |||
@@ -102,7 +102,7 @@ SECTIONS | |||
102 | #endif | 102 | #endif |
103 | __vmlinux_end = .; /* Last address of the physical file. */ | 103 | __vmlinux_end = .; /* Last address of the physical file. */ |
104 | #ifdef CONFIG_ETRAX_ARCH_V32 | 104 | #ifdef CONFIG_ETRAX_ARCH_V32 |
105 | PERCPU(32, PAGE_SIZE) | 105 | PERCPU_SECTION(32) |
106 | 106 | ||
107 | .init.ramfs : { | 107 | .init.ramfs : { |
108 | INIT_RAM_FS | 108 | INIT_RAM_FS |
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S index 0daae8af5787..7e958d829ec9 100644 --- a/arch/frv/kernel/vmlinux.lds.S +++ b/arch/frv/kernel/vmlinux.lds.S | |||
@@ -37,7 +37,7 @@ SECTIONS | |||
37 | _einittext = .; | 37 | _einittext = .; |
38 | 38 | ||
39 | INIT_DATA_SECTION(8) | 39 | INIT_DATA_SECTION(8) |
40 | PERCPU(L1_CACHE_BYTES, 4096) | 40 | PERCPU_SECTION(L1_CACHE_BYTES) |
41 | 41 | ||
42 | . = ALIGN(PAGE_SIZE); | 42 | . = ALIGN(PAGE_SIZE); |
43 | __init_end = .; | 43 | __init_end = .; |
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S index cf95aec77460..018e4a711d79 100644 --- a/arch/m32r/kernel/vmlinux.lds.S +++ b/arch/m32r/kernel/vmlinux.lds.S | |||
@@ -54,7 +54,7 @@ SECTIONS | |||
54 | __init_begin = .; | 54 | __init_begin = .; |
55 | INIT_TEXT_SECTION(PAGE_SIZE) | 55 | INIT_TEXT_SECTION(PAGE_SIZE) |
56 | INIT_DATA_SECTION(16) | 56 | INIT_DATA_SECTION(16) |
57 | PERCPU(32, PAGE_SIZE) | 57 | PERCPU_SECTION(32) |
58 | . = ALIGN(PAGE_SIZE); | 58 | . = ALIGN(PAGE_SIZE); |
59 | __init_end = .; | 59 | __init_end = .; |
60 | /* freed after init ends here */ | 60 | /* freed after init ends here */ |
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 01af3876cf90..a81176f44c74 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S | |||
@@ -118,7 +118,7 @@ SECTIONS | |||
118 | EXIT_DATA | 118 | EXIT_DATA |
119 | } | 119 | } |
120 | 120 | ||
121 | PERCPU(1 << CONFIG_MIPS_L1_CACHE_SHIFT, PAGE_SIZE) | 121 | PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT) |
122 | . = ALIGN(PAGE_SIZE); | 122 | . = ALIGN(PAGE_SIZE); |
123 | __init_end = .; | 123 | __init_end = .; |
124 | /* freed after init ends here */ | 124 | /* freed after init ends here */ |
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S index 968bcd2cb022..6f702a6ab395 100644 --- a/arch/mn10300/kernel/vmlinux.lds.S +++ b/arch/mn10300/kernel/vmlinux.lds.S | |||
@@ -70,7 +70,7 @@ SECTIONS | |||
70 | .exit.text : { EXIT_TEXT; } | 70 | .exit.text : { EXIT_TEXT; } |
71 | .exit.data : { EXIT_DATA; } | 71 | .exit.data : { EXIT_DATA; } |
72 | 72 | ||
73 | PERCPU(32, PAGE_SIZE) | 73 | PERCPU_SECTION(32) |
74 | . = ALIGN(PAGE_SIZE); | 74 | . = ALIGN(PAGE_SIZE); |
75 | __init_end = .; | 75 | __init_end = .; |
76 | /* freed after init ends here */ | 76 | /* freed after init ends here */ |
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index e1a55849bfa7..fa6f2b8163e0 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S | |||
@@ -149,7 +149,7 @@ SECTIONS | |||
149 | EXIT_DATA | 149 | EXIT_DATA |
150 | } | 150 | } |
151 | 151 | ||
152 | PERCPU(L1_CACHE_BYTES, PAGE_SIZE) | 152 | PERCPU_SECTION(L1_CACHE_BYTES) |
153 | . = ALIGN(PAGE_SIZE); | 153 | . = ALIGN(PAGE_SIZE); |
154 | __init_end = .; | 154 | __init_end = .; |
155 | /* freed after init ends here */ | 155 | /* freed after init ends here */ |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index b9150f07d266..920276c0f6a1 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -160,7 +160,7 @@ SECTIONS | |||
160 | INIT_RAM_FS | 160 | INIT_RAM_FS |
161 | } | 161 | } |
162 | 162 | ||
163 | PERCPU(L1_CACHE_BYTES, PAGE_SIZE) | 163 | PERCPU_SECTION(L1_CACHE_BYTES) |
164 | 164 | ||
165 | . = ALIGN(8); | 165 | . = ALIGN(8); |
166 | .machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) { | 166 | .machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) { |
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 1bc18cdb525b..56fe6bc81fee 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S | |||
@@ -77,7 +77,7 @@ SECTIONS | |||
77 | . = ALIGN(PAGE_SIZE); | 77 | . = ALIGN(PAGE_SIZE); |
78 | INIT_DATA_SECTION(0x100) | 78 | INIT_DATA_SECTION(0x100) |
79 | 79 | ||
80 | PERCPU(0x100, PAGE_SIZE) | 80 | PERCPU_SECTION(0x100) |
81 | . = ALIGN(PAGE_SIZE); | 81 | . = ALIGN(PAGE_SIZE); |
82 | __init_end = .; /* freed after init ends here */ | 82 | __init_end = .; /* freed after init ends here */ |
83 | 83 | ||
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index af4d46187a79..731c10ce67b5 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S | |||
@@ -66,7 +66,7 @@ SECTIONS | |||
66 | __machvec_end = .; | 66 | __machvec_end = .; |
67 | } | 67 | } |
68 | 68 | ||
69 | PERCPU(L1_CACHE_BYTES, PAGE_SIZE) | 69 | PERCPU_SECTION(L1_CACHE_BYTES) |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * .exit.text is discarded at runtime, not link time, to deal with | 72 | * .exit.text is discarded at runtime, not link time, to deal with |
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index 92b557afe535..c0220759003e 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S | |||
@@ -108,7 +108,7 @@ SECTIONS | |||
108 | __sun4v_2insn_patch_end = .; | 108 | __sun4v_2insn_patch_end = .; |
109 | } | 109 | } |
110 | 110 | ||
111 | PERCPU(SMP_CACHE_BYTES, PAGE_SIZE) | 111 | PERCPU_SECTION(SMP_CACHE_BYTES) |
112 | 112 | ||
113 | . = ALIGN(PAGE_SIZE); | 113 | . = ALIGN(PAGE_SIZE); |
114 | __init_end = .; | 114 | __init_end = .; |
diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S index 38f64fafdc10..631f10de12fe 100644 --- a/arch/tile/kernel/vmlinux.lds.S +++ b/arch/tile/kernel/vmlinux.lds.S | |||
@@ -60,7 +60,7 @@ SECTIONS | |||
60 | . = ALIGN(PAGE_SIZE); | 60 | . = ALIGN(PAGE_SIZE); |
61 | VMLINUX_SYMBOL(_sinitdata) = .; | 61 | VMLINUX_SYMBOL(_sinitdata) = .; |
62 | INIT_DATA_SECTION(16) :data =0 | 62 | INIT_DATA_SECTION(16) :data =0 |
63 | PERCPU(L2_CACHE_BYTES, PAGE_SIZE) | 63 | PERCPU_SECTION(L2_CACHE_BYTES) |
64 | . = ALIGN(PAGE_SIZE); | 64 | . = ALIGN(PAGE_SIZE); |
65 | VMLINUX_SYMBOL(_einitdata) = .; | 65 | VMLINUX_SYMBOL(_einitdata) = .; |
66 | 66 | ||
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index 34bede8aad4a..4938de5512d2 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S | |||
@@ -42,7 +42,7 @@ | |||
42 | INIT_SETUP(0) | 42 | INIT_SETUP(0) |
43 | } | 43 | } |
44 | 44 | ||
45 | PERCPU(32, 32) | 45 | PERCPU_SECTION(32) |
46 | 46 | ||
47 | .initcall.init : { | 47 | .initcall.init : { |
48 | INIT_CALLS | 48 | INIT_CALLS |
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 53278b0dfdf6..a0a9779084d1 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h | |||
@@ -509,6 +509,11 @@ do { \ | |||
509 | * it in software. The address used in the cmpxchg16 instruction must be | 509 | * it in software. The address used in the cmpxchg16 instruction must be |
510 | * aligned to a 16 byte boundary. | 510 | * aligned to a 16 byte boundary. |
511 | */ | 511 | */ |
512 | #ifdef CONFIG_SMP | ||
513 | #define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP3 | ||
514 | #else | ||
515 | #define CMPXCHG16B_EMU_CALL "call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP2 | ||
516 | #endif | ||
512 | #define percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) \ | 517 | #define percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) \ |
513 | ({ \ | 518 | ({ \ |
514 | char __ret; \ | 519 | char __ret; \ |
@@ -517,7 +522,7 @@ do { \ | |||
517 | typeof(o2) __o2 = o2; \ | 522 | typeof(o2) __o2 = o2; \ |
518 | typeof(o2) __n2 = n2; \ | 523 | typeof(o2) __n2 = n2; \ |
519 | typeof(o2) __dummy; \ | 524 | typeof(o2) __dummy; \ |
520 | alternative_io("call this_cpu_cmpxchg16b_emu\n\t" ASM_NOP4, \ | 525 | alternative_io(CMPXCHG16B_EMU_CALL, \ |
521 | "cmpxchg16b " __percpu_prefix "(%%rsi)\n\tsetz %0\n\t", \ | 526 | "cmpxchg16b " __percpu_prefix "(%%rsi)\n\tsetz %0\n\t", \ |
522 | X86_FEATURE_CX16, \ | 527 | X86_FEATURE_CX16, \ |
523 | ASM_OUTPUT2("=a"(__ret), "=d"(__dummy)), \ | 528 | ASM_OUTPUT2("=a"(__ret), "=d"(__dummy)), \ |
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 49927a863cc1..61682f0ac264 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
@@ -326,7 +326,7 @@ SECTIONS | |||
326 | } | 326 | } |
327 | 327 | ||
328 | #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) | 328 | #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) |
329 | PERCPU(INTERNODE_CACHE_BYTES, PAGE_SIZE) | 329 | PERCPU_SECTION(INTERNODE_CACHE_BYTES) |
330 | #endif | 330 | #endif |
331 | 331 | ||
332 | . = ALIGN(PAGE_SIZE); | 332 | . = ALIGN(PAGE_SIZE); |
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index a2820065927e..88ecea3facb4 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S | |||
@@ -155,7 +155,7 @@ SECTIONS | |||
155 | INIT_RAM_FS | 155 | INIT_RAM_FS |
156 | } | 156 | } |
157 | 157 | ||
158 | PERCPU(XCHAL_ICACHE_LINESIZE, PAGE_SIZE) | 158 | PERCPU_SECTION(XCHAL_ICACHE_LINESIZE) |
159 | 159 | ||
160 | /* We need this dummy segment here */ | 160 | /* We need this dummy segment here */ |
161 | 161 | ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 077c00d94f6e..db22d136ad08 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * HEAD_TEXT_SECTION | 15 | * HEAD_TEXT_SECTION |
16 | * INIT_TEXT_SECTION(PAGE_SIZE) | 16 | * INIT_TEXT_SECTION(PAGE_SIZE) |
17 | * INIT_DATA_SECTION(...) | 17 | * INIT_DATA_SECTION(...) |
18 | * PERCPU(CACHELINE_SIZE, PAGE_SIZE) | 18 | * PERCPU_SECTION(CACHELINE_SIZE) |
19 | * __init_end = .; | 19 | * __init_end = .; |
20 | * | 20 | * |
21 | * _stext = .; | 21 | * _stext = .; |
@@ -682,6 +682,28 @@ | |||
682 | } | 682 | } |
683 | 683 | ||
684 | /** | 684 | /** |
685 | * PERCPU_INPUT - the percpu input sections | ||
686 | * @cacheline: cacheline size | ||
687 | * | ||
688 | * The core percpu section names and core symbols which do not rely | ||
689 | * directly upon load addresses. | ||
690 | * | ||
691 | * @cacheline is used to align subsections to avoid false cacheline | ||
692 | * sharing between subsections for different purposes. | ||
693 | */ | ||
694 | #define PERCPU_INPUT(cacheline) \ | ||
695 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
696 | *(.data..percpu..first) \ | ||
697 | . = ALIGN(PAGE_SIZE); \ | ||
698 | *(.data..percpu..page_aligned) \ | ||
699 | . = ALIGN(cacheline); \ | ||
700 | *(.data..percpu..readmostly) \ | ||
701 | . = ALIGN(cacheline); \ | ||
702 | *(.data..percpu) \ | ||
703 | *(.data..percpu..shared_aligned) \ | ||
704 | VMLINUX_SYMBOL(__per_cpu_end) = .; | ||
705 | |||
706 | /** | ||
685 | * PERCPU_VADDR - define output section for percpu area | 707 | * PERCPU_VADDR - define output section for percpu area |
686 | * @cacheline: cacheline size | 708 | * @cacheline: cacheline size |
687 | * @vaddr: explicit base address (optional) | 709 | * @vaddr: explicit base address (optional) |
@@ -703,52 +725,33 @@ | |||
703 | * | 725 | * |
704 | * Note that this macros defines __per_cpu_load as an absolute symbol. | 726 | * Note that this macros defines __per_cpu_load as an absolute symbol. |
705 | * If there is no need to put the percpu section at a predetermined | 727 | * If there is no need to put the percpu section at a predetermined |
706 | * address, use PERCPU(). | 728 | * address, use PERCPU_SECTION. |
707 | */ | 729 | */ |
708 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ | 730 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ |
709 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 731 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
710 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | 732 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ |
711 | - LOAD_OFFSET) { \ | 733 | - LOAD_OFFSET) { \ |
712 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 734 | PERCPU_INPUT(cacheline) \ |
713 | *(.data..percpu..first) \ | ||
714 | . = ALIGN(PAGE_SIZE); \ | ||
715 | *(.data..percpu..page_aligned) \ | ||
716 | . = ALIGN(cacheline); \ | ||
717 | *(.data..percpu..readmostly) \ | ||
718 | . = ALIGN(cacheline); \ | ||
719 | *(.data..percpu) \ | ||
720 | *(.data..percpu..shared_aligned) \ | ||
721 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
722 | } phdr \ | 735 | } phdr \ |
723 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); | 736 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); |
724 | 737 | ||
725 | /** | 738 | /** |
726 | * PERCPU - define output section for percpu area, simple version | 739 | * PERCPU_SECTION - define output section for percpu area, simple version |
727 | * @cacheline: cacheline size | 740 | * @cacheline: cacheline size |
728 | * @align: required alignment | ||
729 | * | 741 | * |
730 | * Align to @align and outputs output section for percpu area. This macro | 742 | * Align to PAGE_SIZE and outputs output section for percpu area. This |
731 | * doesn't manipulate @vaddr or @phdr and __per_cpu_load and | 743 | * macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and |
732 | * __per_cpu_start will be identical. | 744 | * __per_cpu_start will be identical. |
733 | * | 745 | * |
734 | * This macro is equivalent to ALIGN(@align); PERCPU_VADDR(@cacheline,,) | 746 | * This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,) |
735 | * except that __per_cpu_load is defined as a relative symbol against | 747 | * except that __per_cpu_load is defined as a relative symbol against |
736 | * .data..percpu which is required for relocatable x86_32 configuration. | 748 | * .data..percpu which is required for relocatable x86_32 configuration. |
737 | */ | 749 | */ |
738 | #define PERCPU(cacheline, align) \ | 750 | #define PERCPU_SECTION(cacheline) \ |
739 | . = ALIGN(align); \ | 751 | . = ALIGN(PAGE_SIZE); \ |
740 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ | 752 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ |
741 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 753 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
742 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 754 | PERCPU_INPUT(cacheline) \ |
743 | *(.data..percpu..first) \ | ||
744 | . = ALIGN(PAGE_SIZE); \ | ||
745 | *(.data..percpu..page_aligned) \ | ||
746 | . = ALIGN(cacheline); \ | ||
747 | *(.data..percpu..readmostly) \ | ||
748 | . = ALIGN(cacheline); \ | ||
749 | *(.data..percpu) \ | ||
750 | *(.data..percpu..shared_aligned) \ | ||
751 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
752 | } | 755 | } |
753 | 756 | ||
754 | 757 | ||
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index e3378e8d3a5c..0400553f0d04 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -2866,9 +2866,7 @@ static int alloc_cwqs(struct workqueue_struct *wq) | |||
2866 | } | 2866 | } |
2867 | } | 2867 | } |
2868 | 2868 | ||
2869 | /* just in case, make sure it's actually aligned | 2869 | /* just in case, make sure it's actually aligned */ |
2870 | * - this is affected by PERCPU() alignment in vmlinux.lds.S | ||
2871 | */ | ||
2872 | BUG_ON(!IS_ALIGNED(wq->cpu_wq.v, align)); | 2870 | BUG_ON(!IS_ALIGNED(wq->cpu_wq.v, align)); |
2873 | return wq->cpu_wq.v ? 0 : -ENOMEM; | 2871 | return wq->cpu_wq.v ? 0 : -ENOMEM; |
2874 | } | 2872 | } |
diff --git a/mm/percpu.c b/mm/percpu.c index a160db39b810..bf80e55dbed7 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1215,8 +1215,10 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, | |||
1215 | PCPU_SETUP_BUG_ON(ai->nr_groups <= 0); | 1215 | PCPU_SETUP_BUG_ON(ai->nr_groups <= 0); |
1216 | #ifdef CONFIG_SMP | 1216 | #ifdef CONFIG_SMP |
1217 | PCPU_SETUP_BUG_ON(!ai->static_size); | 1217 | PCPU_SETUP_BUG_ON(!ai->static_size); |
1218 | PCPU_SETUP_BUG_ON((unsigned long)__per_cpu_start & ~PAGE_MASK); | ||
1218 | #endif | 1219 | #endif |
1219 | PCPU_SETUP_BUG_ON(!base_addr); | 1220 | PCPU_SETUP_BUG_ON(!base_addr); |
1221 | PCPU_SETUP_BUG_ON((unsigned long)base_addr & ~PAGE_MASK); | ||
1220 | PCPU_SETUP_BUG_ON(ai->unit_size < size_sum); | 1222 | PCPU_SETUP_BUG_ON(ai->unit_size < size_sum); |
1221 | PCPU_SETUP_BUG_ON(ai->unit_size & ~PAGE_MASK); | 1223 | PCPU_SETUP_BUG_ON(ai->unit_size & ~PAGE_MASK); |
1222 | PCPU_SETUP_BUG_ON(ai->unit_size < PCPU_MIN_UNIT_SIZE); | 1224 | PCPU_SETUP_BUG_ON(ai->unit_size < PCPU_MIN_UNIT_SIZE); |
@@ -1645,8 +1647,8 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, | |||
1645 | /* warn if maximum distance is further than 75% of vmalloc space */ | 1647 | /* warn if maximum distance is further than 75% of vmalloc space */ |
1646 | if (max_distance > (VMALLOC_END - VMALLOC_START) * 3 / 4) { | 1648 | if (max_distance > (VMALLOC_END - VMALLOC_START) * 3 / 4) { |
1647 | pr_warning("PERCPU: max_distance=0x%zx too large for vmalloc " | 1649 | pr_warning("PERCPU: max_distance=0x%zx too large for vmalloc " |
1648 | "space 0x%lx\n", | 1650 | "space 0x%lx\n", max_distance, |
1649 | max_distance, VMALLOC_END - VMALLOC_START); | 1651 | (unsigned long)(VMALLOC_END - VMALLOC_START)); |
1650 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK | 1652 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK |
1651 | /* and fail if we have fallback */ | 1653 | /* and fail if we have fallback */ |
1652 | rc = -EINVAL; | 1654 | rc = -EINVAL; |