From patchwork Tue Feb 2 04:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12060593 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=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 EEA23C433DB for ; Tue, 2 Feb 2021 04:11:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7101A64E94 for ; Tue, 2 Feb 2021 04:11:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7101A64E94 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E552C6B0075; Mon, 1 Feb 2021 23:11:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E06106B0078; Mon, 1 Feb 2021 23:11:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1C476B007B; Mon, 1 Feb 2021 23:11:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id BC5FF6B0075 for ; Mon, 1 Feb 2021 23:11:39 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8AA85362E for ; Tue, 2 Feb 2021 04:11:39 +0000 (UTC) X-FDA: 77772003918.07.baby70_5d0b538275c7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 7296A1803F9A3 for ; Tue, 2 Feb 2021 04:11:39 +0000 (UTC) X-HE-Tag: baby70_5d0b538275c7 X-Filterd-Recvd-Size: 3085 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Feb 2021 04:11:38 +0000 (UTC) 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 6341A147A; Mon, 1 Feb 2021 20:11:37 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 73C9F3F66E; Mon, 1 Feb 2021 20:11:32 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Robin Murphy , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Dan Williams , David Hildenbrand , Mike Rapoport Subject: [PATCH V2 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory Date: Tue, 2 Feb 2021 09:41:52 +0530 Message-Id: <1612239114-28428-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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 series fixes pfn_valid() for ZONE_DEVICE based memory and also improves its performance for normal hotplug memory. While here, it also reorganizes pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.11-rc6. Question - should pfn_section_valid() be tested both for boot and non boot memory as well ? Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Mark Rutland Cc: James Morse Cc: Robin Murphy Cc: Jérôme Glisse Cc: Dan Williams Cc: David Hildenbrand Cc: Mike Rapoport Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Changes in V2: - Dropped pfn_valid() bifurcation based on CONFIG_SPARSEMEM - Used PFN_PHYS() and PHYS_PFN() instead of __pfn_to_phys() and __phys_to_pfn() - Moved __pfn_to_section() inside #ifdef CONFIG_SPARSEMEM with a { } construct Changes in V1: https://lore.kernel.org/linux-mm/1611905986-20155-1-git-send-email-anshuman.khandual@arm.com/ - Test pfn_section_valid() for non boot memory Changes in RFC: https://lore.kernel.org/linux-arm-kernel/1608621144-4001-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (2): arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory arm64/mm: Reorganize pfn_valid() arch/arm64/mm/init.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)