From patchwork Wed May 1 14:44:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13650805 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 96433C4345F for ; Wed, 1 May 2024 14:44:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ECB326B0088; Wed, 1 May 2024 10:44:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E792D6B0089; Wed, 1 May 2024 10:44:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D67566B008C; Wed, 1 May 2024 10:44:52 -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 B79516B0088 for ; Wed, 1 May 2024 10:44:52 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 550391C1243 for ; Wed, 1 May 2024 14:44:52 +0000 (UTC) X-FDA: 82070098824.02.BFEEA55 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf03.hostedemail.com (Postfix) with ESMTP id C6CCE20024 for ; Wed, 1 May 2024 14:44:50 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@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=1714574690; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=2xw5/CuMiMIZPE5VJbomvsAFs/Sm8+1nt7V0B21jdCE=; b=lgUbGcQcWUe+JCU5rlKgnkn9PzSvPnpU6qp69Z2/pEgDBwhojlWUA2abv7F2tbDXz5+Eyt fkOVVOVmKyRPbef4DbABSnCWxUzmJPOmZWP+SRKxQi29bKr4K3cfeRwDiQ0mQm40+xJJtT MhVK47q0mp7REr6j3dOD/QNibK0Y1Pw= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714574690; a=rsa-sha256; cv=none; b=Rj9nLJ9ZrKjvlCzBRdwLoYZIGFQrJlHybOcuOsHQ3tx0Wp+SSMDoNUfKhQO0jpUVfGhOed FKemkxXqTHbdwcWJFJuInqrVZnLjET+/hq7+VT/ClPv9yMh62dDgWeiiG2A2k119HnTWrc BsyNAmZbvHXaPjhWBLYsn8btVUkYZgE= 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 DCEA72F4; Wed, 1 May 2024 07:45:15 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0CF3B3F71E; Wed, 1 May 2024 07:44:48 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , Catalin Marinas , Anshuman Khandual Cc: Ryan Roberts , linux-mm@kvack.org Subject: [PATCH v1] mm/debug_vm_pgtable: Test pmd_leaf() behavior with pmd_mkinvalid() Date: Wed, 1 May 2024 15:44:39 +0100 Message-Id: <20240501144439.1389048-1-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: C6CCE20024 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 941c3josoqajcacayhoikihc9qu5k1mr X-HE-Tag: 1714574690-469176 X-HE-Meta: U2FsdGVkX199iE1j45C4kOYLyjmDFzFfpqGBDNWtPolS5ZhRv2nOf0LBW8LFLPN/54MqwIb5NAXXXuLd8iEmEMdbwEK0tqBbE9r1uI5WSXbR+rC61WUTzzuxN6+4Tzs9uQm97x6TFG2/JBG9NgDw0rWV1mUyLbUXW65O5OTTFzssatEDbQ/zcCqFRKd88xwbWeN++V5Xj2sfu2lFVfTBHbkTrQuQ735rpwMRyYQCBfTafyyCj9oXhlfulhsqwWhu9L6wGwH3p7sa7p+yTn3GZmiSAUCF3h/8yNgd3RHfp1PeQojZwO3QRb8KH82DKtVXaLSJnpP/sF6OZ+5PtDdBahysBR5UmvCTW8AEGTh2mxUQ/RMYuvCffdKZkIWL9qA2pogl0/DyPyZ51nuNgl3gNaVo1uZH54TXxw0/QGGi5QIJPMm92fVJT1DvzLquPNlzgRUuzPp4qsyHzROKuPod2qI95lRd0daG930zbNo8xg9slaK8x7Mzx87nRFvpAquhIQ0RRk+h/59VgfY9mUFukq6b0cS80UNaBSAFP1kODqAqkarFbPXSG+sb+fcTTQzdtXktyVukoIS2+lzzuaRxiIhEq55uEC7K18VkIw6uq4/TEkAEdhs/3u6jiw8QXNfii0BFPfhAQ2/ZU69GSfRQrkzcX3Ce+19ZlpiBV+9mwdrbneY1R5a11kpWXMWf03fiA4GW08xBqNWL/TVvtVJjeKRQCkMl3t8VkdzKXuJmz7CWo3ASpwh/0zISs3ryoc6nbEWsZPDduyWcyj/JcTcn9UMTkaQ+FVfkTcKzMfkIVEg0El23/IDoDrxiXNJ/StF2VDCXr0jjkrExlqT8B63ijzksLCs/Dzoqpx/fkgtNwg00VBBi/KY7ECcGnYg1g10taOqsj30UDdTnfB6fr4W12dAEOMKswrWClZg34oxPUVjU/9BGaJ6rkvtpzGUEBJ2hDsWT81rHBejXfoEFoyH 72z6Neac V3ILuO4pN2qb6lvAb8UQvBkPpbeXFUmYmTT2wqqdneKLHa9DwA6WhLmUl4nUqQ88sbZRUTiCoN6e6ITPzdlPwR0cC11OgAN7rX6rkLw53CB8kAeQl32RSKOIrccavrpbbujmpTYQBFdGqWJCocKuLwdoptg0CYT72bk7K5FW0bc7sABs9xTWSUdXqM8xMmT1W0EtoPXf47GusFZM= 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: An invalidated pmd should still cause pmd_leaf() to return true. Let's test for that to ensure all arches remain consistent. Signed-off-by: Ryan Roberts Reviewed-by: Anshuman Khandual Reviewed-by: David Hildenbrand --- 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. Thanks, Ryan mm/debug_vm_pgtable.c | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 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 */ }