diff options
author | Dennis Zhou <dennisz@fb.com> | 2017-06-19 19:28:30 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-06-20 15:31:28 -0400 |
commit | 8fa3ed8014ac792a4c76d585b5c0f68bd202ff6b (patch) | |
tree | 97316c47b8c92e8d39b381d38f6ee889b1d195da /mm/percpu-internal.h | |
parent | 5ccd30e40e731051f6d1eb02f7ac073c1ef9deba (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.h | 33 |
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 @@ +#ifndef _MM_PERCPU_INTERNAL_H +#define _MM_PERCPU_INTERNAL_H + +#include <linux/types.h> +#include <linux/percpu.h> + +struct pcpu_chunk { + struct list_head list; /* linked to pcpu_slot lists */ + int free_size; /* free bytes in the chunk */ + int contig_hint; /* max contiguous size hint */ + void *base_addr; /* base address of this chunk */ + + int map_used; /* # of map entries used before the sentry */ + int map_alloc; /* # of map entries allocated */ + int *map; /* allocation map */ + struct list_head map_extend_list;/* on pcpu_map_extend_chunks */ + + void *data; /* chunk data */ + int first_free; /* no free below this */ + bool immutable; /* no [de]population allowed */ + int nr_populated; /* # of populated pages */ + unsigned long populated[]; /* populated bitmap */ +}; + +extern spinlock_t pcpu_lock; + +extern struct list_head *pcpu_slot; +extern int pcpu_nr_slots; + +extern struct pcpu_chunk *pcpu_first_chunk; +extern struct pcpu_chunk *pcpu_reserved_chunk; + +#endif |