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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 737FCC43460 for ; Thu, 8 Apr 2021 06:28:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA240608FC for ; Thu, 8 Apr 2021 06:28:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA240608FC 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 660826B0080; Thu, 8 Apr 2021 02:28:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 611376B0081; Thu, 8 Apr 2021 02:28:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B0A96B0082; Thu, 8 Apr 2021 02:28:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id 32F0C6B0080 for ; Thu, 8 Apr 2021 02:28:04 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DE95F18017364 for ; Thu, 8 Apr 2021 06:28:03 +0000 (UTC) X-FDA: 78008219646.32.5AA7848 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id B35F540002D3 for ; Thu, 8 Apr 2021 06:28:00 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A635060FF0; Thu, 8 Apr 2021 06:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617863282; bh=3CBGbTus3iyR2kStFocLAP1r4ANkWnNDiwwXO2RQGeg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MZPw56dGGoMb4dr8Sk+waAmCBW4XnztSdMy2AmqsReqPn7qirRduRdE+gaFWDV327 DXlU2nF6tbnW972PCgHgbmp9alr1jdTIZ00s4O7n06eOtls0z5W5o6tlJjyZh5j7Z2 814rcMgrxxRsrz1GtyL5hPwsUimhylJ0vct9CeIaq9OBEUyn4zdkP3eMLFrSgH5IxP 4B9+0SMBFFX7lbg/GOWrQ4eMNOAHfsjm91i6uF5/NyZTFfAPFpeXq7r4v6A1Pz/E1k wAXqRekhgYwjfF/i/bAxi2JEiNtsCTULy1e8sNFZaOBWAp9qmlcQhng2zLNOzwbio5 cCiSXbIkCEy6g== Date: Thu, 8 Apr 2021 09:27:53 +0300 From: Mike Rapoport To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Catalin Marinas , David Hildenbrand , Marc Zyngier , Mark Rutland , Mike Rapoport , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mm@kvack.org, James Morse Subject: Re: [RFC/RFT PATCH 0/3] arm64: drop pfn_valid_within() and simplify pfn_valid() Message-ID: References: <20210407172607.8812-1-rppt@kernel.org> <2f68ea11-7c56-1c55-f0be-3aad7188c00a@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f68ea11-7c56-1c55-f0be-3aad7188c00a@arm.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B35F540002D3 X-Stat-Signature: c9tppwxb9ax3x9b5ui3irdw7nxqrofh9 Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617863280-558565 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, Apr 08, 2021 at 10:49:02AM +0530, Anshuman Khandual wrote: > Adding James here. > > + James Morse > > On 4/7/21 10:56 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Hi, > > > > These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire > > pfn_valid_within() to 1. > > That would be really great for arm64 platform as it will save CPU cycles on > many generic MM paths, given that our pfn_valid() has been expensive. > > > > > The idea is to mark NOMAP pages as reserved in the memory map and restore > > Though I am not really sure, would that possibly be problematic for UEFI/EFI > use cases as it might have just treated them as normal struct pages till now. I don't think there should be a problem because now the struct pages for UEFI/ACPI never got to be used by the core mm. They were (rightfully) skipped by memblock_free_all() from one side and pfn_valid() and pfn_valid_within() return false for them in various pfn walkers from the other side. > > the intended semantics of pfn_valid() to designate availability of struct > > page for a pfn. > > Right, that would be better as the current semantics is not ideal. > > > > > With this the core mm will be able to cope with the fact that it cannot use > > NOMAP pages and the holes created by NOMAP ranges within MAX_ORDER blocks > > will be treated correctly even without the need for pfn_valid_within. > > > > The patches are only boot tested on qemu-system-aarch64 so I'd really > > appreciate memory stress tests on real hardware. > > Did some preliminary memory stress tests on a guest with portions of memory > marked as MEMBLOCK_NOMAP and did not find any obvious problem. But this might > require some testing on real UEFI environment with firmware using MEMBLOCK_NOMAP > memory to make sure that changing these struct pages to PageReserved() is safe. I surely have no access for such machines :) > > If this actually works we'll be one step closer to drop custom pfn_valid() > > on arm64 altogether. > > Right, planning to rework and respin the RFC originally sent last month. > > https://patchwork.kernel.org/project/linux-mm/patch/1615174073-10520-1-git-send-email-anshuman.khandual@arm.com/ -- Sincerely yours, Mike.