Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3A12C61DA4 for ; Thu, 23 Feb 2023 03:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ig6+AWF2hvoHvQmnjY9AH3jeqNim+QYv+3T8C6fS/b8=; b=rsf3OXtN5AiwPe pqHd6XovWJLyA0HL/VYI+KvLgFE3mNOKxx9NwdLs/JSQC6zPk2TdYwhvk8De4AXG0ka4PY+xATC5I 6FX0cZKwGYncpC4xTRuG8n7vk2zP+07oXYIHVLnZhpYA2vur8bQ9iwWNpVyBanMNHFkk8ZOUL8HZ5 THxF2Wom/vXzhKnkrHFG2i2MRA4CySVxZO0cOcV4yV36mgLSFBZz06A4PuRSIZ/yHJoJEZ98nuj34 QvO4hCPDbNNRgP+dTCwS4KBx6w5ifD7Og+3UR7M45RMNAMNlxZhQPlbAlnzRwsO70qeZCeVOUtI6o gUc22YkRwVnK0nLBTWxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pV2C2-00Erda-Nx; Thu, 23 Feb 2023 03:22:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pV2By-00Ercp-8C for linux-arm-kernel@lists.infradead.org; Thu, 23 Feb 2023 03:22:48 +0000 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 438EBC14; Wed, 22 Feb 2023 19:23:21 -0800 (PST) Received: from [10.162.40.16] (unknown [10.162.40.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 512AD3F587; Wed, 22 Feb 2023 19:22:35 -0800 (PST) Message-ID: <8f91df80-203b-3ff0-7189-7cb0810c678b@arm.com> Date: Thu, 23 Feb 2023 08:52:33 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] arm64: mm: hugetlb: Disable HUGETLB_PAGE_OPTIMIZE_VMEMMAP Content-Language: en-US To: Catalin Marinas , linux-arm-kernel@lists.infradead.org Cc: Mark Rutland , Muchun Song , Will Deacon References: <20230222175232.540851-1-catalin.marinas@arm.com> From: Anshuman Khandual In-Reply-To: <20230222175232.540851-1-catalin.marinas@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230222_192246_391910_5268B82D X-CRM114-Status: GOOD ( 19.60 ) 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 2/22/23 23:22, Catalin Marinas wrote: > Revert the HUGETLB_PAGE_FREE_VMEMMAP selection from commit 1e63ac088f20 > ("arm64: mm: hugetlb: enable HUGETLB_PAGE_FREE_VMEMMAP for arm64") but > keep the flush_dcache_page() compound_head() change as it aligns with > the corresponding check in the __sync_icache_dcache() function. > > The original config option was renamed in commit 47010c040dec ("mm: > hugetlb_vmemmap: cleanup CONFIG_HUGETLB_PAGE_FREE_VMEMMAP*") to > HUGETLB_PAGE_OPTIMIZE_VMEMMAP and the flush_dcache_page() check was > further simplified by commit 2da1c30929a2 ("mm: hugetlb_vmemmap: delete > hugetlb_optimize_vmemmap_enabled()"). > > The reason for the revert is that the generic vmemmap_remap_pte() > function changes both the permissions (writeable to read-only) and the > output address (pfn) of the vmemmap ptes. This is deemed UNPREDICTABLE > by the Arm architecture without a break-before-make sequence (make the > PTE invalid, TLBI, write the new valid PTE). However, such sequence is > not possible since the vmemmap may be concurrently accessed by the > kernel. Disable the optimisation until a better solution is found. > > Signed-off-by: Catalin Marinas > Fixes: 1e63ac088f20 ("arm64: mm: hugetlb: enable HUGETLB_PAGE_FREE_VMEMMAP for arm64") > Cc: # 5.19.x > Cc: Muchun Song > Cc: Will Deacon > Cc: Anshuman Khandual > Link: https://lore.kernel.org/r/Y9pZALdn3pKiJUeQ@arm.com As per earlier discussions, this LGTM. Reviewed-by: Anshuman Khandual > --- > arch/arm64/Kconfig | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 619ab046744a..71c35178e017 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -100,7 +100,6 @@ config ARM64 > select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT > select ARCH_WANT_FRAME_POINTERS > select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36) > - select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_NO_INSTR > select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES > > base-commit: b61b82f81e095fe265b0614045d17b08e6ee5c72 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel