From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA202C433F5 for ; Wed, 15 Dec 2021 14:13:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A47D6B007D; Wed, 15 Dec 2021 09:10:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 751936B007E; Wed, 15 Dec 2021 09:10:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 641466B0080; Wed, 15 Dec 2021 09:10:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 56AB56B007D for ; Wed, 15 Dec 2021 09:10:35 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 228358540F for ; Wed, 15 Dec 2021 14:10:25 +0000 (UTC) X-FDA: 78920213610.31.04277FD Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf23.hostedemail.com (Postfix) with ESMTP id 78CD7140010 for ; Wed, 15 Dec 2021 14:10:20 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6D51DB81DFC; Wed, 15 Dec 2021 14:10:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 965F3C34605; Wed, 15 Dec 2021 14:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639577422; bh=hNUE2hhGiMA93FQTtJXlwSPgae83xKNRD2rXeYFl5fM=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=r9FwjeWUZQV7LPeCyR1CmTlEltcvf8v85BlznksLTJmVlWAjTHI6PjqXdDR5SRwXC Fr/DvBEUbcR6r6IwuoYpd9Qa9yicqKnjwHP2fvuGg+LoutXwcmVhmyYM6KAbaBiyYr /30QtlnOyOIfFN8z+LWwlrDVJj8PL6NA7RM+jKg4= Subject: Patch "memblock: align freed memory map on pageblock boundaries with SPARSEMEM" has been added to the 5.10-stable tree To: akpm@linux-foundation.org,gregkh@linuxfoundation.org,linux-arm-kernel@lists.infradead.org,linux-mm@kvack.org,linux@armlinux.org.uk,mark-pk.tsai@mediatek.com,rppt@kernel.org,rppt@linux.ibm.com,tony@atomide.com,wangkefeng.wang@huawei.com,yj.chiang@mediatek.com Cc: From: Date: Wed, 15 Dec 2021 15:10:10 +0100 In-Reply-To: <20211213094135.1798-3-mark-pk.tsai@mediatek.com> Message-ID: <163957741016560@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 X-stable: commit X-Patchwork-Hint: ignore X-Rspamd-Queue-Id: 78CD7140010 X-Stat-Signature: srzmcrb4yxqnaex1oi73agggb6tz1oi3 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=r9FwjeWU; spf=pass (imf23.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-Rspamd-Server: rspam10 X-HE-Tag: 1639577420-795024 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This is a note to let you know that I've just added the patch titled memblock: align freed memory map on pageblock boundaries with SPARSEM= EM to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.g= it;a=3Dsummary The filename of the patch is: memblock-align-freed-memory-map-on-pageblock-boundaries-with-sparsem= em.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Wed Dec 15 03:01:20 PM CET 2021 From: Mark-PK Tsai Date: Mon, 13 Dec 2021 17:41:32 +0800 Subject: memblock: align freed memory map on pageblock boundaries with SP= ARSEMEM To: Cc: , , , , , = , , , , , Message-ID: <20211213094135.1798-3-mark-pk.tsai@mediatek.com> From: Mike Rapoport [ Upstream commit f921f53e089a12a192808ac4319f28727b35dc0f ] When CONFIG_SPARSEMEM=3Dy the ranges of the memory map that are freed are= not aligned to the pageblock boundaries which breaks assumptions about homogeneity of the memory map throughout core mm code. Make sure that the freed memory map is always aligned on pageblock boundaries regardless of the memory model selection. Signed-off-by: Mike Rapoport Tested-by: Tony Lindgren Link: https://lore.kernel.org/lkml/20210630071211.21011-1-rppt@kernel.org= / [backport upstream modification in mm/memblock.c to arch/arm/mm/init.c] Signed-off-by: Mark-PK Tsai Signed-off-by: Greg Kroah-Hartman --- arch/arm/mm/init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -313,14 +313,14 @@ static void __init free_unused_memmap(vo */ start =3D min(start, ALIGN(prev_end, PAGES_PER_SECTION)); -#else +#endif /* * Align down here since many operations in VM subsystem * presume that there are no holes in the memory map inside * a pageblock */ start =3D round_down(start, pageblock_nr_pages); -#endif + /* * If we had a previous bank, and there is a space * between the current bank and the previous, free it. @@ -337,9 +337,11 @@ static void __init free_unused_memmap(vo } =20 #ifdef CONFIG_SPARSEMEM - if (!IS_ALIGNED(prev_end, PAGES_PER_SECTION)) + if (!IS_ALIGNED(prev_end, PAGES_PER_SECTION)) { + prev_end =3D ALIGN(end, pageblock_nr_pages); free_memmap(prev_end, ALIGN(prev_end, PAGES_PER_SECTION)); + } #endif } =20 Patches currently in stable-queue which might be from mark-pk.tsai@mediat= ek.com are queue-5.10/arm-extend-pfn_valid-to-take-into-account-freed-memory-map-ali= gnment.patch queue-5.10/arm-ioremap-don-t-abuse-pfn_valid-to-check-if-pfn-is-in-ram.pa= tch queue-5.10/memblock-free_unused_memmap-use-pageblock-units-instead-of-max= _order.patch queue-5.10/memblock-align-freed-memory-map-on-pageblock-boundaries-with-s= parsemem.patch queue-5.10/memblock-ensure-there-is-no-overflow-in-memblock_overlaps_regi= on.patch