diff options
author | Tejun Heo <tj@kernel.org> | 2009-08-14 02:00:49 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-08-14 02:00:49 -0400 |
commit | 08fc45806103e59a37418e84719b878f9bb32540 (patch) | |
tree | 8b39b7769fd42457bdb2950ce02d9893f39c0b7d /mm | |
parent | 00ae4064b1445524752575dd84df227c0687c99d (diff) |
percpu: build first chunk allocators selectively
There's no need to build unused first chunk allocators in. Define
CONFIG_NEED_PER_CPU_*_FIRST_CHUNK and let archs enable them
selectively.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/percpu.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index 6feac7934904..7971997de310 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1414,8 +1414,9 @@ size_t __init pcpu_setup_first_chunk(size_t static_size, size_t reserved_size, | |||
1414 | return pcpu_unit_size; | 1414 | return pcpu_unit_size; |
1415 | } | 1415 | } |
1416 | 1416 | ||
1417 | static size_t pcpu_calc_fc_sizes(size_t static_size, size_t reserved_size, | 1417 | static inline size_t pcpu_calc_fc_sizes(size_t static_size, |
1418 | ssize_t *dyn_sizep) | 1418 | size_t reserved_size, |
1419 | ssize_t *dyn_sizep) | ||
1419 | { | 1420 | { |
1420 | size_t size_sum; | 1421 | size_t size_sum; |
1421 | 1422 | ||
@@ -1427,6 +1428,8 @@ static size_t pcpu_calc_fc_sizes(size_t static_size, size_t reserved_size, | |||
1427 | return size_sum; | 1428 | return size_sum; |
1428 | } | 1429 | } |
1429 | 1430 | ||
1431 | #if defined(CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK) || \ | ||
1432 | !defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) | ||
1430 | /** | 1433 | /** |
1431 | * pcpu_embed_first_chunk - embed the first percpu chunk into bootmem | 1434 | * pcpu_embed_first_chunk - embed the first percpu chunk into bootmem |
1432 | * @static_size: the size of static percpu area in bytes | 1435 | * @static_size: the size of static percpu area in bytes |
@@ -1495,7 +1498,10 @@ ssize_t __init pcpu_embed_first_chunk(size_t static_size, size_t reserved_size, | |||
1495 | return pcpu_setup_first_chunk(static_size, reserved_size, dyn_size, | 1498 | return pcpu_setup_first_chunk(static_size, reserved_size, dyn_size, |
1496 | unit_size, base, NULL); | 1499 | unit_size, base, NULL); |
1497 | } | 1500 | } |
1501 | #endif /* CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK || | ||
1502 | !CONFIG_HAVE_SETUP_PER_CPU_AREA */ | ||
1498 | 1503 | ||
1504 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK | ||
1499 | /** | 1505 | /** |
1500 | * pcpu_page_first_chunk - map the first chunk using PAGE_SIZE pages | 1506 | * pcpu_page_first_chunk - map the first chunk using PAGE_SIZE pages |
1501 | * @static_size: the size of static percpu area in bytes | 1507 | * @static_size: the size of static percpu area in bytes |
@@ -1598,12 +1604,9 @@ out_free_ar: | |||
1598 | free_bootmem(__pa(pages), pages_size); | 1604 | free_bootmem(__pa(pages), pages_size); |
1599 | return ret; | 1605 | return ret; |
1600 | } | 1606 | } |
1607 | #endif /* CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK */ | ||
1601 | 1608 | ||
1602 | /* | 1609 | #ifdef CONFIG_NEED_PER_CPU_LPAGE_FIRST_CHUNK |
1603 | * Large page remapping first chunk setup helper | ||
1604 | */ | ||
1605 | #ifdef CONFIG_NEED_MULTIPLE_NODES | ||
1606 | |||
1607 | /** | 1610 | /** |
1608 | * pcpu_lpage_build_unit_map - build unit_map for large page remapping | 1611 | * pcpu_lpage_build_unit_map - build unit_map for large page remapping |
1609 | * @static_size: the size of static percpu area in bytes | 1612 | * @static_size: the size of static percpu area in bytes |
@@ -1982,7 +1985,7 @@ void *pcpu_lpage_remapped(void *kaddr) | |||
1982 | 1985 | ||
1983 | return NULL; | 1986 | return NULL; |
1984 | } | 1987 | } |
1985 | #endif | 1988 | #endif /* CONFIG_NEED_PER_CPU_LPAGE_FIRST_CHUNK */ |
1986 | 1989 | ||
1987 | /* | 1990 | /* |
1988 | * Generic percpu area setup. | 1991 | * Generic percpu area setup. |