From patchwork Mon Jun 15 03:37:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11603713 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74DE9913 for ; Mon, 15 Jun 2020 03:38:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4401B20747 for ; Mon, 15 Jun 2020 03:38:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4401B20747 Authentication-Results: mail.kernel.org; dmarc=none (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 2EFB86B0002; Sun, 14 Jun 2020 23:38:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 27A9D6B0003; Sun, 14 Jun 2020 23:38:23 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F3F36B0005; Sun, 14 Jun 2020 23:38:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id E4A2E6B0002 for ; Sun, 14 Jun 2020 23:38:22 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 66E03181AC9BF for ; Mon, 15 Jun 2020 03:38:22 +0000 (UTC) X-FDA: 76930038444.26.dolls20_1a00f9826df3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 3E2C01804B655 for ; Mon, 15 Jun 2020 03:38:22 +0000 (UTC) X-Spam-Summary: 50,0,0,6ac384487a14cc54,d41d8cd98f00b204,anshuman.khandual@arm.com,,RULES_HIT:41:355:379:541:800:960:966:967:973:982:988:989:1260:1261:1345:1431:1437:1535:1544:1711:1730:1747:1777:1792:1801:1963:2196:2199:2393:2525:2560:2565:2682:2685:2693:2859:2895:2897:2899:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3167:3355:3865:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4117:4250:4321:4385:4605:5007:6119:6261:6742:6743:7875:7903:8634:9010:9025:10004:11026:11232:11473:11658:11914:12043:12291:12296:12297:12438:12555:12895:12986:13161:13200:13229:13846:14096:14181:14394:14721:21080:21220:21451:21627:21740:21788:30054:30069:30070,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: dolls20_1a00f9826df3 X-Filterd-Recvd-Size: 6359 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Jun 2020 03:38:21 +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 9E9E631B; Sun, 14 Jun 2020 20:38:20 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.79.186]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 687243F71F; Sun, 14 Jun 2020 20:38:10 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: christophe.leroy@c-s.fr, ziy@nvidia.com, gerald.schaefer@de.ibm.com, Anshuman Khandual , Jonathan Corbet , Andrew Morton , Mike Rapoport , Vineet Gupta , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Kirill A . Shutemov" , Paul Walmsley , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 0/4] mm/debug_vm_pgtable: Add some more tests Date: Mon, 15 Jun 2020 09:07:53 +0530 Message-Id: <1592192277-8421-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-Rspamd-Queue-Id: 3E2C01804B655 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 adds some more arch page table helper validation tests which are related to core and advanced memory functions. This also creates a documentation, enlisting expected semantics for all page table helpers as suggested by Mike Rapoport previously (https://lkml.org/lkml/2020/1/30/40). There are many TRANSPARENT_HUGEPAGE and ARCH_HAS_TRANSPARENT_HUGEPAGE_PUD ifdefs scattered across the test. But consolidating all the fallback stubs is not very straight forward because ARCH_HAS_TRANSPARENT_HUGEPAGE_PUD is not explicitly dependent on ARCH_HAS_TRANSPARENT_HUGEPAGE. Tested on arm64, x86 platforms but only build tested on all other enabled platforms through ARCH_HAS_DEBUG_VM_PGTABLE i.e powerpc, arc, s390. The following failure on arm64 still exists which was mentioned previously. It will be fixed with the upcoming THP migration on arm64 enablement series. WARNING .... mm/debug_vm_pgtable.c:860 debug_vm_pgtable+0x940/0xa54 WARN_ON(!pmd_present(pmd_mkinvalid(pmd_mkhuge(pmd)))) This series is based on v5.8-rc1. Changes in V3: - Replaced HAVE_ARCH_SOFT_DIRTY with MEM_SOFT_DIRTY - Added HAVE_ARCH_HUGE_VMAP checks in pxx_huge_tests() per Gerald - Updated documentation for pmd_thp_tests() per Zi Yan - Replaced READ_ONCE() with huge_ptep_get() per Gerald - Added pte_mkhuge() and masking with PMD_MASK per Gerald - Replaced pte_same() with holding pfn check in pxx_swap_tests() - Added documentation for all (#ifdef #else #endif) per Gerald - Updated pmd_protnone_tests() per Gerald - Updated HugeTLB PTE creation in hugetlb_advanced_tests() per Gerald - Replaced [pmd|pud]_mknotpresent() with [pmd|pud]_mkinvalid() - Added has_transparent_hugepage() check for PMD and PUD tests - Added a patch which debug prints all individual tests being executed - Updated documentation for renamed [pmd|pud]_mkinvalid() helpers Changes in V2: (https://patchwork.kernel.org/project/linux-mm/list/?series=260573) - Dropped CONFIG_ARCH_HAS_PTE_SPECIAL per Christophe - Dropped CONFIG_NUMA_BALANCING per Christophe - Dropped CONFIG_HAVE_ARCH_SOFT_DIRTY per Christophe - Dropped CONFIG_MIGRATION per Christophe - Replaced CONFIG_S390 with __HAVE_ARCH_PMDP_INVALIDATE - Moved page allocation & free inside swap_migration_tests() per Christophe - Added CONFIG_TRANSPARENT_HUGEPAGE to protect pfn_pmd() - Added CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD to protect pfn_pud() - Added a patch for other arch advanced page table helper tests - Added a patch creating a documentation for page table helper semantics Changes in V1: (https://patchwork.kernel.org/patch/11408253/) Cc: Jonathan Corbet Cc: Andrew Morton Cc: Mike Rapoport Cc: Vineet Gupta Cc: Catalin Marinas Cc: Will Deacon Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Kirill A. Shutemov Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: linux-snps-arc@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: x86@kernel.org Cc: linux-mm@kvack.org Cc: linux-doc@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (4): mm/debug_vm_pgtable: Add tests validating arch helpers for core MM features mm/debug_vm_pgtable: Add tests validating advanced arch page table helpers mm/debug_vm_pgtable: Add debug prints for individual tests Documentation/mm: Add descriptions for arch page table helpers Documentation/vm/arch_pgtable_helpers.rst | 258 +++++++++ mm/debug_vm_pgtable.c | 660 +++++++++++++++++++++- 2 files changed, 916 insertions(+), 2 deletions(-) create mode 100644 Documentation/vm/arch_pgtable_helpers.rst Tested-by: Vineet Gupta