summaryrefslogtreecommitdiffstats
path: root/mm/percpu-internal.h
diff options
context:
space:
mode:
authorDennis Zhou (Facebook) <dennisszhou@gmail.com>2017-07-24 19:02:05 -0400
committerTejun Heo <tj@kernel.org>2017-07-26 10:23:52 -0400
commitc0ebfdc3fefdef73131c7cb431ad8079f65c714a (patch)
treefa6ace66fe686920fca8a437210fe64863783f69 /mm/percpu-internal.h
parent0c4169c3d11722a26773bdc0144c97fadd47d905 (diff)
downloadlinux-c0ebfdc3fefdef73131c7cb431ad8079f65c714a.tar.gz
linux-c0ebfdc3fefdef73131c7cb431ad8079f65c714a.tar.bz2
linux-c0ebfdc3fefdef73131c7cb431ad8079f65c714a.zip
percpu: modify base_addr to be region specific
Originally, the first chunk was served by one or two chunks, each given a region they are responsible for. Despite this, the arithmetic was based off of the true base_addr of the chunk making it be overly inclusive. This patch moves the base_addr of chunks that are responsible for the first chunk. The base_addr must remain page aligned to keep the address alignment correct, so it is the beginning of the region served page aligned down. start_offset holds where the region served begins from this new base_addr. The corresponding percpu address checks are modified to be more specific as a result. The first chunk considers only the dynamic region and both first chunk and reserved chunk checks ignore the static region. The static region addresses should never be passed into the allocator. There is no impact here besides distinguishing the first chunk and making the checks specific. The percpu pointer to physical address is left intact as addresses are not given out in the non-allocated portion of percpu memory. nr_pages is added to pcpu_chunk to keep track of the size of the entire region served containing both start_offset and end_offset. This variable will be used to manage the bitmap allocator. Signed-off-by: Dennis Zhou <dennisszhou@gmail.com> Reviewed-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu-internal.h')
-rw-r--r--mm/percpu-internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/percpu-internal.h b/mm/percpu-internal.h
index f02f31cea0e6..34cb9799e324 100644
--- a/mm/percpu-internal.h
+++ b/mm/percpu-internal.h
@@ -29,6 +29,8 @@ struct pcpu_chunk {
int end_offset; /* additional area required to
have the region end page
aligned */
+
+ int nr_pages; /* # of pages served by this chunk */
int nr_populated; /* # of populated pages */
unsigned long populated[]; /* populated bitmap */
};