From patchwork Thu Nov 24 13:16:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 25531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3396963wrr; Thu, 24 Nov 2022 05:29:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf7jR01vxJYFSPzuA83+J0EFwThByJ4ikT1LQwTr3NBqW/OpUpMwzcN55jbdgvmRzfs4lc2p X-Received: by 2002:a17:906:229a:b0:78d:d762:5457 with SMTP id p26-20020a170906229a00b0078dd7625457mr28946835eja.67.1669296542249; Thu, 24 Nov 2022 05:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669296542; cv=none; d=google.com; s=arc-20160816; b=b/+rhTDh5UyBxJmKWT3RHrh4VuZUnz7hBDJarm9cesurlzjWczGi2tUTtMnGCkHcei SuerVP3aOnnmdssctxwNgDOwF0oiHxgPbTpyGVsbhlQYYdhHTP/+DbrmaLv1/qdCkEkF XJvsDQY6PfHf23FoW/X6iyfPQiRPcjB7YkNYOEwCjW62eYT1RBjVIFgcPYCdFIQNl5xx J+YcqoG6kKhqFcDQQCEioFQFwepwfrEbOJ/nxPWS6PHUQRgUXylkNf26qa5JT+06NVAa zIBJA2Uimci2P3Re+3ymOA1UmhWyQxKJp9JB3N+z+WTqH1b58Ar3wYaYztdLhz5dPuLj PcSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LoXtPL9CMLM1v3yQ7uJH/kfk+5zZvrsb4PCENpwtgSQ=; b=RyYTWP2f10a1Cs2AKRjt1aOs70B2kM7kfsyFnYcrsVvF7TBsBpyc/IamM8ShluYstk TRDs93DU1lCKFaLzOh4kdAy/zULJpxGvByhq1BRpDBe59AOI7EpNhXFsL3+URxdeZkBQ YYYSCspOHtS13xi3ym8eZMiOXQVTvGfGbcLLjiMBwhx9yR197bZ7v1bnDKprjXDRDOzP vvHYOc/0hHzd86xKso3ENwaf+o1atXmJnQibLWgMDzN3TYiWXScm3VZWNtTEa4xFiFAO jrMmlfFypExqcwCWxKptlHTw3T1WW/4qP6yNMZjdZUH2e56RIV/mKoui9f2LiSJke78o 2Jmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a056402520400b0045c9313faf7si290154edd.353.2022.11.24.05.28.34; Thu, 24 Nov 2022 05:29:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbiKXNQ4 (ORCPT + 99 others); Thu, 24 Nov 2022 08:16:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiKXNQz (ORCPT ); Thu, 24 Nov 2022 08:16:55 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B7B7FC720 for ; Thu, 24 Nov 2022 05:16:54 -0800 (PST) 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 31A0323A; Thu, 24 Nov 2022 05:17:00 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.42.127]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E38053F73B; Thu, 24 Nov 2022 05:16:51 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] mm/thp: Rename pmd_to_page() as pmd_pgtable_page() Date: Thu, 24 Nov 2022 18:46:41 +0530 Message-Id: <20221124131641.1523772-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750384291181374231?= X-GMAIL-MSGID: =?utf-8?q?1750384291181374231?= Current pmd_to_page(), which derives the page table page containing the pmd address has a very misleading name. The problem being, it sounds similar to pmd_page() which derives page embedded in a given pmd entry either for next level page or a mapped huge page. Rename it as pmd_pgtable_page() instead. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on v6.1-rc6 include/linux/mm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8bbcccbc5565..e9e387caffac 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2403,7 +2403,7 @@ static inline void pgtable_pte_page_dtor(struct page *page) #if USE_SPLIT_PMD_PTLOCKS -static struct page *pmd_to_page(pmd_t *pmd) +static struct page *pmd_pgtable_page(pmd_t *pmd) { unsigned long mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1); return virt_to_page((void *)((unsigned long) pmd & mask)); @@ -2411,7 +2411,7 @@ static struct page *pmd_to_page(pmd_t *pmd) static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) { - return ptlock_ptr(pmd_to_page(pmd)); + return ptlock_ptr(pmd_pgtable_page(pmd)); } static inline bool pmd_ptlock_init(struct page *page) @@ -2430,7 +2430,7 @@ static inline void pmd_ptlock_free(struct page *page) ptlock_free(page); } -#define pmd_huge_pte(mm, pmd) (pmd_to_page(pmd)->pmd_huge_pte) +#define pmd_huge_pte(mm, pmd) (pmd_pgtable_page(pmd)->pmd_huge_pte) #else