aboutsummaryrefslogtreecommitdiffstats
path: root/mm/percpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/percpu.c')
-rw-r--r--mm/percpu.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index 7971997de310..7fb40bb1555a 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1414,6 +1414,38 @@ 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
1417const char *pcpu_fc_names[PCPU_FC_NR] __initdata = {
1418 [PCPU_FC_AUTO] = "auto",
1419 [PCPU_FC_EMBED] = "embed",
1420 [PCPU_FC_PAGE] = "page",
1421 [PCPU_FC_LPAGE] = "lpage",
1422};
1423
1424enum pcpu_fc pcpu_chosen_fc __initdata = PCPU_FC_AUTO;
1425
1426static int __init percpu_alloc_setup(char *str)
1427{
1428 if (0)
1429 /* nada */;
1430#ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK
1431 else if (!strcmp(str, "embed"))
1432 pcpu_chosen_fc = PCPU_FC_EMBED;
1433#endif
1434#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK
1435 else if (!strcmp(str, "page"))
1436 pcpu_chosen_fc = PCPU_FC_PAGE;
1437#endif
1438#ifdef CONFIG_NEED_PER_CPU_LPAGE_FIRST_CHUNK
1439 else if (!strcmp(str, "lpage"))
1440 pcpu_chosen_fc = PCPU_FC_LPAGE;
1441#endif
1442 else
1443 pr_warning("PERCPU: unknown allocator %s specified\n", str);
1444
1445 return 0;
1446}
1447early_param("percpu_alloc", percpu_alloc_setup);
1448
1417static inline size_t pcpu_calc_fc_sizes(size_t static_size, 1449static inline size_t pcpu_calc_fc_sizes(size_t static_size,
1418 size_t reserved_size, 1450 size_t reserved_size,
1419 ssize_t *dyn_sizep) 1451 ssize_t *dyn_sizep)