From patchwork Mon Jul 13 03:23:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11658627 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 D6DAF6C1 for ; Mon, 13 Jul 2020 03:23:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A82D520722 for ; Mon, 13 Jul 2020 03:23:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A82D520722 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 9846A8D0005; Sun, 12 Jul 2020 23:23:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 90CBE8D0002; Sun, 12 Jul 2020 23:23:52 -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 7D45F8D0005; Sun, 12 Jul 2020 23:23:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id 60D938D0002 for ; Sun, 12 Jul 2020 23:23:52 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CA9D6181AEF00 for ; Mon, 13 Jul 2020 03:23:51 +0000 (UTC) X-FDA: 77031608262.17.hook66_41030fb26ee5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 9FE22180D0185 for ; Mon, 13 Jul 2020 03:23:51 +0000 (UTC) X-Spam-Summary: 50,0,0,1f3ee5d6f73642f7,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:1605:1711:1730:1747:1777:1792:1801:1963:2196:2199:2393:2525:2560:2567:2682:2685:2693:2859:2895:2897:2899:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3167:3865:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4118: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:30064:30069:30070,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201;04y8wsu3jp8pfem54w8n74568u5opyprfnp63hacsdqa7jidq5wcwraqrfkewch.qamfuguciidea9gtuiitgd36goee7rfh7zehn98ksp6ut139krrx9naqr3npeao.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:n one,Doma X-HE-Tag: hook66_41030fb26ee5 X-Filterd-Recvd-Size: 7109 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Jul 2020 03:23:50 +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 EA64C1FB; Sun, 12 Jul 2020 20:23:49 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.87.124]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 92B753F7D8; Sun, 12 Jul 2020 20:23:35 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: agordeev@linux.ibm.com, ziy@nvidia.com, gerald.schaefer@de.ibm.com, christophe.leroy@c-s.fr, christophe.leroy@csgroup.eu, aneesh.kumar@linux.ibm.com, rppt@kernel.org, cai@lca.pw, 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 V5 0/4] mm/debug_vm_pgtable: Add some more tests Date: Mon, 13 Jul 2020 08:53:03 +0530 Message-Id: <1594610587-4172-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-Rspamd-Queue-Id: 9FE22180D0185 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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:866 debug_vm_pgtable+0x940/0xa54 WARN_ON(!pmd_present(pmd_mkinvalid(pmd_mkhuge(pmd)))) This series is based on v5.8-rc5. Changes in V5: - Dropped RANDOM_ORVALUE from hugetlb_advanced_tests() - Folded in Mike's patch for the rst document - Fixed typos in the rst document Changes in V4: (https://patchwork.kernel.org/project/linux-mm/list/?series=313173) - Replaced READ_ONCE() with ptep_get() while accessing PTE pointers per Christophe - Fixed function argument alignments per Christophe Changes in V3: (https://patchwork.kernel.org/project/linux-mm/list/?series=302483) - 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: Zi Yan Cc: Gerald Schaefer Cc: Christophe Leroy Cc: Christophe Leroy 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 | 666 +++++++++++++++++++++- 2 files changed, 922 insertions(+), 2 deletions(-) create mode 100644 Documentation/vm/arch_pgtable_helpers.rst