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 73B93C433EF for ; Wed, 15 Dec 2021 14:14:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4200A6B007E; Wed, 15 Dec 2021 09:10:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CF1C6B0080; Wed, 15 Dec 2021 09:10:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24A9D6B0082; Wed, 15 Dec 2021 09:10:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0082.hostedemail.com [216.40.44.82]) by kanga.kvack.org (Postfix) with ESMTP id 14F816B007E for ; Wed, 15 Dec 2021 09:10:41 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D6679180E9340 for ; Wed, 15 Dec 2021 14:10:30 +0000 (UTC) X-FDA: 78920213820.11.4A4D534 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id 1646640012 for ; Wed, 15 Dec 2021 14:10:22 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 420EB618E1; Wed, 15 Dec 2021 14:10:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AF2DC34605; Wed, 15 Dec 2021 14:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639577427; bh=UozAFR5mUICA1fxLyt4CXNkIOiUHVY+nlodfZ36zuu0=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=UmydFidoa+BDoI2LH67MEk2gka+XvjwffxMFY24X8+GDJYtqk5R6jnuF/18so8Nq/ f/wwGBsL3nWtGNcSBj5MIEPUmGLx+fl+pDWpsZT4+NRGl3f99hxw7sRG3LPE9oD/aY oKT2+i+RY9EMyCKSOIJ1+4CrcTCaOR2GDsUCjMwo= Subject: Patch "memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER" 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-2-mark-pk.tsai@mediatek.com> Message-ID: <163957741013247@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: rspam09 X-Rspamd-Queue-Id: 1646640012 X-Stat-Signature: f6nak6z641nc81ccy445ksqiuodpgqj7 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=UmydFido; spf=pass (imf17.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org X-HE-Tag: 1639577422-266270 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.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-free_unused_memmap-use-pageblock-units-instead-of-max_order= .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:31 +0800 Subject: memblock: free_unused_memmap: use pageblock units instead of MAX= _ORDER To: Cc: , , , , , = , , , , , Message-ID: <20211213094135.1798-2-mark-pk.tsai@mediatek.com> From: Mike Rapoport [ Upstream commit e2a86800d58639b3acde7eaeb9eb393dca066e08 ] 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 @@ -315,11 +315,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 @@ -329,11 +329,11 @@ 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(end, MAX_ORDER_NR_PAGES); + prev_end =3D ALIGN(end, 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.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