blob: 68bf18522a6dd87d301d41c62e44397bfdab108b [file] [log] [blame]
Dennis Zhou8fa3ed82017-06-19 19:28:30 -04001#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