Commit 4af1e6fb authored by Dennis Zhou (Facebook)'s avatar Dennis Zhou (Facebook) Committed by Tejun Heo

percpu: remove has_reserved from pcpu_chunk

Prior this variable was used to manage statistics when the first chunk
had a reserved region. The previous patch introduced start_offset to
keep track of the offset by value rather than boolean. Therefore,
has_reserved can be removed.
Signed-off-by: default avatarDennis Zhou <dennisszhou@gmail.com>
Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent e2266705
...@@ -23,11 +23,6 @@ struct pcpu_chunk { ...@@ -23,11 +23,6 @@ struct pcpu_chunk {
void *data; /* chunk data */ void *data; /* chunk data */
int first_free; /* no free below this */ int first_free; /* no free below this */
bool immutable; /* no [de]population allowed */ bool immutable; /* no [de]population allowed */
bool has_reserved; /* Indicates if chunk has reserved space
at the beginning. Reserved chunk will
contain reservation for static chunk.
Dynamic chunk will contain reservation
for static and reserved chunks. */
int start_offset; /* the overlap with the previous int start_offset; /* the overlap with the previous
region to have a page aligned region to have a page aligned
base_addr */ base_addr */
......
...@@ -58,7 +58,7 @@ static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk, ...@@ -58,7 +58,7 @@ static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk,
int cur_min_alloc = 0, cur_med_alloc = 0, cur_max_alloc = 0; int cur_min_alloc = 0, cur_med_alloc = 0, cur_max_alloc = 0;
alloc_sizes = buffer; alloc_sizes = buffer;
s_index = chunk->has_reserved ? 1 : 0; s_index = (chunk->start_offset) ? 1 : 0;
/* find last allocation */ /* find last allocation */
last_alloc = -1; last_alloc = -1;
......
...@@ -727,7 +727,6 @@ static struct pcpu_chunk *pcpu_alloc_chunk(void) ...@@ -727,7 +727,6 @@ static struct pcpu_chunk *pcpu_alloc_chunk(void)
chunk->map[0] = 0; chunk->map[0] = 0;
chunk->map[1] = pcpu_unit_size | 1; chunk->map[1] = pcpu_unit_size | 1;
chunk->map_used = 1; chunk->map_used = 1;
chunk->has_reserved = false;
INIT_LIST_HEAD(&chunk->list); INIT_LIST_HEAD(&chunk->list);
INIT_LIST_HEAD(&chunk->map_extend_list); INIT_LIST_HEAD(&chunk->map_extend_list);
...@@ -1704,7 +1703,6 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, ...@@ -1704,7 +1703,6 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
schunk->map[1] = schunk->start_offset; schunk->map[1] = schunk->start_offset;
schunk->map[2] = (ai->static_size + schunk->free_size) | 1; schunk->map[2] = (ai->static_size + schunk->free_size) | 1;
schunk->map_used = 2; schunk->map_used = 2;
schunk->has_reserved = true;
/* init dynamic chunk if necessary */ /* init dynamic chunk if necessary */
if (dyn_size) { if (dyn_size) {
...@@ -1724,7 +1722,6 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, ...@@ -1724,7 +1722,6 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
dchunk->map[1] = dchunk->start_offset; dchunk->map[1] = dchunk->start_offset;
dchunk->map[2] = (dchunk->start_offset + dchunk->free_size) | 1; dchunk->map[2] = (dchunk->start_offset + dchunk->free_size) | 1;
dchunk->map_used = 2; dchunk->map_used = 2;
dchunk->has_reserved = true;
} }
/* link the first chunk in */ /* link the first chunk in */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment