hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/mm/percpu-km.c
....@@ -1,10 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * mm/percpu-km.c - kernel memory based chunk allocation
34 *
45 * Copyright (C) 2010 SUSE Linux Products GmbH
56 * Copyright (C) 2010 Tejun Heo <tj@kernel.org>
6
- *
7
- * This file is released under the GPLv2.
87 *
98 * Chunks are allocated as a contiguous kernel memory using gfp
109 * allocation. This is to be used on nommu architectures.
....@@ -45,7 +44,8 @@
4544 /* nada */
4645 }
4746
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)
4949 {
5050 const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT;
5151 struct pcpu_chunk *chunk;
....@@ -53,7 +53,7 @@
5353 unsigned long flags;
5454 int i;
5555
56
- chunk = pcpu_alloc_chunk(gfp);
56
+ chunk = pcpu_alloc_chunk(type, gfp);
5757 if (!chunk)
5858 return NULL;
5959
....@@ -67,10 +67,10 @@
6767 pcpu_set_page_chunk(nth_page(pages, i), chunk);
6868
6969 chunk->data = pages;
70
- chunk->base_addr = page_address(pages) - pcpu_group_offsets[0];
70
+ chunk->base_addr = page_address(pages);
7171
7272 spin_lock_irqsave(&pcpu_lock, flags);
73
- pcpu_chunk_populated(chunk, 0, nr_pages, false);
73
+ pcpu_chunk_populated(chunk, 0, nr_pages);
7474 spin_unlock_irqrestore(&pcpu_lock, flags);
7575
7676 pcpu_stats_chunk_alloc();