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 1C675C433EF for ; Wed, 15 Dec 2021 14:12:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E8EE6B0078; Wed, 15 Dec 2021 09:10:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 296B26B007B; Wed, 15 Dec 2021 09:10:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1860E6B007D; Wed, 15 Dec 2021 09:10:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 0B03B6B0078 for ; Wed, 15 Dec 2021 09:10:25 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C23B5181AEF10 for ; Wed, 15 Dec 2021 14:10:14 +0000 (UTC) X-FDA: 78920213148.31.763DCEB Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id CB15E1C0012 for ; Wed, 15 Dec 2021 14:10:11 +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 BA16FB81EE1; Wed, 15 Dec 2021 14:10:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C520C34605; Wed, 15 Dec 2021 14:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639577411; bh=tQelAj1GgyzjePBPLP6cGP/3AIFyDp9uPO6ZuIlRfGo=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=Jfa2ArbvVEifZxbtqSpWglIi9WaNOCTyfkOV3NLoLhYS8CYZN+zPC/ZyFk0Ht5wqe bSWTCZ+Zz2uhRrXfjIZLatpbW6qfXYx7O/PfT68ZMaHKrDWUWgIf4Javc6JoQanTH3 ECNuHbpmJYsV3RvwGriGh6ZQx+/ySD1GcJ0wV0uE= Subject: Patch "memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER" 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-2-mark-pk.tsai@mediatek.com> Message-ID: <1639577392212138@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 X-stable: commit X-Patchwork-Hint: ignore X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: CB15E1C0012 X-Stat-Signature: pdw31s3oc5z6jeyjojie3tbrshy8crnr Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=Jfa2Arbv; spf=pass (imf20.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-HE-Tag: 1639577411-455634 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: free_unused_memmap: use pageblock units instead of MAX_ORDE= R 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-free_unused_memmap-use-pageblock-units-instead-of-max_order= .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:06 +0800 Subject: memblock: free_unused_memmap: use pageblock units instead of MAX= _ORDER To: Cc: , , , , , = , , , , , Message-ID: <20211213085710.28962-2-mark-pk.tsai@mediatek.com> From: Mike Rapoport commit e2a86800d58639b3acde7eaeb9eb393dca066e08 upstream. The code that frees unused memory map uses rounds start and end of the holes that are freed to MAX_ORDER_NR_PAGES to preserve continuity of the memory map for MAX_ORDER regions. Lots of core memory management functionality relies on homogeneity of the memory map within each pageblock which size may differ from MAX_ORDER in certain configurations. Although currently, for the architectures that use free_unused_memmap(), pageblock_order and MAX_ORDER are equivalent, it is cleaner to have commo= n notation thought mm code. Replace MAX_ORDER_NR_PAGES with pageblock_nr_pages and update the comment= s to make it more clear why the alignment to pageblock boundaries is required. 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -373,11 +373,11 @@ static void __init free_unused_memmap(vo ALIGN(prev_end, PAGES_PER_SECTION)); #else /* - * Align down here since the VM subsystem insists that the - * memmap entries are valid from the bank start aligned to - * MAX_ORDER_NR_PAGES. + * 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, MAX_ORDER_NR_PAGES); + start =3D round_down(start, pageblock_nr_pages); #endif /* * If we had a previous bank, and there is a space @@ -387,12 +387,12 @@ static void __init free_unused_memmap(vo free_memmap(prev_end, start); =20 /* - * Align up here since the VM subsystem insists that the - * memmap entries are valid from the bank end aligned to - * MAX_ORDER_NR_PAGES. + * Align up here since many operations in VM subsystem + * presume that there are no holes in the memory map inside + * a pageblock */ prev_end =3D ALIGN(memblock_region_memory_end_pfn(reg), - MAX_ORDER_NR_PAGES); + pageblock_nr_pages); } =20 #ifdef CONFIG_SPARSEMEM 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