Commit 3cbc8565 authored by Tejun Heo's avatar Tejun Heo

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: default avatarTejun Heo <tj@kernel.org>
parent 1d9d3257
...@@ -126,9 +126,9 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, ...@@ -126,9 +126,9 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
/* /*
* Helpers for first chunk memory allocation * Helpers for first chunk memory allocation
*/ */
static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size) static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
{ {
return pcpu_alloc_bootmem(cpu, size, size); return pcpu_alloc_bootmem(cpu, size, align);
} }
static void __init pcpu_fc_free(void *ptr, size_t size) static void __init pcpu_fc_free(void *ptr, size_t size)
......
...@@ -71,7 +71,8 @@ extern const char *pcpu_fc_names[PCPU_FC_NR]; ...@@ -71,7 +71,8 @@ extern const char *pcpu_fc_names[PCPU_FC_NR];
extern enum pcpu_fc pcpu_chosen_fc; extern enum pcpu_fc pcpu_chosen_fc;
typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size); typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
size_t align);
typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size); typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr); typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to); typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);
......
...@@ -1578,7 +1578,7 @@ ssize_t __init pcpu_page_first_chunk(size_t reserved_size, ...@@ -1578,7 +1578,7 @@ ssize_t __init pcpu_page_first_chunk(size_t reserved_size,
for (i = 0; i < unit_pages; i++) { for (i = 0; i < unit_pages; i++) {
void *ptr; void *ptr;
ptr = alloc_fn(cpu, PAGE_SIZE); ptr = alloc_fn(cpu, PAGE_SIZE, PAGE_SIZE);
if (!ptr) { if (!ptr) {
pr_warning("PERCPU: failed to allocate %s page " pr_warning("PERCPU: failed to allocate %s page "
"for cpu%u\n", psize_str, cpu); "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,7 +1888,7 @@ ssize_t __init pcpu_lpage_first_chunk(size_t reserved_size, size_t dyn_size,
goto found; goto found;
continue; continue;
found: found:
ptr = alloc_fn(cpu, lpage_size); ptr = alloc_fn(cpu, lpage_size, lpage_size);
if (!ptr) { if (!ptr) {
pr_warning("PERCPU: failed to allocate large page " pr_warning("PERCPU: failed to allocate large page "
"for cpu%u\n", cpu); "for cpu%u\n", cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment