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 9F0E2C433EF for ; Wed, 15 Dec 2021 14:11:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB05D6B0075; Wed, 15 Dec 2021 09:10:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A5F1E6B0078; Wed, 15 Dec 2021 09:10:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 94F106B007B; Wed, 15 Dec 2021 09:10:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 884C46B0075 for ; Wed, 15 Dec 2021 09:10:23 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 52E436EDF0 for ; Wed, 15 Dec 2021 14:10:13 +0000 (UTC) X-FDA: 78920213106.26.E877E4C Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id E04C840023 for ; Wed, 15 Dec 2021 14:10:07 +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 36379B81F28; Wed, 15 Dec 2021 14:10:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 654E9C34604; Wed, 15 Dec 2021 14:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639577405; bh=Sr0e781SWZRfb3sOt7asMiSWa+zWDfcCiZBlkEde5Qw=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=2lWf6mo/P+jbj5XRwbZPiupeSDsFx0+Sle5HPz1msM3pIWj3HoMbTOtJn2YlJHVn4 QkNMzWIZ4ILCzQ1m7+Mupvy73ybJrdaSTXI7hb41Y9Lgx1Hi4ShQ2VlD3eOK6K5nkN 8mWEk7/mk1eSzs/6mJsKF2MOEG92mEJqvEP2ZNNI= Subject: Patch "memblock: align freed memory map on pageblock boundaries with SPARSEMEM" has been added to the 5.4-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:09:52 +0100 In-Reply-To: <20211213085710.28962-3-mark-pk.tsai@mediatek.com> Message-ID: <163957739218212@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 X-stable: commit X-Patchwork-Hint: ignore Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b="2lWf6mo/"; spf=pass (imf27.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: rspam06 X-Rspamd-Queue-Id: E04C840023 X-Stat-Signature: rxired53zd4f33jn18btedqx7sho6g69 X-HE-Tag: 1639577407-222523 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.4-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.4 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:02:39 PM CET 2021 From: Mark-PK Tsai Date: Mon, 13 Dec 2021 16:57:07 +0800 Subject: memblock: align freed memory map on pageblock boundaries with SP= ARSEMEM To: Cc: , , , , , = , , , , , Message-ID: <20211213085710.28962-3-mark-pk.tsai@mediatek.com> From: Mike Rapoport commit f921f53e089a12a192808ac4319f28727b35dc0f upstream. 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 @@ -371,14 +371,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. @@ -396,9 +396,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(prev_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.4/arm-extend-pfn_valid-to-take-into-account-freed-memory-map-alig= nment.patch queue-5.4/arm-ioremap-don-t-abuse-pfn_valid-to-check-if-pfn-is-in-ram.pat= ch queue-5.4/memblock-free_unused_memmap-use-pageblock-units-instead-of-max_= order.patch queue-5.4/memblock-align-freed-memory-map-on-pageblock-boundaries-with-sp= arsemem.patch queue-5.4/memblock-ensure-there-is-no-overflow-in-memblock_overlaps_regio= n.patch