From nobody Mon Feb 9 06:01:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1682969989; cv=none; d=zohomail.com; s=zohoarc; b=UDbJGNs4dEhPPK9RUOMlZI1KWYDNeY1Z+BiUEI4ajsluI4ETtgzYhOhb2kONo9M1OpFFwrzgAtAJfMABKoXPtznowcVXDyZS69tNyuH5tzCOqO8ncs7vGF7NVW4e0mq4W8LygGzifr3hLnRpdvZB22gCMYOzXfCZPFc8IOU0Ycg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682969989; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tVP5uHyitpWmGyZGGmBmuGVwAuiqA5RrNeRETZrKFQk=; b=dJ+Hhw04ouxLRhngy3RnflytmGh4mGP0LYAjXLeuLoY7fT90qvZe9qn7siy6CbdEgLVP611SB7K5GVFw08dniePNfGh9cF+6tbOfKl+QTuoppp6WYAMz9LUdgOsObYleNIgGvKnVsjGml0EqxoOlqXriqnJGCP7zec2yibubmKw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1682969989332709.0259051743137; Mon, 1 May 2023 12:39:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.528141.820991 (Exim 4.92) (envelope-from ) id 1ptZMa-00089n-JE; Mon, 01 May 2023 19:39:08 +0000 Received: by outflank-mailman (output) from mailman id 528141.820991; Mon, 01 May 2023 19:39:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ptZMa-00089T-Dx; Mon, 01 May 2023 19:39:08 +0000 Received: by outflank-mailman (input) for mailman id 528141; Mon, 01 May 2023 19:39:07 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ptZDL-0006PY-Q6 for xen-devel@lists.xenproject.org; Mon, 01 May 2023 19:29:35 +0000 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [2607:f8b0:4864:20::635]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7ae1c1cf-e856-11ed-8611-37d641c3527e; Mon, 01 May 2023 21:29:24 +0200 (CEST) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1aad5245632so16558095ad.3 for ; Mon, 01 May 2023 12:29:24 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:937f:7f20::9a2c]) by smtp.googlemail.com with ESMTPSA id u8-20020a170902bf4800b0019c13d032d8sm18175622pls.253.2023.05.01.12.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 12:29:23 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7ae1c1cf-e856-11ed-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682969364; x=1685561364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tVP5uHyitpWmGyZGGmBmuGVwAuiqA5RrNeRETZrKFQk=; b=l3gNIC841LsuGqQQ2UpVF+XnHjZ+kiBXZeZy4GTzDMbWbXaEiG5ArSl/ydDvotE01/ fGJ2+A5T8Q0iCPtlIlo1cxl3Uf1AxNVghNXp2wCgxamPWRN0f7NM89uS/eqg02SKiRak np/AOUUvT9Iq32lA1ArHNRu1TUuWBGP97diP1cbyLES/I8a8uq904CtHM5VcyBKmIx8g ULh11nFUApu/c5GfuUXZpzFhh6lYLhMsU4hm7q2aFdXWAxNpZKe/ScDOD1gC9EPME0aI 4wA9wQgJ9NzOXeiB1g9JMqcyyqFI/8Wvj0CTUQfo5zcTDuOrG/ytNAkFcETgxxSn2sbl hW5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682969364; x=1685561364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tVP5uHyitpWmGyZGGmBmuGVwAuiqA5RrNeRETZrKFQk=; b=a1EpmSRxzkAtGNwNr9tSZfplIvuedRQ4tUUA02wQwbVRYlA+vSsP+VAHKvqgCzvSjO 5+b1XfA8aZplzPmn6s5WqyQxFv17r9ZkqXwPvt88pPXMfnXapYXM/72QFE29LyTJADtS 7zvFvyl6mdhHj8VnwNf9fFUnu+FBvLeLplzEy/ltWWwY11qHZPOzhsRNqEDcsN8Ji1Jc Hhe7m8H/WDUyiPp9WnRu+GjItHWVe54ZNXSNZBAFt292WjjcZmWd06PVifksCk/L56lk tWAGmcKaRl1VXKcw8gkpKeVSsYxhci2WL6HQD480ctY0GbDGfaHqEgv9kpxoZCj4POcL SvCQ== X-Gm-Message-State: AC+VfDxZgJT/Fl861g0Ucj82a+yoKSHrcVNMu+pxJsZLRvadz1F7Gq7k 7HDuCOXwcat8SQ8BzBjLHXo= X-Google-Smtp-Source: ACHHUZ4QjkMy1fp/+Rin9A48k0WWuHM3fOzsdnkuixAb5bcQScYzyO713qNNM5COHanOuLDMosv4jg== X-Received: by 2002:a17:902:db07:b0:1aa:f203:781c with SMTP id m7-20020a170902db0700b001aaf203781cmr5844122plx.44.1682969363711; Mon, 01 May 2023 12:29:23 -0700 (PDT) From: "Vishal Moola (Oracle)" To: Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, "Vishal Moola (Oracle)" Subject: [PATCH v2 34/34] mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers Date: Mon, 1 May 2023 12:28:29 -0700 Message-Id: <20230501192829.17086-35-vishal.moola@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230501192829.17086-1-vishal.moola@gmail.com> References: <20230501192829.17086-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1682969990431100001 These functions are no longer necessary. Remove them and cleanup Documentation referencing them. Signed-off-by: Vishal Moola (Oracle) --- Documentation/mm/split_page_table_lock.rst | 12 +++++------ .../zh_CN/mm/split_page_table_lock.rst | 14 ++++++------- include/linux/mm.h | 20 ------------------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/Documentation/mm/split_page_table_lock.rst b/Documentation/mm/= split_page_table_lock.rst index 50ee0dfc95be..b3c612183135 100644 --- a/Documentation/mm/split_page_table_lock.rst +++ b/Documentation/mm/split_page_table_lock.rst @@ -53,7 +53,7 @@ Support of split page table lock by an architecture =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 There's no need in special enabling of PTE split page table lock: everythi= ng -required is done by pgtable_pte_page_ctor() and pgtable_pte_page_dtor(), w= hich +required is done by ptdesc_pte_ctor() and ptdesc_pte_dtor(), which must be called on PTE table allocation / freeing. =20 Make sure the architecture doesn't use slab allocator for page table @@ -63,8 +63,8 @@ This field shares storage with page->ptl. PMD split lock only makes sense if you have more than two page table levels. =20 -PMD split lock enabling requires pgtable_pmd_page_ctor() call on PMD table -allocation and pgtable_pmd_page_dtor() on freeing. +PMD split lock enabling requires ptdesc_pmd_ctor() call on PMD table +allocation and ptdesc_pmd_dtor() on freeing. =20 Allocation usually happens in pmd_alloc_one(), freeing in pmd_free() and pmd_free_tlb(), but make sure you cover all PMD table allocation / freeing @@ -72,7 +72,7 @@ paths: i.e X86_PAE preallocate few PMDs on pgd_alloc(). =20 With everything in place you can set CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK. =20 -NOTE: pgtable_pte_page_ctor() and pgtable_pmd_page_ctor() can fail -- it m= ust +NOTE: ptdesc_pte_ctor() and ptdesc_pmd_ctor() can fail -- it must be handled properly. =20 page->ptl @@ -92,7 +92,7 @@ trick: split lock with enabled DEBUG_SPINLOCK or DEBUG_LOCK_ALLOC, but costs one more cache line for indirect access; =20 -The spinlock_t allocated in pgtable_pte_page_ctor() for PTE table and in -pgtable_pmd_page_ctor() for PMD table. +The spinlock_t allocated in ptdesc_pte_ctor() for PTE table and in +ptdesc_pmd_ctor() for PMD table. =20 Please, never access page->ptl directly -- use appropriate helper. diff --git a/Documentation/translations/zh_CN/mm/split_page_table_lock.rst = b/Documentation/translations/zh_CN/mm/split_page_table_lock.rst index 4fb7aa666037..a3323eb9dc40 100644 --- a/Documentation/translations/zh_CN/mm/split_page_table_lock.rst +++ b/Documentation/translations/zh_CN/mm/split_page_table_lock.rst @@ -56,16 +56,16 @@ Hugetlb=E7=89=B9=E5=AE=9A=E7=9A=84=E8=BE=85=E5=8A=A9=E5= =87=BD=E6=95=B0: =E6=9E=B6=E6=9E=84=E5=AF=B9=E5=88=86=E9=A1=B5=E8=A1=A8=E9=94=81=E7=9A=84= =E6=94=AF=E6=8C=81 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -=E6=B2=A1=E6=9C=89=E5=BF=85=E8=A6=81=E7=89=B9=E5=88=AB=E5=90=AF=E7=94=A8PT= E=E5=88=86=E9=A1=B5=E8=A1=A8=E9=94=81=EF=BC=9A=E6=89=80=E6=9C=89=E9=9C=80= =E8=A6=81=E7=9A=84=E4=B8=9C=E8=A5=BF=E9=83=BD=E7=94=B1pgtable_pte_page_ctor= () -=E5=92=8Cpgtable_pte_page_dtor()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=AE=83=E4=BB= =AC=E5=BF=85=E9=A1=BB=E5=9C=A8PTE=E8=A1=A8=E5=88=86=E9=85=8D/=E9=87=8A=E6= =94=BE=E6=97=B6=E8=A2=AB=E8=B0=83=E7=94=A8=E3=80=82 +=E6=B2=A1=E6=9C=89=E5=BF=85=E8=A6=81=E7=89=B9=E5=88=AB=E5=90=AF=E7=94=A8PT= E=E5=88=86=E9=A1=B5=E8=A1=A8=E9=94=81=EF=BC=9A=E6=89=80=E6=9C=89=E9=9C=80= =E8=A6=81=E7=9A=84=E4=B8=9C=E8=A5=BF=E9=83=BD=E7=94=B1ptdesc_pte_ctor() +=E5=92=8Cptdesc_pte_dtor()=E5=AE=8C=E6=88=90=EF=BC=8C=E5=AE=83=E4=BB=AC=E5= =BF=85=E9=A1=BB=E5=9C=A8PTE=E8=A1=A8=E5=88=86=E9=85=8D/=E9=87=8A=E6=94=BE= =E6=97=B6=E8=A2=AB=E8=B0=83=E7=94=A8=E3=80=82 =20 =E7=A1=AE=E4=BF=9D=E6=9E=B6=E6=9E=84=E4=B8=8D=E4=BD=BF=E7=94=A8slab=E5=88= =86=E9=85=8D=E5=99=A8=E6=9D=A5=E5=88=86=E9=85=8D=E9=A1=B5=E8=A1=A8=EF=BC=9A= slab=E4=BD=BF=E7=94=A8page->slab_cache=E6=9D=A5=E5=88=86=E9=85=8D=E5=85=B6= =E9=A1=B5 =E9=9D=A2=E3=80=82=E8=BF=99=E4=B8=AA=E5=8C=BA=E5=9F=9F=E4=B8=8Epage->ptl= =E5=85=B1=E4=BA=AB=E5=AD=98=E5=82=A8=E3=80=82 =20 PMD=E5=88=86=E9=A1=B5=E9=94=81=E5=8F=AA=E6=9C=89=E5=9C=A8=E4=BD=A0=E6=9C= =89=E4=B8=A4=E4=B8=AA=E4=BB=A5=E4=B8=8A=E7=9A=84=E9=A1=B5=E8=A1=A8=E7=BA=A7= =E5=88=AB=E6=97=B6=E6=89=8D=E6=9C=89=E6=84=8F=E4=B9=89=E3=80=82 =20 -=E5=90=AF=E7=94=A8PMD=E5=88=86=E9=A1=B5=E9=94=81=E9=9C=80=E8=A6=81=E5=9C= =A8PMD=E8=A1=A8=E5=88=86=E9=85=8D=E6=97=B6=E8=B0=83=E7=94=A8pgtable_pmd_pag= e_ctor()=EF=BC=8C=E5=9C=A8=E9=87=8A=E6=94=BE=E6=97=B6=E8=B0=83 -=E7=94=A8pgtable_pmd_page_dtor()=E3=80=82 +=E5=90=AF=E7=94=A8PMD=E5=88=86=E9=A1=B5=E9=94=81=E9=9C=80=E8=A6=81=E5=9C= =A8PMD=E8=A1=A8=E5=88=86=E9=85=8D=E6=97=B6=E8=B0=83=E7=94=A8ptdesc_pmd_ctor= ()=EF=BC=8C=E5=9C=A8=E9=87=8A=E6=94=BE=E6=97=B6=E8=B0=83 +=E7=94=A8ptdesc_pmd_dtor()=E3=80=82 =20 =E5=88=86=E9=85=8D=E9=80=9A=E5=B8=B8=E5=8F=91=E7=94=9F=E5=9C=A8pmd_alloc_o= ne()=E4=B8=AD=EF=BC=8C=E9=87=8A=E6=94=BE=E5=8F=91=E7=94=9F=E5=9C=A8pmd_free= ()=E5=92=8Cpmd_free_tlb() =E4=B8=AD=EF=BC=8C=E4=BD=86=E8=A6=81=E7=A1=AE=E4=BF=9D=E8=A6=86=E7=9B=96= =E6=89=80=E6=9C=89=E7=9A=84PMD=E8=A1=A8=E5=88=86=E9=85=8D/=E9=87=8A=E6=94= =BE=E8=B7=AF=E5=BE=84=EF=BC=9A=E5=8D=B3X86_PAE=E5=9C=A8pgd_alloc()=E4=B8=AD= =E9=A2=84=E5=85=88 @@ -73,7 +73,7 @@ PMD=E5=88=86=E9=A1=B5=E9=94=81=E5=8F=AA=E6=9C=89=E5=9C=A8= =E4=BD=A0=E6=9C=89=E4=B8=A4=E4=B8=AA=E4=BB=A5=E4=B8=8A=E7=9A=84=E9=A1=B5=E8= =A1=A8=E7=BA=A7=E5=88=AB=E6=97=B6=E6=89=8D=E6=9C=89=E6=84=8F=E4=B9=89=E3=80= =82 =20 =E4=B8=80=E5=88=87=E5=B0=B1=E7=BB=AA=E5=90=8E=EF=BC=8C=E4=BD=A0=E5=8F=AF= =E4=BB=A5=E8=AE=BE=E7=BD=AECONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=E3=80=82 =20 -=E6=B3=A8=E6=84=8F=EF=BC=9Apgtable_pte_page_ctor()=E5=92=8Cpgtable_pmd_pag= e_ctor()=E5=8F=AF=E8=83=BD=E5=A4=B1=E8=B4=A5--=E5=BF=85 +=E6=B3=A8=E6=84=8F=EF=BC=9Aptdesc_pte_ctor()=E5=92=8Cptdesc_pmd_ctor()=E5= =8F=AF=E8=83=BD=E5=A4=B1=E8=B4=A5--=E5=BF=85 =E9=A1=BB=E6=AD=A3=E7=A1=AE=E5=A4=84=E7=90=86=E3=80=82 =20 page->ptl @@ -90,7 +90,7 @@ page->ptl=E7=94=A8=E4=BA=8E=E8=AE=BF=E9=97=AE=E5=88=86=E5= =89=B2=E9=A1=B5=E8=A1=A8=E9=94=81=EF=BC=8C=E5=85=B6=E4=B8=AD'page'=E6=98=AF= =E5=8C=85=E5=90=AB=E8=AF=A5=E8=A1=A8=E7=9A=84=E9=A1=B5=E9=9D=A2struc =E7=9A=84=E6=8C=87=E9=92=88=E5=B9=B6=E5=8A=A8=E6=80=81=E5=88=86=E9=85= =8D=E5=AE=83=E3=80=82=E8=BF=99=E5=85=81=E8=AE=B8=E5=9C=A8=E5=90=AF=E7=94=A8= DEBUG_SPINLOCK=E6=88=96DEBUG_LOCK_ALLOC=E7=9A=84 =E6=83=85=E5=86=B5=E4=B8=8B=E4=BD=BF=E7=94=A8=E5=88=86=E9=A1=B5=E9=94= =81=EF=BC=8C=E4=BD=86=E7=94=B1=E4=BA=8E=E9=97=B4=E6=8E=A5=E8=AE=BF=E9=97=AE= =E8=80=8C=E5=A4=9A=E8=8A=B1=E4=BA=86=E4=B8=80=E4=B8=AA=E7=BC=93=E5=AD=98=E8= =A1=8C=E3=80=82 =20 -PTE=E8=A1=A8=E7=9A=84spinlock_t=E5=88=86=E9=85=8D=E5=9C=A8pgtable_pte_page= _ctor()=E4=B8=AD=EF=BC=8CPMD=E8=A1=A8=E7=9A=84spinlock_t -=E5=88=86=E9=85=8D=E5=9C=A8pgtable_pmd_page_ctor()=E4=B8=AD=E3=80=82 +PTE=E8=A1=A8=E7=9A=84spinlock_t=E5=88=86=E9=85=8D=E5=9C=A8ptdesc_pte_ctor(= )=E4=B8=AD=EF=BC=8CPMD=E8=A1=A8=E7=9A=84spinlock_t +=E5=88=86=E9=85=8D=E5=9C=A8ptdesc_pmd_ctor()=E4=B8=AD=E3=80=82 =20 =E8=AF=B7=E4=B8=8D=E8=A6=81=E7=9B=B4=E6=8E=A5=E8=AE=BF=E9=97=AEpage->ptl -= -=E4=BD=BF=E7=94=A8=E9=80=82=E5=BD=93=E7=9A=84=E8=BE=85=E5=8A=A9=E5=87=BD= =E6=95=B0=E3=80=82 diff --git a/include/linux/mm.h b/include/linux/mm.h index dc61aeca9077..dfa3e202099a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2858,11 +2858,6 @@ static inline bool ptdesc_pte_ctor(struct ptdesc *pt= desc) return true; } =20 -static inline bool pgtable_pte_page_ctor(struct page *page) -{ - return ptdesc_pte_ctor(page_ptdesc(page)); -} - static inline void ptdesc_pte_dtor(struct ptdesc *ptdesc) { struct folio *folio =3D ptdesc_folio(ptdesc); @@ -2872,11 +2867,6 @@ static inline void ptdesc_pte_dtor(struct ptdesc *pt= desc) lruvec_stat_sub_folio(folio, NR_PAGETABLE); } =20 -static inline void pgtable_pte_page_dtor(struct page *page) -{ - ptdesc_pte_dtor(page_ptdesc(page)); -} - #define pte_offset_map_lock(mm, pmd, address, ptlp) \ ({ \ spinlock_t *__ptl =3D pte_lockptr(mm, pmd); \ @@ -2967,11 +2957,6 @@ static inline bool ptdesc_pmd_ctor(struct ptdesc *pt= desc) return true; } =20 -static inline bool pgtable_pmd_page_ctor(struct page *page) -{ - return ptdesc_pmd_ctor(page_ptdesc(page)); -} - static inline void ptdesc_pmd_dtor(struct ptdesc *ptdesc) { struct folio *folio =3D ptdesc_folio(ptdesc); @@ -2981,11 +2966,6 @@ static inline void ptdesc_pmd_dtor(struct ptdesc *pt= desc) lruvec_stat_sub_folio(folio, NR_PAGETABLE); } =20 -static inline void pgtable_pmd_page_dtor(struct page *page) -{ - ptdesc_pmd_dtor(page_ptdesc(page)); -} - /* * No scalability reason to split PUD locks yet, but follow the same patte= rn * as the PMD locks to make it easier if we decide to. The VM should not = be --=20 2.39.2