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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC211C4345F for ; Thu, 2 May 2024 08:03:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F7016B0089; Thu, 2 May 2024 04:03:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A8176B008A; Thu, 2 May 2024 04:03:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0962D6B008C; Thu, 2 May 2024 04:03:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id DE6586B0089 for ; Thu, 2 May 2024 04:03:16 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 92643120A12 for ; Thu, 2 May 2024 08:03:16 +0000 (UTC) X-FDA: 82072715592.07.9686392 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf11.hostedemail.com (Postfix) with ESMTP id D32A04001A for ; Thu, 2 May 2024 08:03:14 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714636995; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TUd3231nh3DMA/oJSDow0Wm69ev0RiaOCgxTmRP1sYg=; b=B2H7GMkBNgCnIRngzYNoAgDc9daf/qxhXx5vO3bITTX3mpbyuQVwxZV9Ce1pZhAzN5p67Z bA5Mbz5Vg3hchSUXpbS4ndbQqN15sYTmOH6cceS0EpkkepuM8hGNct4MHQm4rtxbAtukQE 1+bMUnQxICISmcL7Eo/W5tL0e28dJI8= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714636995; a=rsa-sha256; cv=none; b=aHPIXDq4H0+Yy3rj2fnBcSgtpDZWLXlMOPxAsZKyrunkDzPgLjg/ysgPtD/RDw60XNbxzN /zkcslU7lgDdm+monOaUfb0wewpbKFWHpo7IX8vOea50/dBXHKayxRgU6y2QeSha0OFOn9 1neQ1M3hZDxiH8m/OT55FmcPnjfi6pQ= 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 988482F4; Thu, 2 May 2024 01:03:39 -0700 (PDT) Received: from [10.162.42.72] (a077893.blr.arm.com [10.162.42.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 747F43F71E; Thu, 2 May 2024 01:03:12 -0700 (PDT) Message-ID: <2128d3d7-0dc4-4e81-a1e2-a8a67f0d36ed@arm.com> Date: Thu, 2 May 2024 13:33:09 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] mm/debug_vm_pgtable: Test pmd_leaf() behavior with pmd_mkinvalid() Content-Language: en-US To: Ryan Roberts , Andrew Morton , Catalin Marinas Cc: linux-mm@kvack.org References: <20240501144439.1389048-1-ryan.roberts@arm.com> From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D32A04001A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: eaqhfoiwwktxdbcf3qiahsmdzmmbkxnd X-HE-Tag: 1714636994-890638 X-HE-Meta: U2FsdGVkX1/RJiZrSH0qdfSwcLnCMmOeK4f0xlwMLPSk9qQh17lP6zcf6k1Gmre12dW/c///ujhBsDGZkFYtuBXVcyt9lmOl02PbVXD0o/ygWx69W0Lo0Rdxo6W+FyTN6J8YiMTsGUC4dW+03rgPsHDTvdLoc4WWQ6jLODjLOn5vPJgV3WsLfnpKC2oabTfMRmdlPkeSzCPoq6DBzNSl4QU68iXc2y4MvMFK9LWrmp0TpevOvUusONjg9nP3JCXCEbBI+fuOGyVA1fgVkTeHyisK68EwJuOaXUARob6NUgutMJ4D8+yBQfx3EUARqZtpt96bYlsTKoFdf5T6EX2XNdb1aXrLyfbX2APH3+Fl/I2+SCEdyQBzxx4pxCaKtUJbs7cGJ7G7m5d515HXDajt5IQalyRlTEXKifk9P2f+kLS7d0he0qfid/kYZRW3khhwvuKkttMJyf850f73g8aODztXpUxsXaQMQ4VaGXP015F52kFhdovcMKQIc1LQ74nwMCOANw/L+RNvSXW7nAxvPiR0fAsJyfj9qMniCzimAUqz46pqBxGtjy/2/C2mcKwzK73gSKTAlxlxyZ2cIhUO7p5TaHVq1/s8MAzGA0xdLbPTua/LmYB+A28vOBeYa8XdpLGY4OUoHB84oqP3I7sgMiJDyiJl9lE3ZqfyPzTCUvf+WrvOKAAACwb6bO6yjTWrqmtjjWnJieviMZASdql3bfYAW4lYBTKj53LC95xtayvmZXinppQbtTWGzSRLMtjjAI2VSVBOHNIOTOJtNmi2iHHEZwHvZ5Hm2KrIz+tN/3SUSeHv6gCrwsFx7qKv7Exgg7nsqYZ4crIk2J+2oW6SAdCmWTlarRxRFhxF7qDYj8F1SzJ245ibkSwB7h+uZuDfJmJXpA5zt3QXd5K/6b6++3x5Gz9lWaEecVstgGQVbPK5FQXbkj5bd2z+fpVQnjjpFFajQh56LPE3cTcElgN uYfXgqh2 AfH5LXMIF72y1/FMQrNyWQ/r4xEu1cmwsCyfTCYIrxsrAmcgJwH+u88TJtJx9CRUcE+Of4LsMuEkMaKBuMuv5QKInsV5uQzJBm/+yeNWpeWavb8NueVLRYORY0Qmv3fX/90wqSckEg5LqqdqBANWhSTIBu60Uyv6hwGidmGQpmdyaWNC4DonTQLMLt+NMYSkHXH8NsqC1jFCd8cwrGm5xcJOQDAxjxWfy6xCnupI5Cc3KICiqxOdgqvYgXr9l7RId4tCT 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: List-Subscribe: List-Unsubscribe: On 5/2/24 13:00, Ryan Roberts wrote: > On 02/05/2024 03:43, Anshuman Khandual wrote: >> Hello Ryan, >> >> On 5/1/24 20:14, Ryan Roberts wrote: >>> An invalidated pmd should still cause pmd_leaf() to return true. Let's >>> test for that to ensure all arches remain consistent. >> >> This test definitely makes sense. >> >>> >>> Signed-off-by: Ryan Roberts >>> --- >>> >>> Hi Andrew, >>> >>> This applies on top of v6.9-rc5. It came out of a discussion with Catalin around >>> the pmd_mkinvalid() bug (the fix for which I just posted). I've run the new test >>> on both arm64 and x86_64. >> >> Right, works on arm64. >> >>> >>> Thanks, >>> Ryan >>> >>> mm/debug_vm_pgtable.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c >>> index 65c19025da3d..57e9cb0820ab 100644 >>> --- a/mm/debug_vm_pgtable.c >>> +++ b/mm/debug_vm_pgtable.c >>> @@ -981,6 +981,7 @@ static void __init pmd_thp_tests(struct pgtable_debug_args *args) >>> #ifndef __HAVE_ARCH_PMDP_INVALIDATE >>> WARN_ON(!pmd_trans_huge(pmd_mkinvalid(pmd_mkhuge(pmd)))); >>> WARN_ON(!pmd_present(pmd_mkinvalid(pmd_mkhuge(pmd)))); >>> + WARN_ON(!pmd_leaf(pmd_mkinvalid(pmd_mkhuge(pmd)))); >>> #endif /* __HAVE_ARCH_PMDP_INVALIDATE */ >>> } >> >> Should not we update descriptions in Documentation/mm/arch_pgtable_helpers.rst >> asserting that pmd_mkinvalid() also preserves pmd_leaf() ? > > Thanks for the review! > > We don't document that pmd_mkinvalid() preserves pmd_present() and > pmd_trans_huge() so I wasn't sure how much detail was appropriate in that > document - its pretty light at the moment. For all other helpers documentation has been light but pxd_mkinvalid() is turning out to be a special case though. > > If you think this is valuable (and isn't clear enough from the test) then I can > add something. But as you say in the other patch, it would then start > conflicting with that. I'd prefer to just put this in as-is to avoid the mess. Sure, fair enough. I will try and update how pmd_mkinvalid() preserves pmd_leaf(), pmd_present(), and pmd_trans_huge() at a later point. Otherwise this patch itself LGTM and runs fine on arm64. Reviewed-by: Anshuman Khandual