aboutsummaryrefslogtreecommitdiffstats
path: root/mm/percpu-internal.h
diff options
context:
space:
mode:
authorDennis Zhou <dennisz@fb.com>2017-06-19 19:28:30 -0400
committerTejun Heo <tj@kernel.org>2017-06-20 15:31:28 -0400
commit8fa3ed8014ac792a4c76d585b5c0f68bd202ff6b (patch)
tree97316c47b8c92e8d39b381d38f6ee889b1d195da /mm/percpu-internal.h
parent5ccd30e40e731051f6d1eb02f7ac073c1ef9deba (diff)
percpu: migrate percpu data structures to internal header
Migrates pcpu_chunk definition and a few percpu static variables to an internal header file from mm/percpu.c. These will be used with debugfs to expose statistics about percpu memory improving visibility regarding allocations and fragmentation. Signed-off-by: Dennis Zhou <dennisz@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu-internal.h')
-rw-r--r--mm/percpu-internal.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/mm/percpu-internal.h b/mm/percpu-internal.h
new file mode 100644
index 000000000000..68bf18522a6d
--- /dev/null
+++ b/mm/percpu-internal.h
@@ -0,0 +1,33 @@
1#ifndef _MM_PERCPU_INTERNAL_H
2#define _MM_PERCPU_INTERNAL_H
3
4#include <linux/types.h>
5#include <linux/percpu.h>
6
7struct pcpu_chunk {
8 struct list_head list; /* linked to pcpu_slot lists */
9 int free_size; /* free bytes in the chunk */
10 int contig_hint; /* max contiguous size hint */
11 void *base_addr; /* base address of this chunk */
12
13 int map_used; /* # of map entries used before the sentry */
14 int map_alloc; /* # of map entries allocated */
15 int *map; /* allocation map */
16 struct list_head map_extend_list;/* on pcpu_map_extend_chunks */
17
18 void *data; /* chunk data */
19 int first_free; /* no free below this */
20 bool immutable; /* no [de]population allowed */
21 int nr_populated; /* # of populated pages */
22 unsigned long populated[]; /* populated bitmap */
23};
24
25extern spinlock_t pcpu_lock;
26
27extern struct list_head *pcpu_slot;
28extern int pcpu_nr_slots;
29
30extern struct pcpu_chunk *pcpu_first_chunk;
31extern struct pcpu_chunk *pcpu_reserved_chunk;
32
33#endif