From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074AbdLMCDd (ORCPT ); Tue, 12 Dec 2017 21:03:33 -0500 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:45548 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753413AbdLMCCJ (ORCPT ); Tue, 12 Dec 2017 21:02:09 -0500 From: alexander.levin@verizon.com Cc: Nicolas Pitre , Nicolas Pitre , Tejun Heo , alexander.levin@verizon.com X-Host: surveyor.tdc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 3.18 35/40] percpu: don't forget to free the temporary struct pcpu_alloc_info Thread-Topic: [PATCH AUTOSEL for 3.18 35/40] percpu: don't forget to free the temporary struct pcpu_alloc_info Thread-Index: AQHTc7X9VnzwBaN+jUWoTMj3xTK3dA== Date: Wed, 13 Dec 2017 01:59:19 +0000 Message-ID: <20171213015905.7059-35-alexander.levin@verizon.com> References: <20171213015905.7059-1-alexander.levin@verizon.com> In-Reply-To: <20171213015905.7059-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vBD23cIx015737 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 f7da3a3070c4..4695dc79fcfe 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; @@ -2268,6 +2268,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