| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * mm/percpu-km.c - kernel memory based chunk allocation |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010 SUSE Linux Products GmbH |
|---|
| 5 | 6 | * Copyright (C) 2010 Tejun Heo <tj@kernel.org> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This file is released under the GPLv2. |
|---|
| 8 | 7 | * |
|---|
| 9 | 8 | * Chunks are allocated as a contiguous kernel memory using gfp |
|---|
| 10 | 9 | * allocation. This is to be used on nommu architectures. |
|---|
| .. | .. |
|---|
| 45 | 44 | /* nada */ |
|---|
| 46 | 45 | } |
|---|
| 47 | 46 | |
|---|
| 48 | | -static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) |
|---|
| 47 | +static struct pcpu_chunk *pcpu_create_chunk(enum pcpu_chunk_type type, |
|---|
| 48 | + gfp_t gfp) |
|---|
| 49 | 49 | { |
|---|
| 50 | 50 | const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; |
|---|
| 51 | 51 | struct pcpu_chunk *chunk; |
|---|
| .. | .. |
|---|
| 53 | 53 | unsigned long flags; |
|---|
| 54 | 54 | int i; |
|---|
| 55 | 55 | |
|---|
| 56 | | - chunk = pcpu_alloc_chunk(gfp); |
|---|
| 56 | + chunk = pcpu_alloc_chunk(type, gfp); |
|---|
| 57 | 57 | if (!chunk) |
|---|
| 58 | 58 | return NULL; |
|---|
| 59 | 59 | |
|---|
| .. | .. |
|---|
| 67 | 67 | pcpu_set_page_chunk(nth_page(pages, i), chunk); |
|---|
| 68 | 68 | |
|---|
| 69 | 69 | chunk->data = pages; |
|---|
| 70 | | - chunk->base_addr = page_address(pages) - pcpu_group_offsets[0]; |
|---|
| 70 | + chunk->base_addr = page_address(pages); |
|---|
| 71 | 71 | |
|---|
| 72 | 72 | spin_lock_irqsave(&pcpu_lock, flags); |
|---|
| 73 | | - pcpu_chunk_populated(chunk, 0, nr_pages, false); |
|---|
| 73 | + pcpu_chunk_populated(chunk, 0, nr_pages); |
|---|
| 74 | 74 | spin_unlock_irqrestore(&pcpu_lock, flags); |
|---|
| 75 | 75 | |
|---|
| 76 | 76 | pcpu_stats_chunk_alloc(); |
|---|