hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/percpu.h
....@@ -19,35 +19,6 @@
1919 #define PERCPU_MODULE_RESERVE 0
2020 #endif
2121
22
-#ifdef CONFIG_PREEMPT_RT_FULL
23
-
24
-#define get_local_var(var) (*({ \
25
- migrate_disable(); \
26
- this_cpu_ptr(&var); }))
27
-
28
-#define put_local_var(var) do { \
29
- (void)&(var); \
30
- migrate_enable(); \
31
-} while (0)
32
-
33
-# define get_local_ptr(var) ({ \
34
- migrate_disable(); \
35
- this_cpu_ptr(var); })
36
-
37
-# define put_local_ptr(var) do { \
38
- (void)(var); \
39
- migrate_enable(); \
40
-} while (0)
41
-
42
-#else
43
-
44
-#define get_local_var(var) get_cpu_var(var)
45
-#define put_local_var(var) put_cpu_var(var)
46
-#define get_local_ptr(var) get_cpu_ptr(var)
47
-#define put_local_ptr(var) put_cpu_ptr(var)
48
-
49
-#endif
50
-
5122 /* minimum unit size, also is the maximum supported allocation size */
5223 #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10)
5324
....@@ -55,16 +26,10 @@
5526 #define PCPU_MIN_ALLOC_SHIFT 2
5627 #define PCPU_MIN_ALLOC_SIZE (1 << PCPU_MIN_ALLOC_SHIFT)
5728
58
-/* number of bits per page, used to trigger a scan if blocks are > PAGE_SIZE */
59
-#define PCPU_BITS_PER_PAGE (PAGE_SIZE >> PCPU_MIN_ALLOC_SHIFT)
60
-
6129 /*
62
- * This determines the size of each metadata block. There are several subtle
63
- * constraints around this constant. The reserved region must be a multiple of
64
- * PCPU_BITMAP_BLOCK_SIZE. Additionally, PCPU_BITMAP_BLOCK_SIZE must be a
65
- * multiple of PAGE_SIZE or PAGE_SIZE must be a multiple of
66
- * PCPU_BITMAP_BLOCK_SIZE to align with the populated page map. The unit_size
67
- * also has to be a multiple of PCPU_BITMAP_BLOCK_SIZE to ensure full blocks.
30
+ * The PCPU_BITMAP_BLOCK_SIZE must be the same size as PAGE_SIZE as the
31
+ * updating of hints is used to manage the nr_empty_pop_pages in both
32
+ * the chunk and globally.
6833 */
6934 #define PCPU_BITMAP_BLOCK_SIZE PAGE_SIZE
7035 #define PCPU_BITMAP_BLOCK_BITS (PCPU_BITMAP_BLOCK_SIZE >> \
....@@ -140,7 +105,7 @@
140105 int nr_units);
141106 extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai);
142107
143
-extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
108
+extern void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
144109 void *base_addr);
145110
146111 #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK