From patchwork Thu Feb 29 08:42:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13576876 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 7DF17C48BF6 for ; Thu, 29 Feb 2024 08:44:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0ED826B00B5; Thu, 29 Feb 2024 03:44:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09DF76B00B6; Thu, 29 Feb 2024 03:44:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA7506B00B7; Thu, 29 Feb 2024 03:44:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D5EA56B00B5 for ; Thu, 29 Feb 2024 03:44:01 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B53171212B1 for ; Thu, 29 Feb 2024 08:44:01 +0000 (UTC) X-FDA: 81844203882.15.E9D107A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf11.hostedemail.com (Postfix) with ESMTP id 26FBC40006 for ; Thu, 29 Feb 2024 08:43:59 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=V1ivExbA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf11.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709196240; 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:in-reply-to:references:references:dkim-signature; bh=b67/NuFD7gMU0R4QPA2bhLRnZ+RDv7poJhFYhJqNhv8=; b=UJdKQ7KNtHiYgezemqUEDcY/Uc0yjIJygg6XKlp7lGmW/srJtM4zGSBiaMkqyuyHCeAKBD 9i/iEztq3sB+LyqJRc02y7WoBSUnlZdTscRmdvhqfSAqOpt5n8iBSouxTIk/LwuHY0NgiM T+gqKi7UsKxOt6h9nLiUhp2CKtYVAfM= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=V1ivExbA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf11.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709196240; a=rsa-sha256; cv=none; b=aBeqR7d5yrLw5QPyzJeuhJTbuSxnIUEh9qwHIchmdNBVhKwD2dca6UoReTn8u4gOzdIP+u Pve4MO7KNdKLovE6bs0XqdbA8AM+Z4iYA53mZ+f4xTA2Nx+YXcuXniNeucUKPJneMwNDkT B8OzFaEd4eKT0CRsYrQQBwpuTtjsiig= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709196239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b67/NuFD7gMU0R4QPA2bhLRnZ+RDv7poJhFYhJqNhv8=; b=V1ivExbAKI6Y5KK/eHbLOD/+gIQmbteghbQ9jy/ZBcl5UgBKhT1GJc3a/AmY7x6oHPa1pT 3/6vsiHqd68XeyIe8Hib3S/Ln1Qe/6z71WQ+ZJUvHoK4bhQMj6pL756TKVv7ub0DFKoXaA USb9BpmL1BqJIdFBUNq8gLbcBRww0So= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-264-flBA6bBzNo67k0kcBYB0_w-1; Thu, 29 Feb 2024 03:43:55 -0500 X-MC-Unique: flBA6bBzNo67k0kcBYB0_w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E2D648350E4; Thu, 29 Feb 2024 08:43:54 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9A94F96E0; Thu, 29 Feb 2024 08:43:49 +0000 (UTC) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Yang Shi , "Kirill A . Shutemov" , Jason Gunthorpe , peterx@redhat.com, Muchun Song , Andrew Morton , x86@kernel.org Subject: [PATCH v2 7/7] mm/treewide: Drop pXd_large() Date: Thu, 29 Feb 2024 16:42:58 +0800 Message-ID: <20240229084258.599774-8-peterx@redhat.com> In-Reply-To: <20240229084258.599774-1-peterx@redhat.com> References: <20240229084258.599774-1-peterx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Rspam-User: X-Stat-Signature: wh39mku5ufn53gx5rfeqbtm3er1y1a6m X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 26FBC40006 X-HE-Tag: 1709196239-63022 X-HE-Meta: U2FsdGVkX19QpzjTrCKuUdnK09UekR10BHhQWGLhLv1EcBiJLfuZyetCh0GoXMIIEW73TJ1W7dxTt9xv5AqmKXQevqh4FiG74O3aV4wbcXnNlM/bkSKVt9qI33n00cRPmwnQYtNKwWCitbKuIEvACcgChLgSXeB+csPfcb+2KmB9LSnnSCfQ+ujjfNJh78TlP1USdH4KvLPFaZrobfT6vhP5qx2GNtZj9Zt0ahZUIJ6+BoojiP9JLdcaWGrvUdSNcD4/azlnLIFgm4le6PxSFEMb3wwrGJVWJyF6VuoKPwHgE7XZfhyIn/j7qpICK9sWeW1/Brf2gMTffVMaLm2c6PLnbXH8kB9mPN8h4qr8VzCk0cMqYqSjjOVEhyAYBkQQfpvMeljYeCgiRRjLAGUzSIdbZwaHbEdallUBgxjOzxwk7tylrU5JkRx54IVj0oHg931BbkTwlGSJlH1IYAG9ut2Np3EJ0RxXJj43igY143to5qkgBB+J6WqVmg8deC2H7Obd2kOH8bNsi4wd7QvgyAfdCBIpYOqvche8X0FMngMCC/XKy/nyGgXSJwT2WRiWdqzN1eSrPRNLvjz0NzMj4ZbXN1puUUI/W5bGQtFTPLb+TQd/F6nFGiXWuMM+oGSIZ1CUGEVKrBa9sk/zUYwXpDgbWcl3uxHiyyU/aSjNwPu64FqknTNRtVmVGHmqsENYOaQaYMA40zneAtZkBqluLRMjHjm2uVUCdymZsrPjvL4Xwl8GIegsx8Q3p5sTLtnK+Kb1U+ANvINLVYqfFwip/b/dUVSZNUyzVI2ZG2yS4HYczil+qpJiw3HgpvGmoLT9mimm9/laGCix6DSCcbnlASrVPrPqdc7U++DAVZhDCGI/qMF2DNtVeVLBMgaTyRgIsZkipe9+8OPAWYJS5YF71/Xox5b8l8smxsnRTgNjyA/vJuMgvgXDPh2HKjTeo1fx 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: List-Subscribe: List-Unsubscribe: From: Peter Xu They're not used anymore, drop all of them. Signed-off-by: Peter Xu Reviewed-by: Jason Gunthorpe --- arch/arm/include/asm/pgtable-2level.h | 1 - arch/arm/include/asm/pgtable-3level.h | 1 - arch/powerpc/include/asm/book3s/64/pgtable.h | 4 +--- arch/powerpc/include/asm/pgtable.h | 4 ---- arch/s390/include/asm/pgtable.h | 8 ++++---- arch/sparc/include/asm/pgtable_64.h | 8 ++++---- arch/x86/include/asm/pgtable.h | 19 +++++++------------ 7 files changed, 16 insertions(+), 29 deletions(-) diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h index ce543cd9380c..b0a262566eb9 100644 --- a/arch/arm/include/asm/pgtable-2level.h +++ b/arch/arm/include/asm/pgtable-2level.h @@ -213,7 +213,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) #define pmd_pfn(pmd) (__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) -#define pmd_large(pmd) (pmd_val(pmd) & 2) #define pmd_leaf(pmd) (pmd_val(pmd) & 2) #define pmd_bad(pmd) (pmd_val(pmd) & 2) #define pmd_present(pmd) (pmd_val(pmd)) diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h index 71c3add6417f..4b1d9eb3908a 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h @@ -118,7 +118,6 @@ PMD_TYPE_TABLE) #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \ PMD_TYPE_SECT) -#define pmd_large(pmd) pmd_sect(pmd) #define pmd_leaf(pmd) pmd_sect(pmd) #define pud_clear(pudp) \ diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 3e99e409774a..df66dce8306f 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -1437,17 +1437,15 @@ static inline bool is_pte_rw_upgrade(unsigned long old_val, unsigned long new_va } /* - * Like pmd_huge() and pmd_large(), but works regardless of config options + * Like pmd_huge(), but works regardless of config options */ #define pmd_leaf pmd_leaf -#define pmd_large pmd_leaf static inline bool pmd_leaf(pmd_t pmd) { return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)); } #define pud_leaf pud_leaf -#define pud_large pud_leaf static inline bool pud_leaf(pud_t pud) { return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PTE)); diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index e6edf1cdbc5b..239709a2f68e 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -101,10 +101,6 @@ void poking_init(void); extern unsigned long ioremap_bot; extern const pgprot_t protection_map[16]; -#ifndef pmd_large -#define pmd_large(pmd) 0 -#endif - /* can we use this in kvm */ unsigned long vmalloc_to_phys(void *vmalloc_addr); diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index a5f16a244a64..9e08af5b9247 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -705,16 +705,16 @@ static inline int pud_none(pud_t pud) return pud_val(pud) == _REGION3_ENTRY_EMPTY; } -#define pud_leaf pud_large -static inline int pud_large(pud_t pud) +#define pud_leaf pud_leaf +static inline int pud_leaf(pud_t pud) { if ((pud_val(pud) & _REGION_ENTRY_TYPE_MASK) != _REGION_ENTRY_TYPE_R3) return 0; return !!(pud_val(pud) & _REGION3_ENTRY_LARGE); } -#define pmd_leaf pmd_large -static inline int pmd_large(pmd_t pmd) +#define pmd_leaf pmd_leaf +static inline int pmd_leaf(pmd_t pmd) { return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0; } diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 652af9d63fa2..6ff0a28d5fd1 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -680,8 +680,8 @@ static inline unsigned long pte_special(pte_t pte) return pte_val(pte) & _PAGE_SPECIAL; } -#define pmd_leaf pmd_large -static inline unsigned long pmd_large(pmd_t pmd) +#define pmd_leaf pmd_leaf +static inline unsigned long pmd_leaf(pmd_t pmd) { pte_t pte = __pte(pmd_val(pmd)); @@ -867,8 +867,8 @@ static inline pmd_t *pud_pgtable(pud_t pud) /* only used by the stubbed out hugetlb gup code, should never be called */ #define p4d_page(p4d) NULL -#define pud_leaf pud_large -static inline unsigned long pud_large(pud_t pud) +#define pud_leaf pud_leaf +static inline unsigned long pud_leaf(pud_t pud) { pte_t pte = __pte(pud_val(pud)); diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index f884d5162507..6028e5143a00 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -251,8 +251,8 @@ static inline unsigned long pgd_pfn(pgd_t pgd) return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT; } -#define p4d_leaf p4d_large -static inline int p4d_large(p4d_t p4d) +#define p4d_leaf p4d_leaf +static inline int p4d_leaf(p4d_t p4d) { /* No 512 GiB pages yet */ return 0; @@ -260,14 +260,14 @@ static inline int p4d_large(p4d_t p4d) #define pte_page(pte) pfn_to_page(pte_pfn(pte)) -#define pmd_leaf pmd_large -static inline int pmd_large(pmd_t pte) +#define pmd_leaf pmd_leaf +static inline int pmd_leaf(pmd_t pte) { return pmd_flags(pte) & _PAGE_PSE; } #ifdef CONFIG_TRANSPARENT_HUGEPAGE -/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_large */ +/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_leaf */ static inline int pmd_trans_huge(pmd_t pmd) { return (pmd_val(pmd) & (_PAGE_PSE|_PAGE_DEVMAP)) == _PAGE_PSE; @@ -1085,8 +1085,8 @@ static inline pmd_t *pud_pgtable(pud_t pud) */ #define pud_page(pud) pfn_to_page(pud_pfn(pud)) -#define pud_leaf pud_large -static inline int pud_large(pud_t pud) +#define pud_leaf pud_leaf +static inline int pud_leaf(pud_t pud) { return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) == (_PAGE_PSE | _PAGE_PRESENT); @@ -1096,11 +1096,6 @@ static inline int pud_bad(pud_t pud) { return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0; } -#else -static inline int pud_large(pud_t pud) -{ - return 0; -} #endif /* CONFIG_PGTABLE_LEVELS > 2 */ #if CONFIG_PGTABLE_LEVELS > 3