|
48 | 48 | preempt_enable(); \ |
49 | 49 | } while (0) |
50 | 50 |
|
51 | | -#ifdef CONFIG_SMP |
52 | | - |
53 | 51 | /* minimum unit size, also is the maximum supported allocation size */ |
54 | | -#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) |
| 52 | +#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10) |
55 | 53 |
|
56 | 54 | /* |
57 | 55 | * Percpu allocator can serve percpu allocations before slab is |
@@ -146,37 +144,20 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size, |
146 | 144 | * dynamically allocated. Non-atomic access to the current CPU's |
147 | 145 | * version should probably be combined with get_cpu()/put_cpu(). |
148 | 146 | */ |
| 147 | +#ifdef CONFIG_SMP |
149 | 148 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) |
| 149 | +#else |
| 150 | +#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); }) |
| 151 | +#endif |
150 | 152 |
|
151 | 153 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); |
152 | 154 | extern bool is_kernel_percpu_address(unsigned long addr); |
153 | 155 |
|
154 | | -#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 156 | +#if !defined(CONFIG_SMP) || !defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) |
155 | 157 | extern void __init setup_per_cpu_areas(void); |
156 | 158 | #endif |
157 | 159 | extern void __init percpu_init_late(void); |
158 | 160 |
|
159 | | -#else /* CONFIG_SMP */ |
160 | | - |
161 | | -#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); }) |
162 | | - |
163 | | -/* can't distinguish from other static vars, always false */ |
164 | | -static inline bool is_kernel_percpu_address(unsigned long addr) |
165 | | -{ |
166 | | - return false; |
167 | | -} |
168 | | - |
169 | | -static inline void __init setup_per_cpu_areas(void) { } |
170 | | - |
171 | | -static inline void __init percpu_init_late(void) { } |
172 | | - |
173 | | -static inline void *pcpu_lpage_remapped(void *kaddr) |
174 | | -{ |
175 | | - return NULL; |
176 | | -} |
177 | | - |
178 | | -#endif /* CONFIG_SMP */ |
179 | | - |
180 | 161 | extern void __percpu *__alloc_percpu(size_t size, size_t align); |
181 | 162 | extern void free_percpu(void __percpu *__pdata); |
182 | 163 | extern phys_addr_t per_cpu_ptr_to_phys(void *addr); |
|
0 commit comments