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.5 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 8C8CEC4338F for ; Fri, 23 Jul 2021 02:38:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2B50B60EB5 for ; Fri, 23 Jul 2021 02:38:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2B50B60EB5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BA6A06B005D; Thu, 22 Jul 2021 22:38:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B575D6B006C; Thu, 22 Jul 2021 22:38:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A46756B0070; Thu, 22 Jul 2021 22:38:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 876776B005D for ; Thu, 22 Jul 2021 22:38:49 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 34D7D181AF5C7 for ; Fri, 23 Jul 2021 02:38:49 +0000 (UTC) X-FDA: 78392294778.33.00FCA73 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf18.hostedemail.com (Postfix) with ESMTP id 96A914001891 for ; Fri, 23 Jul 2021 02:38:48 +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 BFD60113E; Thu, 22 Jul 2021 19:38:47 -0700 (PDT) Received: from [10.163.66.36] (unknown [10.163.66.36]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F23083F694; Thu, 22 Jul 2021 19:38:44 -0700 (PDT) Subject: Re: [PATCH v3 07/12] mm/debug_vm_pgtable: Use struct pgtable_debug_args in PTE modifying tests To: Gavin Shan , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, chuhu@redhat.com, shan.gavin@gmail.com References: <20210719130613.334901-1-gshan@redhat.com> <20210719130613.334901-8-gshan@redhat.com> <99c73652-7294-17ff-0c4f-986b588ab022@redhat.com> From: Anshuman Khandual Message-ID: <492c96ea-5f60-2720-7da8-1fc18a1f95d3@arm.com> Date: Fri, 23 Jul 2021 08:09:32 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <99c73652-7294-17ff-0c4f-986b588ab022@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.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 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 96A914001891 X-Stat-Signature: wroc393oojehogrs3poutturbxnsgdxu X-HE-Tag: 1627007928-674060 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: On 7/22/21 12:07 PM, Gavin Shan wrote: >=20 >>> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pgdp =3D pgd_offset(mm, vaddr); >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 p4dp =3D p4d_alloc(mm, pgdp, vaddr); >>> @@ -1272,11 +1275,11 @@ static int __init debug_vm_pgtable(void) >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Page table modifying tests. Th= ey need to hold >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * proper page table lock. >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ >>> - >>> -=C2=A0=C2=A0=C2=A0 ptep =3D pte_offset_map_lock(mm, pmdp, vaddr, &pt= l); >>> -=C2=A0=C2=A0=C2=A0 pte_clear_tests(mm, ptep, pte_aligned, vaddr, pro= t); >>> -=C2=A0=C2=A0=C2=A0 pte_advanced_tests(mm, vma, ptep, pte_aligned, va= ddr, prot); >>> -=C2=A0=C2=A0=C2=A0 pte_unmap_unlock(ptep, ptl); >>> +=C2=A0=C2=A0=C2=A0 ptl =3D pte_lockptr(args.mm, args.pmdp); >>> +=C2=A0=C2=A0=C2=A0 spin_lock(ptl); >>> +=C2=A0=C2=A0=C2=A0 pte_clear_tests(&args); >>> +=C2=A0=C2=A0=C2=A0 pte_advanced_tests(&args); >>> +=C2=A0=C2=A0=C2=A0 spin_unlock(ptl); >> >> Why pte_offset_map_lock()/pte_unmap_unlock() has been dropped and >> spin_lock()/spin_unlock() sequence has been added ? Please dont >> change the tests in these patches. >> >=20 > The semantics of pte_offset_map_lock() is to grab and take the lock > and return the PTE entry, which is mapped if needed. We already had > the PTE entry tracked by args->ptep in init_args(). So some of the > operations covered by pte_offset_map_lock() isn't needed any more To keep the patch on purpose, please avoid this change here. But if required, you could send a follow up patch later.