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 X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFAE8C433DB for ; Thu, 11 Mar 2021 09:33:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 54D3864FB0 for ; Thu, 11 Mar 2021 09:33:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54D3864FB0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D255C8D02A3; Thu, 11 Mar 2021 04:33:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CFC6F8D028E; Thu, 11 Mar 2021 04:33:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC4AE8D02A3; Thu, 11 Mar 2021 04:33:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id A3C9C8D028E for ; Thu, 11 Mar 2021 04:33:09 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 69883181AF5CA for ; Thu, 11 Mar 2021 09:33:09 +0000 (UTC) X-FDA: 77907079698.18.3EF0F83 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP id B9A348019140 for ; Thu, 11 Mar 2021 09:33:01 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 071E164F4D; Thu, 11 Mar 2021 09:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615455187; bh=dh01iKnMh12GRgQjnoaGZLEPlCzGpVYYPsx3ni+tdT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D96/AvS+OpjlahZ4Rje/9KkDOawCIc0aRIuvfE2mBz8unqx2BWZao4vYZdnCKR3cC Mqds9QGdhCfbaVkOtbk1ObIxlHAXBFvNTeWBMuiYsOpexnpb3CO4fKMdNYCqYPzc+m GbwuMx/9zeMNzyxyON8bcyAKno/+Xv4x7VYpLZ6qaWduG+AC3fSZoyJeB/gFhbRwuh 72Ibx0EOUjzvcy4EMYuOdrUhpmx+dZcF6wFzOROxE41Ot8Gc+43RgcVTCLHi01BFKc d0Q3SDeNFb9OF6aSAqf+5dXFZsL8RtqzPuHhZrdNwQDAoopzP40vTgiJzNHrnD8HRG +LTOkUx0g35Rw== Date: Thu, 11 Mar 2021 09:33:02 +0000 From: Will Deacon To: Anshuman Khandual Cc: Mike Rapoport , linux-mm@kvack.org, Russell King , Catalin Marinas , Andrew Morton , David Hildenbrand , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] mm: Enable generic pfn_valid() to handle early sections with memmap holes Message-ID: <20210311093302.GA30603@willie-the-truck> References: <1615174073-10520-1-git-send-email-anshuman.khandual@arm.com> <003d8a4b-9687-3e9a-c27b-908db280b44c@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003d8a4b-9687-3e9a-c27b-908db280b44c@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: rfsioh1owst5oh7rjgjuao6pmbpihwod X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B9A348019140 Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615455181-636781 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 Thu, Mar 11, 2021 at 01:22:53PM +0530, Anshuman Khandual wrote: > On 3/8/21 2:25 PM, Mike Rapoport wrote: > > On Mon, Mar 08, 2021 at 08:57:53AM +0530, Anshuman Khandual wrote: > >> Platforms like arm and arm64 have redefined pfn_valid() because their early > >> memory sections might have contained memmap holes caused by memblock areas > >> tagged with MEMBLOCK_NOMAP, which should be skipped while validating a pfn > >> for struct page backing. This scenario could be captured with a new option > >> CONFIG_HAVE_EARLY_SECTION_MEMMAP_HOLES and then generic pfn_valid() can be > >> improved to accommodate such platforms. This reduces overall code footprint > >> and also improves maintainability. > > > > I wonder whether arm64 would still need to free parts of its memmap after > > free_unused_memmap() is applicable when CONFIG_SPARSEMEM_VMEMMAP is not enabled. > I am not sure whether there still might be some platforms or boards which would > benefit from this. Hence lets just keep this unchanged for now. In my opinion, unless there's a compelling reason for us to offer all of these different implementations of the memmap on arm64 then we shouldn't bother -- it's not like it's fun to maintain! Just use sparsemem vmemmap and be done with it. Is there some reason we can't do that? Will