Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp127093pxf; Wed, 7 Apr 2021 22:20:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPJnseWWHYeZWlI/uogEzgonU/5bOYGYmrANFpf9uqOFU0TcrFfkjzqXLLE9XBW5+0aqqu X-Received: by 2002:a17:902:b113:b029:e8:f7c9:8f46 with SMTP id q19-20020a170902b113b02900e8f7c98f46mr6336741plr.77.1617859232520; Wed, 07 Apr 2021 22:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617859232; cv=none; d=google.com; s=arc-20160816; b=nPfuUu4AmrFnM9RvheYN0mzJduBX1gpEt8iicrJIuLjhak9p9vCZNwSnGiVHxc9amI NaC/M9+6YELOjaFHpieoV0Kb+lU7q+w7LgiQ5/ATySuXusHL+Ycnd1gxMXzqyqm4nsif EuTcVkSX0r1jH7Pt2Mogi/AMqN04VkGCQ1/2VZiXXZtRUJ+BCAoW7jsk0PhqtCqgXvIN p5bHZyJXPaQxn7ppIy7Pz7ObkBA++QBsseGm1zC9Ye4M0TMmsRo2QOsAenR1WtciQs5E Qz1/yYEkutgV2p5zTPwzQdR6fEZf8SxYozsfCEr3loTqGDXNbGfduf7b6F+Z6N5I8PEw yfOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=W4zee1784CYy6mQZOK9oZpsHreTtMOr5/zy0LgYuejU=; b=l3PbT21nCp3y6anpWeIXuwCEDqD4qMAihztbqo3t+O4RrSgpRLujtZSS+ZH3bZylFk 3otcCbzLS4TtkBLepz4YgbKsMxYIumTcJR0hY/zBcHL0otOtYvKxiDVGpduPSlRyEKxH TXEV31Xd9fq9GFEdjwgf4p1fK8zABEXB9v4RD6TnV8fFVoqlORKuMNcHKHfgE8/fFe26 uYLroObYkLElThqJHbc0oAs8WWJGk5ob46fjl7amUxA1TzOVq8X3BCPcU1c7QnNsMwFX EnX0HOiNmY896ftLb7UVDFGomV5+JI9+un2L6t6BoO4P5zs+CNiolNpb5I/1/PiDRaiO x1Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l25si26411355pgb.101.2021.04.07.22.20.20; Wed, 07 Apr 2021 22:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbhDHFS0 (ORCPT + 99 others); Thu, 8 Apr 2021 01:18:26 -0400 Received: from foss.arm.com ([217.140.110.172]:39490 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhDHFS0 (ORCPT ); Thu, 8 Apr 2021 01:18:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7B43C1424; Wed, 7 Apr 2021 22:18:15 -0700 (PDT) Received: from [10.163.67.84] (unknown [10.163.67.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C2EE3F73D; Wed, 7 Apr 2021 22:18:11 -0700 (PDT) From: Anshuman Khandual Subject: Re: [RFC/RFT PATCH 0/3] arm64: drop pfn_valid_within() and simplify pfn_valid() To: Mike Rapoport , linux-arm-kernel@lists.infradead.org Cc: 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 References: <20210407172607.8812-1-rppt@kernel.org> Message-ID: <2f68ea11-7c56-1c55-f0be-3aad7188c00a@arm.com> Date: Thu, 8 Apr 2021 10:49:02 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210407172607.8812-1-rppt@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. > > 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/