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: 13054971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35465C433FE for ; Thu, 24 Nov 2022 13:16:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A72E36B0071; Thu, 24 Nov 2022 08:16:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FBBE6B0072; Thu, 24 Nov 2022 08:16:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C3366B0074; Thu, 24 Nov 2022 08:16:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 79BF46B0071 for ; Thu, 24 Nov 2022 08:16:56 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 34861A0212 for ; Thu, 24 Nov 2022 13:16:56 +0000 (UTC) X-FDA: 80168386032.13.6D1B898 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP id B354F1C0009 for ; Thu, 24 Nov 2022 13:16:54 +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 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 ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669295815; a=rsa-sha256; cv=none; b=WZi9MHC9gwaUUwuJohiA6+YCHWMpVq8y3Rz6MiTpU6BirNmfp6AwNxMXcLC0aCaZRc7o4p VpW64jmhjA9lqlt4tkQlhejQK+yDaZfa54TDkzVdeNfQOwkjHhO9IJUrpB36/6LEW9oX+3 YqDcJC81M5syCpBoT8m/Sbx3ExNntjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669295815; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=LoXtPL9CMLM1v3yQ7uJH/kfk+5zZvrsb4PCENpwtgSQ=; b=lFK7eB/5OxbLBvGX/cOlAUVr/NiOn3NN7LsREbujmoKUIHGICzpkexvnUuex3s+ZCv1t/M agTMVKvVQOx6TFRbkahSsTWJJjO78Pcy02dDVLstGXdO93EpG+RkhWM3KlmDVA5jaXj71g kJnzj4SHOlCtkqRv+VwzhvUhMM54ypw= X-Rspamd-Queue-Id: B354F1C0009 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.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: rspam06 X-Stat-Signature: x97z7d8cztp1z9jsmeu9t87au6s1z53b X-HE-Tag: 1669295814-388643 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: 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