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 X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B5E7C432BE for ; Mon, 9 Aug 2021 10:08:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 411EC6108F for ; Mon, 9 Aug 2021 10:08:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 411EC6108F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7940B6B006C; Mon, 9 Aug 2021 06:08:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 746476B0071; Mon, 9 Aug 2021 06:08:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 632CB8D0001; Mon, 9 Aug 2021 06:08:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id 45D586B006C for ; Mon, 9 Aug 2021 06:08:29 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DAEF018014D37 for ; Mon, 9 Aug 2021 10:08:28 +0000 (UTC) X-FDA: 78455117496.32.9718097 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf25.hostedemail.com (Postfix) with ESMTP id DBF22B007B42 for ; Mon, 9 Aug 2021 10:08:27 +0000 (UTC) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4GjsGx561wz9sTC; Mon, 9 Aug 2021 12:08:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ozi7H-OO-Jzo; Mon, 9 Aug 2021 12:08:25 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4GjsGx3lZGz9sT5; Mon, 9 Aug 2021 12:08:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5A2138B840; Mon, 9 Aug 2021 12:08:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 0BxLooPSeYzi; Mon, 9 Aug 2021 12:08:25 +0200 (CEST) Received: from [172.25.230.102] (po15451.idsi0.si.c-s.fr [172.25.230.102]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 13AF38B83C; Mon, 9 Aug 2021 12:08:25 +0200 (CEST) Subject: Re: [PATCH v6 00/12] mm/debug_vm_pgtable: Enhancements To: Gavin Shan , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, anshuman.khandual@arm.com, gerald.schaefer@linux.ibm.com, aneesh.kumar@linux.ibm.com, cai@lca.pw, catalin.marinas@arm.com, will@kernel.org, vgupta@synopsys.com, akpm@linux-foundation.org, chuhu@redhat.com, shan.gavin@gmail.com References: <20210809092631.1888748-1-gshan@redhat.com> From: Christophe Leroy Message-ID: <34b03b31-f13e-1f8d-a8db-49b2e501ef57@csgroup.eu> Date: Mon, 9 Aug 2021 12:08:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210809092631.1888748-1-gshan@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DBF22B007B42 Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=none X-Stat-Signature: gsmcr6e1x9s5or6derth4fokdefuitmd X-HE-Tag: 1628503707-334191 Content-Transfer-Encoding: quoted-printable 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: Le 09/08/2021 =C3=A0 11:26, Gavin Shan a =C3=A9crit=C2=A0: > There are couple of issues with current implementations and this series > tries to resolve the issues: >=20 > (a) All needed information are scattered in variables, passed to var= ious > test functions. The code is organized in pretty much relaxed fas= hion. >=20 > (b) The page isn't allocated from buddy during page table entry modi= fying > tests. The page can be invalid, conflicting to the implementatio= ns > of set_xxx_at() on ARM64. The target page is accessed so that th= e > iCache can be flushed when execution permission is given on ARM6= 4. > Besides, the target page can be unmapped and accessing to it cau= ses > kernel crash. >=20 > "struct pgtable_debug_args" is introduced to address issue (a). For iss= ue > (b), the used page is allocated from buddy in page table entry modifyin= g > tests. The corresponding tets will be skipped if we fail to allocate th= e > (huge) page. For other test cases, the original page around to kernel > symbol (@start_kernel) is still used. >=20 > The patches are organized as below. PATCH[2-10] could be combined to on= e > patch, but it will make the review harder: >=20 > PATCH[1] introduces "struct pgtable_debug_args" as place holder of a= ll > needed information. With it, the old and new implementation > can coexist. > PATCH[2-10] uses "struct pgtable_debug_args" in various test functio= ns. > PATCH[11] removes the unused code for old implementation. > PATCH[12] fixes the issue of corrupted page flag for ARM64 I tested this series on powerpc 8xx, no failure reported. Christophe >=20 > Changelog > =3D=3D=3D=3D=3D=3D=3D=3D=3D > v6: > * Populate saved page table entry pointers after > they're allocated in init_args() (Anshuman= ) > * Fix imbalanced preemption count issue by replacing > pte_alloc_mmap() with pte_alloc() in init_args() (syzbot) > v5: > * Pick r-bs from Anshuman and rebase to 5.14.rc4 (Gavin) > * Use args->start_p4dp to free p4d entries (Anshuman= ) > * Introduce helper to allocate huge page in init_arg() (Anshuman= ) > * Bail early if the allocated page doesn't exist in > swap_migration_tests() and correct the comments (Anshuman= ) > * Add fixes tag to PATCH[v4 12/12] (Christop= he) > * Address misc comments (Anshuman= ) > v4: > * Determine the page allocation method according to > MAX_ORDER (Anshuman= ) > * Move existing comments to init_args() (Anshuman= ) > * Code refactoring as suggested by Anshuman (Anshuman= ) > * Improved commit log and add comments for flush_dcache_page() > in PATCH[v4 12/12] (Anshuman= ) > * Address misc comments (Anshuman= ) > v3: > * Fix the warning caused by allocating more pages than > (1 << (MAX_ORDER - 1)) in init_args() (syzbot) > * Fix build warning by dropping unused variables in separate > patches (0-day) > * Missed "WARN_ON(!pud_none(pud))" in pud_huge_tests() in > PATCH[v2 09/12] (0-day) > * Fix the subjects for PATCH[05/12] and PATCH[09/12] (Gavin) > v2: > * Rename struct vm_pgtable_debug to struct pgtable_debug_args. > The parameter name to various test functions are renamed > to "@args" (Anshuman= ) > * Code changes as suggested by Anshuman (Anshuman= ) >=20 > Gavin Shan (12): > mm/debug_vm_pgtable: Introduce struct pgtable_debug_args > mm/debug_vm_pgtable: Use struct pgtable_debug_args in basic tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in leaf and > savewrite tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in protnone and > devmap tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in soft_dirty and > swap tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in migration and > thp tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in PTE modifying > tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in PMD modifying > tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in PUD modifying > tests > mm/debug_vm_pgtable: Use struct pgtable_debug_args in PGD and P4D > modifying tests > mm/debug_vm_pgtable: Remove unused code > mm/debug_vm_pgtable: Fix corrupted page flag >=20 > mm/debug_vm_pgtable.c | 918 +++++++++++++++++++++++++----------------= - > 1 file changed, 559 insertions(+), 359 deletions(-) >=20