[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171213015817.6950-52-alexander.levin@verizon.com>
Date: Wed, 13 Dec 2017 01:58:39 +0000
From: alexander.levin@...izon.com
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Cc: Nicolas Pitre <nicolas.pitre@...aro.org>,
Nicolas Pitre <nico@...aro.org>, Tejun Heo <tj@...nel.org>,
alexander.levin@...izon.com
Subject: [PATCH AUTOSEL for 4.4 52/59] percpu: don't forget to free the
temporary struct pcpu_alloc_info
From: Nicolas Pitre <nicolas.pitre@...aro.org>
[ Upstream commit 438a50618095061920d3a30d4c5ca1ef2e0ff860 ]
Unlike the SMP case, the !SMP case does not free the memory for struct
pcpu_alloc_info allocated in setup_per_cpu_areas(). And to give it a
chance of being reused by the page allocator later, align it to a page
boundary just like its size.
Signed-off-by: Nicolas Pitre <nico@...aro.org>
Acked-by: Dennis Zhou <dennisszhou@...il.com>
Signed-off-by: Tejun Heo <tj@...nel.org>
Signed-off-by: Sasha Levin <alexander.levin@...izon.com>
---
mm/percpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index ef6353f0adbd..c69a3ff1597e 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1402,7 +1402,7 @@ struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups,
__alignof__(ai->groups[0].cpu_map[0]));
ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]);
- ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), 0);
+ ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE);
if (!ptr)
return NULL;
ai = ptr;
@@ -2265,6 +2265,7 @@ void __init setup_per_cpu_areas(void)
if (pcpu_setup_first_chunk(ai, fc) < 0)
panic("Failed to initialize percpu areas.");
+ pcpu_free_alloc_info(ai);
}
#endif /* CONFIG_SMP */
--
2.11.0
Powered by blists - more mailing lists