From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753509AbdLMCAP (ORCPT ); Tue, 12 Dec 2017 21:00:15 -0500 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:21144 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753328AbdLMB7M (ORCPT ); Tue, 12 Dec 2017 20:59:12 -0500 From: alexander.levin@verizon.com Cc: Nicolas Pitre , Nicolas Pitre , Tejun Heo , alexander.levin@verizon.com X-Host: mariner.tdc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.9 087/100] percpu: don't forget to free the temporary struct pcpu_alloc_info Thread-Topic: [PATCH AUTOSEL for 4.9 087/100] percpu: don't forget to free the temporary struct pcpu_alloc_info Thread-Index: AQHTc7XEXHp7ewGcKkafhpR6maZ7zA== Date: Wed, 13 Dec 2017 01:57:44 +0000 Message-ID: <20171213015722.6722-62-alexander.levin@verizon.com> References: <20171213015722.6722-1-alexander.levin@verizon.com> In-Reply-To: <20171213015722.6722-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 vBD20Llr015233 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 f014cebbf405..8cc924e0fd5c 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1400,7 +1400,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; @@ -2264,6 +2264,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