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 8AD0EC433F5 for ; Mon, 13 Dec 2021 10:31:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A2D86B0071; Mon, 13 Dec 2021 05:31:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 92AFE6B0073; Mon, 13 Dec 2021 05:31:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CBA26B0074; Mon, 13 Dec 2021 05:31:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 6A2FC6B0071 for ; Mon, 13 Dec 2021 05:31:29 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 24D91180B3E15 for ; Mon, 13 Dec 2021 10:31:19 +0000 (UTC) X-FDA: 78912403878.25.0A489E0 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf06.hostedemail.com (Postfix) with ESMTP id EABBB180013 for ; Mon, 13 Dec 2021 10:31:17 +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 CAF8EB81071; Mon, 13 Dec 2021 10:31:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C450BC34601; Mon, 13 Dec 2021 10:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639391475; bh=YqTqbD22bE3nbM3gT9uMbugvqLUIVy1xvqjX4jOnawo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VnSTRR8x0Qi3FwpeicOeUIzpUGuXMcdl8//Eixs5/LlOJ42Wqsf1Bpxiw1/v5DvvQ u9XyrnMcbnZa8ldqRHNNy/FpFgHA3PYJy6yVkDyb8n5wlS3zjAB6BdZNmpIBJI0j+w hZ/Ht2+Mws4JlRQU7vWC/istzB7AQXvey27yhFKb2faxntxTKGBXcJSMjLUYP75HL1 sze5PsU/Db9Qk8XqWQrKyomukom+2bdWtlTC+B112b8kTJbrprUY8wFdNdTZy1bzGa ktK6VcMq2zCJ2HEPuDIEUyd+DnuI1CmKH5G7CsVBS9XwR0ep1k6FqUsEUBlUvPAEAs yD6oHRRyRj0bQ== Date: Mon, 13 Dec 2021 12:31:05 +0200 From: Mike Rapoport To: Mark-PK Tsai Cc: stable@vger.kernel.org, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@armlinux.org.uk, rppt@linux.ibm.com, tony@atomide.com, wangkefeng.wang@huawei.com, yj.chiang@mediatek.com Subject: Re: [PATCH 5.4 1/5] memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER Message-ID: References: <20211213085710.28962-1-mark-pk.tsai@mediatek.com> <20211213085710.28962-2-mark-pk.tsai@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211213085710.28962-2-mark-pk.tsai@mediatek.com> X-Stat-Signature: kzz5kdtuazhcm1hbzd33n1x8ayzr43ot Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VnSTRR8x; spf=pass (imf06.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: EABBB180013 X-HE-Tag: 1639391477-187524 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: On Mon, Dec 13, 2021 at 04:57:06PM +0800, Mark-PK Tsai wrote: > Subject: [PATCH 5.4 1/5] memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER I'd replace memblock: with arm: in the subject. I believe it's clearer this way. The same applies for the second patch in the series and for 5.10 posting. > 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 common > notation thought mm code. > > Replace MAX_ORDER_NR_PAGES with pageblock_nr_pages and update the comments > 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 > --- > arch/arm/mm/init.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index 7ea4d3b43444..6905dd8bc03f 100644 > --- a/arch/arm/mm/init.c > +++ b/arch/arm/mm/init.c > @@ -381,11 +381,11 @@ static void __init free_unused_memmap(void) > 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 = round_down(start, MAX_ORDER_NR_PAGES); > + start = round_down(start, pageblock_nr_pages); > #endif > /* > * If we had a previous bank, and there is a space > @@ -395,12 +395,12 @@ static void __init free_unused_memmap(void) > free_memmap(prev_end, start); > > /* > - * 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 = ALIGN(memblock_region_memory_end_pfn(reg), > - MAX_ORDER_NR_PAGES); > + pageblock_nr_pages); > } > > #ifdef CONFIG_SPARSEMEM > -- > 2.18.0 > -- Sincerely yours, Mike.