aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-03-06 00:33:59 -0500
committerTejun Heo <tj@kernel.org>2009-03-06 00:33:59 -0500
commit3e24aa58907c62bc79d1094e941a374568f62522 (patch)
tree1398a21daab0d20a32d7dd04bb8ecadae2e0df82 /mm
parent9a4f8a878b68d5a5d9ee60908a52cf6a55e1b823 (diff)
percpu: add an indirection ptr for chunk page map access
Impact: allow sharing page map, no functional difference yet Make chunk->page access indirect by adding a pointer and renaming the actual array to page_ar. This will be used by future changes. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/percpu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index a84cf9977faf..5b47d9fe65f5 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -80,7 +80,8 @@ struct pcpu_chunk {
80 int map_alloc; /* # of map entries allocated */ 80 int map_alloc; /* # of map entries allocated */
81 int *map; /* allocation map */ 81 int *map; /* allocation map */
82 bool immutable; /* no [de]population allowed */ 82 bool immutable; /* no [de]population allowed */
83 struct page *page[]; /* #cpus * UNIT_PAGES */ 83 struct page **page; /* points to page array */
84 struct page *page_ar[]; /* #cpus * UNIT_PAGES */
84}; 85};
85 86
86static int pcpu_unit_pages __read_mostly; 87static int pcpu_unit_pages __read_mostly;
@@ -696,6 +697,7 @@ static struct pcpu_chunk *alloc_pcpu_chunk(void)
696 PCPU_DFL_MAP_ALLOC * sizeof(chunk->map[0])); 697 PCPU_DFL_MAP_ALLOC * sizeof(chunk->map[0]));
697 chunk->map_alloc = PCPU_DFL_MAP_ALLOC; 698 chunk->map_alloc = PCPU_DFL_MAP_ALLOC;
698 chunk->map[chunk->map_used++] = pcpu_unit_size; 699 chunk->map[chunk->map_used++] = pcpu_unit_size;
700 chunk->page = chunk->page_ar;
699 701
700 chunk->vm = get_vm_area(pcpu_chunk_size, GFP_KERNEL); 702 chunk->vm = get_vm_area(pcpu_chunk_size, GFP_KERNEL);
701 if (!chunk->vm) { 703 if (!chunk->vm) {
@@ -918,6 +920,7 @@ size_t __init pcpu_setup_first_chunk(pcpu_get_page_fn_t get_page_fn,
918 schunk->vm = &first_vm; 920 schunk->vm = &first_vm;
919 schunk->map = smap; 921 schunk->map = smap;
920 schunk->map_alloc = ARRAY_SIZE(smap); 922 schunk->map_alloc = ARRAY_SIZE(smap);
923 schunk->page = schunk->page_ar;
921 schunk->free_size = dyn_size; 924 schunk->free_size = dyn_size;
922 schunk->contig_hint = schunk->free_size; 925 schunk->contig_hint = schunk->free_size;
923 926