From patchwork Wed Feb 28 08:53:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13575057 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 40EDCC47DD9 for ; Wed, 28 Feb 2024 08:54:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0E5E6B009F; Wed, 28 Feb 2024 03:54:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBF7C6B00A0; Wed, 28 Feb 2024 03:54:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAE176B00A1; Wed, 28 Feb 2024 03:54:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id AC26B6B009F for ; Wed, 28 Feb 2024 03:54:07 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7B71F160EE4 for ; Wed, 28 Feb 2024 08:54:07 +0000 (UTC) X-FDA: 81840600534.28.CB733A9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id A2AB1A001B for ; Wed, 28 Feb 2024 08:54:05 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RKvH4BLr; spf=pass (imf25.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709110445; a=rsa-sha256; cv=none; b=ueWPv9Z621jOuAatwmPcMtl0YRiUav0sIIPK5UsU+dUIA1jz6SyN3jCD9FkpTbl64+I+ot cXIIc0E+GeMABL/E12JygWlQzAx1RKbHSAji06VFfGd4CcWbqmKN2tIOdTCgB9L7ER5o83 +w0FreWcmlPgdmLl9oerfCJPcyGJknA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RKvH4BLr; spf=pass (imf25.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709110445; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=4bhVktrS6dMSA/g0STyv8QBeTwQNCemSRg5EzlavLyM=; b=mck/EXclDwqAVDy9y3WhMPgeC0Y5G+mAbwRLEsl9/0iI4c6rlY/upwNiTrBqKd/9VaKDy3 JqlRk1WNQWDhkUFswxEd/aE5gUrRxK3Wcsa1pcU0xcp+oWF+axu5Gf5v1wTPQIMR9TbUPO wRYROWM7xJ7SCcgXMMDdB2L91VtIIng= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709110445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4bhVktrS6dMSA/g0STyv8QBeTwQNCemSRg5EzlavLyM=; b=RKvH4BLrUVP+x7ANwR4/p/Jvj0BqoYxDwWX9yKgNlWMaDrMQp/I/j8qfGW7b4vy4o6InCA dyBhV2O4DOcdfc0ra6iV/wJiSul2KzfNTui148IPq8j2WLFSxGj4Ef6ayP3wvOscdv6Ise s3Q0gMM2gKtCchIfI7OsHn4SFnrlbDY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-474-_q4xEYi-M2ObYOFyZZeH3A-1; Wed, 28 Feb 2024 03:53:59 -0500 X-MC-Unique: _q4xEYi-M2ObYOFyZZeH3A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 7A3691C0CCB4; Wed, 28 Feb 2024 08:53:58 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 409942022AAA; Wed, 28 Feb 2024 08:53:52 +0000 (UTC) From: peterx@redhat.com To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Yang Shi , Muchun Song , Jason Gunthorpe , x86@kernel.org, "Kirill A . Shutemov" , linuxppc-dev@lists.ozlabs.org, Andrew Morton , peterx@redhat.com Subject: [PATCH 0/5] mm/treewide: Replace pXd_large() with pXd_leaf() Date: Wed, 28 Feb 2024 16:53:45 +0800 Message-ID: <20240228085350.520953-1-peterx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A2AB1A001B X-Stat-Signature: 6gqkc7h4wfegar83pxnejtap5norwfi6 X-Rspam-User: X-HE-Tag: 1709110445-886037 X-HE-Meta: U2FsdGVkX1+6U/rrVTIQxjcigYYKlNWf/HO0tZC2vA4ki/CL2Teddm64YlW/PIdMOof+G9TpqTOXFQXN0YT5ljndtf3w2bljFrGCFxaS5jOwR7lnHM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PjpPSDXUuJemCOuih0pRsK3uwMS4WMRzZbuW3J4= 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 [based on latest akpm/mm-unstable, commit 1274e7646240] These two APIs are mostly always the same. It's confusing to have both of them. Merge them into one. Here I used pXd_leaf() only because pXd_leaf() is a global API which is always defined, while pXd_large() is not. We have yet one more API that is similar which is pXd_huge(), but that's even trickier, so let's do it step by step. Some cautions are needed on either x86 or ppc: x86 is currently the only user of p4d_large(), while ppc used to define pXd_large() only with THP, while it is not the case for pXd_leaf(). For the rest archs, afaict they're 100% identical. Only lightly tested on x86. Please have a look, thanks. Peter Xu (5): mm/ppc: Define pXd_large() with pXd_leaf() mm/x86: Replace p4d_large() with p4d_leaf() mm/treewide: Replace pmd_large() with pmd_leaf() mm/treewide: Replace pud_large() with pud_leaf() mm/treewide: Drop pXd_large() arch/arm/include/asm/pgtable-2level.h | 1 - arch/arm/include/asm/pgtable-3level.h | 1 - arch/arm/mm/dump.c | 4 ++-- arch/powerpc/include/asm/book3s/64/pgtable.h | 14 -------------- arch/powerpc/include/asm/pgtable.h | 4 ---- arch/powerpc/mm/book3s64/pgtable.c | 4 ++-- arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +- arch/powerpc/mm/pgtable_64.c | 2 +- arch/s390/boot/vmem.c | 4 ++-- arch/s390/include/asm/pgtable.h | 20 ++++++++++---------- arch/s390/mm/gmap.c | 14 +++++++------- arch/s390/mm/hugetlbpage.c | 6 +++--- arch/s390/mm/pageattr.c | 4 ++-- arch/s390/mm/pgtable.c | 8 ++++---- arch/s390/mm/vmem.c | 12 ++++++------ arch/sparc/include/asm/pgtable_64.h | 8 ++++---- arch/sparc/mm/init_64.c | 6 +++--- arch/x86/boot/compressed/ident_map_64.c | 2 +- arch/x86/include/asm/pgtable.h | 15 +++++++-------- arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/mm/fault.c | 16 ++++++++-------- arch/x86/mm/ident_map.c | 2 +- arch/x86/mm/init_32.c | 2 +- arch/x86/mm/init_64.c | 14 +++++++------- arch/x86/mm/kasan_init_64.c | 4 ++-- arch/x86/mm/mem_encrypt_identity.c | 6 +++--- arch/x86/mm/pat/set_memory.c | 14 +++++++------- arch/x86/mm/pgtable.c | 4 ++-- arch/x86/mm/pti.c | 8 ++++---- arch/x86/power/hibernate.c | 6 +++--- arch/x86/xen/mmu_pv.c | 10 +++++----- drivers/misc/sgi-gru/grufault.c | 2 +- 32 files changed, 101 insertions(+), 122 deletions(-)