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 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 70C2FC433B4 for ; Thu, 8 Apr 2021 06:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4170C6113E for ; Thu, 8 Apr 2021 06:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbhDHG2O (ORCPT ); Thu, 8 Apr 2021 02:28:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:37018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhDHG2N (ORCPT ); Thu, 8 Apr 2021 02:28:13 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 6D5C1C433B4 for ; Thu, 8 Apr 2021 06:28:08 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id ADD3261165 for ; Thu, 8 Apr 2021 06:28:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADD3261165 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3ACEB4BA22; Thu, 8 Apr 2021 02:28:07 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gDZPCTrLxlOp; Thu, 8 Apr 2021 02:28:06 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1AB674BA56; Thu, 8 Apr 2021 02:28:06 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D55AA4BA4D for ; Thu, 8 Apr 2021 02:28:04 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RVxJgy--hRMZ for ; Thu, 8 Apr 2021 02:28:03 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8C4D84BA22 for ; Thu, 8 Apr 2021 02:28:03 -0400 (EDT) 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 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-Disposition: inline In-Reply-To: <2f68ea11-7c56-1c55-f0be-3aad7188c00a@arm.com> Cc: David Hildenbrand , Catalin Marinas , linux-kernel@vger.kernel.org, Mike Rapoport , linux-mm@kvack.org, kvmarm@lists.cs.columbia.edu, Marc Zyngier , Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 D736BC43460 for ; Thu, 8 Apr 2021 06:29:33 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C1CB608FC for ; Thu, 8 Apr 2021 06:29:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C1CB608FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=E5vDbFQ6awMU0w/lXJZUJ7tLPXYsGmO7T87c3P0TnLc=; b=GsH0/M4T2q56EANUSwWxtRGz4 j8Kr1L6gYJqgcIoJLS1AEKFP8e1se24QFYeHwDKOTm0PnSdo1w3oVZ81Kjka3NuoTIJCmSRkK30Em Yr92kQnx4r8ck7v0+gmnFyXZF6DrU3Mw8w3zX3nzMRspi3wHOsHEZOdCscG/0kwEndXCEl2r1/2JE IklaLWxTeGKf1hWx2GNy0m0r+ayhu+o4TlK9cKK9UHfZ/PUkcOydQSzlX4M//vRHqtr8r3yj6oidY pkYEu619LDPD/xQy75SvsHXFjDgi0e6H+91/BbcHVwISKJs7vjAigw8QsHgg15G8PwC0jrZSbdRaN 0SQM1h5DA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUO9E-0075Up-6q; Thu, 08 Apr 2021 06:28:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUO97-0075TD-TM for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 06:28:09 +0000 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-Disposition: inline In-Reply-To: <2f68ea11-7c56-1c55-f0be-3aad7188c00a@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_072806_832690_BD370E55 X-CRM114-Status: GOOD ( 26.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel