aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-08-14 02:00:50 -0400
committerTejun Heo <tj@kernel.org>2009-08-14 02:00:50 -0400
commit3cbc85652767c38b252c8de55f9fd180b29e4c0d (patch)
treeccfedb764830dbd4a90b9517a9ad365af694c01f
parent1d9d32572163b30be81dbe1409dfa7ea9763d0e8 (diff)
percpu: add @align to pcpu_fc_alloc_fn_t
pcpu_fc_alloc_fn_t is about to see more interesting usage, add @align parameter. Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--arch/x86/kernel/setup_percpu.c4
-rw-r--r--include/linux/percpu.h3
-rw-r--r--mm/percpu.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 8aad486c688f..660cde133141 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -126,9 +126,9 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
126/* 126/*
127 * Helpers for first chunk memory allocation 127 * Helpers for first chunk memory allocation
128 */ 128 */
129static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size) 129static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
130{ 130{
131 return pcpu_alloc_bootmem(cpu, size, size); 131 return pcpu_alloc_bootmem(cpu, size, align);
132} 132}
133 133
134static void __init pcpu_fc_free(void *ptr, size_t size) 134static void __init pcpu_fc_free(void *ptr, size_t size)
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 0cfdd14d096a..d385dbcf190b 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -71,7 +71,8 @@ extern const char *pcpu_fc_names[PCPU_FC_NR];
71 71
72extern enum pcpu_fc pcpu_chosen_fc; 72extern enum pcpu_fc pcpu_chosen_fc;
73 73
74typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size); 74typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
75 size_t align);
75typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size); 76typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
76typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr); 77typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
77typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to); 78typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);
diff --git a/mm/percpu.c b/mm/percpu.c
index 287f59cc5fb9..3316e3aac7ee 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1578,7 +1578,7 @@ ssize_t __init pcpu_page_first_chunk(size_t reserved_size,
1578 for (i = 0; i < unit_pages; i++) { 1578 for (i = 0; i < unit_pages; i++) {
1579 void *ptr; 1579 void *ptr;
1580 1580
1581 ptr = alloc_fn(cpu, PAGE_SIZE); 1581 ptr = alloc_fn(cpu, PAGE_SIZE, PAGE_SIZE);
1582 if (!ptr) { 1582 if (!ptr) {
1583 pr_warning("PERCPU: failed to allocate %s page " 1583 pr_warning("PERCPU: failed to allocate %s page "
1584 "for cpu%u\n", psize_str, cpu); 1584 "for cpu%u\n", psize_str, cpu);
@@ -1888,7 +1888,7 @@ ssize_t __init pcpu_lpage_first_chunk(size_t reserved_size, size_t dyn_size,
1888 goto found; 1888 goto found;
1889 continue; 1889 continue;
1890 found: 1890 found:
1891 ptr = alloc_fn(cpu, lpage_size); 1891 ptr = alloc_fn(cpu, lpage_size, lpage_size);
1892 if (!ptr) { 1892 if (!ptr) {
1893 pr_warning("PERCPU: failed to allocate large page " 1893 pr_warning("PERCPU: failed to allocate large page "
1894 "for cpu%u\n", cpu); 1894 "for cpu%u\n", cpu);