Return-Path: Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:18384 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbdLMB4g (ORCPT ); Tue, 12 Dec 2017 20:56:36 -0500 From: alexander.levin@verizon.com Cc: Nicolas Pitre , Nicolas Pitre , Tejun Heo , alexander.levin@verizon.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.14 35/60] percpu: don't forget to free the temporary struct pcpu_alloc_info Date: Wed, 13 Dec 2017 01:55:20 +0000 Message-ID: <20171213015455.6455-35-alexander.levin@verizon.com> References: <20171213015455.6455-1-alexander.levin@verizon.com> In-Reply-To: <20171213015455.6455-1-alexander.levin@verizon.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Nicolas Pitre [ 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 Acked-by: Dennis Zhou Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin --- mm/percpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu.c index a0e0c82c1e4c..79e3549cab0f 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1856,7 +1856,7 @@ struct pcpu_alloc_info * __init pcpu_alloc_alloc_info= (int nr_groups, __alignof__(ai->groups[0].cpu_map[0])); ai_size =3D base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]); =20 - ptr =3D memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), 0); + ptr =3D memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE); if (!ptr) return NULL; ai =3D ptr; @@ -2719,6 +2719,7 @@ void __init setup_per_cpu_areas(void) =20 if (pcpu_setup_first_chunk(ai, fc) < 0) panic("Failed to initialize percpu areas."); + pcpu_free_alloc_info(ai); } =20 #endif /* CONFIG_SMP */ --=20 2.11.0