From mboxrd@z Thu Jan 1 00:00:00 1970 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 5F9E6C3DA49 for ; Tue, 30 Jul 2024 08:10:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4D556B007B; Tue, 30 Jul 2024 04:10:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFD116B0083; Tue, 30 Jul 2024 04:10:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9DA66B0085; Tue, 30 Jul 2024 04:10:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8BB8C6B007B for ; Tue, 30 Jul 2024 04:10:40 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E569CC018E for ; Tue, 30 Jul 2024 08:10:39 +0000 (UTC) X-FDA: 82395697398.16.8988287 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf27.hostedemail.com (Postfix) with ESMTP id 001AD40020 for ; Tue, 30 Jul 2024 08:10:37 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="m6k19H/a"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of seakeel@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=seakeel@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722326977; 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:in-reply-to:references:references:dkim-signature; bh=4/S17o3ryXO92fKPDsd+20QrVlSG6ehQAGuA4AgUnAA=; b=SyCDGfGoZiT4DKlhug2R0+PbtisF5ENreQidz1OR+weo8Tai+jQu9hRGz0p4Zb6V/Uq6aX ZJq9QQql6bVK3mjS9BuoZgKhD2FW4/G/D3OCput1Jt/Fwn5Hqgw6o98gdSrxOHclCKSKlp jpErjik9FWnBcjd3Q6xwgkgBJOVKNlQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722326977; a=rsa-sha256; cv=none; b=tlsfnllwuDGdVvXFahZ/uX7An8FXWCi2UpVENLc0rO0tZQtVDNoAKYfYp/oIq2kRtpqNkJ 4zWcupCpO6gBZkzDYq9JZUAnid58OwPsc+IR4Er7TJnw+4WSIj55oI6BofQWHPzNfnmxZL UW2O30Ws02kSPfuc+vNzGrJBJn09XQ0= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="m6k19H/a"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of seakeel@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=seakeel@gmail.com Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2cdadce1a57so2686985a91.2 for ; Tue, 30 Jul 2024 01:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722327037; x=1722931837; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4/S17o3ryXO92fKPDsd+20QrVlSG6ehQAGuA4AgUnAA=; b=m6k19H/a4UcG8DewkAbp3UezSGI8zVO/d3WLvwDhRkGE5nEeuBnufhJJQRKYuYwdO6 jq2e1QRmmBNvBJw0vCw9GuoitZxqsXN7dFol+81XYmd2FHj5D8ZBt9P12awYRDP3r6/C RkrCRiFH1Pv4ZH5DUO0mmjdEjdFWoltJq+q9jQ8uyAxkZbXtkf2ly9P0bkl9aounS7hk J6e4JPU/G/LQgWBQ98WNn18kglBupUNinRJU7Rt2+Tb78uhC46jaC/spA7lT1q3Qc5qX 1p3WGeQUBFLYmvGNC3bPV8izpJvWdhFdvLqOvaopZFmiouy5Uf6Epj1vjBsLW0o8mi6p Dkcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722327037; x=1722931837; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4/S17o3ryXO92fKPDsd+20QrVlSG6ehQAGuA4AgUnAA=; b=gWwgXQh3VUiF3liKkE+LzVWs/f/3WBDd5bON5GeKX2/LxIlvf09cjBQDQ99/2qnrE3 cpC9AhW8IvKbfxGIjw8h8YQBT8o36y/d4S8393OvIafjtOBiZ2KKt0qdMke2HPaoZKZt gyiGVcSGnNahN7cfDrIvrj8ku7gnHImiW6AJgLo6wawdSucve+lA9+ecpTJ1Msv/TRw4 ylLLSzv+DsbpXN6j25UegeD3X12mi0PNTuMP3iuVLZIC2pc9oVm0KbE7ZWO/DwuJaOeE kUhTuzRmP2zw+mbZfjxQgX1d+/bvt4PvB/yo7YIZW26WrZz+eR/33SY4prNThgwqtt3I zE4w== X-Forwarded-Encrypted: i=1; AJvYcCWAk/Iv7LtiTmPjTl8aRTofC4S3vGURdoteapvpkcu68icz+DzhFFyXK/NBpGvxeS90EXPnt1KIyts/HzfhS++L0YU= X-Gm-Message-State: AOJu0Yyzkgqjun8AJSKXZa8OvWKLzI/+vLoU4Fc1rT3xpcNFsWyvQOJI X9pyiDupWlE3byQzL1xipF5Cvo5FzgucR4RtqsHX/LJN21DAFEqb X-Google-Smtp-Source: AGHT+IHd+8idtSf9No9KXFiHPkFqgsgm8Dqu198TXfzlUpyaNdqot/AMDpkwkaetathdKfNuieqdfQ== X-Received: by 2002:a17:90b:3a90:b0:2c9:9fdf:f72e with SMTP id 98e67ed59e1d1-2cf7e606d04mr8262857a91.26.1722327036447; Tue, 30 Jul 2024 01:10:36 -0700 (PDT) Received: from [192.168.255.10] ([43.132.141.24]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cf28e3cbaasm9886868a91.51.2024.07.30.01.10.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jul 2024 01:10:35 -0700 (PDT) Message-ID: Date: Tue, 30 Jul 2024 16:10:23 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 00/18] use struct ptdesc to replace pgtable_t To: alexs@kernel.org, Will Deacon , "Aneesh Kumar K . V" , Nick Piggin , Peter Zijlstra , Russell King , Catalin Marinas , Brian Cain , WANG Xuerui , Geert Uytterhoeven , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Naveen N Rao , Paul Walmsley , Albert Ou , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Andy Lutomirski , Bibo Mao , Baolin Wang , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Qi Zheng , Vishal Moola , "Aneesh Kumar K . V" , Kemeng Shi , Lance Yang , Peter Xu , Barry Song , linux-s390@vger.kernel.org Cc: Guo Ren , Christophe Leroy , Palmer Dabbelt , Mike Rapoport , Oscar Salvador , Alexandre Ghiti , Jisheng Zhang , Samuel Holland , Anup Patel , Josh Poimboeuf , Breno Leitao , Alexander Gordeev , Gerald Schaefer , Hugh Dickins , David Hildenbrand , Ryan Roberts , Matthew Wilcox References: <20240730064712.3714387-1-alexs@kernel.org> Content-Language: en-US From: Alex Shi In-Reply-To: <20240730064712.3714387-1-alexs@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 001AD40020 X-Stat-Signature: 3q4uz6pk7ooi35cmc7c69axi9af9z1s5 X-Rspam-User: X-HE-Tag: 1722327037-889947 X-HE-Meta: U2FsdGVkX19cDT1R22/3MlS9YPMVA4QPXAVYEU5uwS/pKhU/6daVZSBEb5qP4QZbfUCL+v/Zv/iOegmCIBPIbhKqbJyGyHfLuld2mYvZkWJxBOyRfghEwpg62pqitRWUVFg9F+nhvSDgY0jaUvuhBCoiniKbFKK/xp6pBB/0ijJZZvqNzK4yvZm7/3cK1ERDO1TztFfvBalnfMVFW0pJl3Zau6EfEn198cbymdVS22/GEfJsrK3xalALW3mEWvYtu01e2ncOZ7tVhwzo/K/HmT75l7m3HWmAaIqfQbMdn6OismyoeH0OekFSaD2dQUXERlH9ZjD+rKjaduhdbVo+zVa6jkbR+/iDJDiq26d45/4r0ASTrcn03sDtR9haMyFuOSrEDA0nyxGlzVrQCl23HFXKJaDzRnNJmD6dfH9gNcjXE0r6rUpGh773gyGjNALZBmJmyZSb7KzzyFqqWQpaSjDZW4zrGcobn57bWBzonLjkdzMbSmFfzJuj4jmugUj5MNGHLfqnVXaXqvKEY6BKsGb4y0phlXQNLUz0LlfHUzOKiF2TPKplutDeZTQum4yLr2GBHFhX2PJcYfHvypd1jj0Z55A4XYc9a1g3lcX1VYoTMCAuGzN2gpiCDw/FG6FueuAPC+TMjR9Tgqds4TqimYxDDfu3y/rEJ3YetabQi5pu7Dv6unPpxeGudtnCiFnbKdmNqfZi/kvGBKh6XO/IyBX9hZ2tI+4aP9siB/SE7KvG95WRXCouvRuGceVYHHDt0E2K/4NJ7mq4P0qCTBAQN50FZbk2N3LH1Me+EjM9oXKfjzhJvbiMowVg2biwZeHtvL1cGbv3sS3EiHxPzv5iuFIWgodMU3g34LnFFYtIC6CtSzaqa9HOOwDC483//RzQ4ET40XT+/wDEHYW/hAxS2xs64l3zbyoskthclNMBkqpCKkEpKTn1h8Lrj7tDBokG+yYgRm92FrYtlXuZKSY kKPf4oJp EwjeYS4ZJrR47kyNlPSb5Lkd317B263JS7+QGJF1SS3x9FTzsUhK9SU5B9nLV0f9bmonZlNUuzdvdi4SVrEmgqwQVlPwy0cBkzL7gysUB9F2bIUpy5GrB5EwfnSkm7SHd3lzK4813GDaB2FicbYWOn7PK7nWZy97NCgs1KBOBTIb9ts9KnnONxcAuMQv6Wxy0/aK4FvA79ThnWtX11Npw6ozZKZ7jb3fvsPSPsp7MIxTRJZCJZsJnSL0yFWGoWxPP9UcgTgiELMCzVc87OVI3Z890uhTvjMCZq6jus6ZLNIQhMZ2xxn2Dnb2LsMLy+MGB/uiV5CKM8JJBh3I9AcvjJB6+mf284+1pVnTI5I7mEjMnwf6jLxzpSpLWr0mZYjWCU+hSz6dgQV+llFZFAt92u2heXtk9P48qkjpVBtwP9MiQtHdbicTS1eTRgEwzbKZYpbm/TQk1zeDCdNt3nu8Hn1PWdYkKYYk3nPyfS8fygx9JjoM9oooPna3XTszNDMBfn/EsLZOpm0lpygAEO0fLTLJUyXkLUZkR3hIsez1aaFV7gSE= 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: BTW, the patchset based on the latest git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable branch. On 7/30/24 2:46 PM, alexs@kernel.org wrote: > From: Alex Shi > > We have struct ptdesc for page table descriptor a year ago, but it > has no much usages in kernel, while pgtable_t is used widely. > > The pgtable_t is typedefed as 'pte_t *' in sparc, s390, powerpc and m68k > except SUN3, others archs are all same as 'struct page *'. > > These blocks the conception and code update for page table descriptor to > struct ptdesc. > > So, the simple idea to push the ptdesc conception forward is to update > all pgtable_t by ptdesc or pte_t pointer. But this needs widely > knowledges for most all of different archs. Common code change is easy > for include/ and mm/ directory, but it's hard in all archs. > > Thanks for intel LKP framework, I fixed most all of build issues except > a bug on powerpc which reports a "struct ptdesc *" incompatible with > struct ptdesc *' pointer issue... > > Another trouble is pmd_pgtable() conversion in the last patch. > Maybe some of arch need define theirself own pmd_ptdesc()? > > This patchset is immature, even except above 2 issues, I just tested > virutal machine booting and kselftest mm on x86 and arm64. > > Anyway any input are appreciated! > > Thanks > Alex > > Alex Shi (18): > mm/pgtable: use ptdesc in pte_free_now/pte_free_defer > mm/pgtable: convert ptdesc.pmd_huge_pte to ptdesc pointer > fs/dax: use ptdesc in dax_pmd_load_hole > mm/thp: use ptdesc pointer in __do_huge_pmd_anonymous_page > mm/thp: use ptdesc in do_huge_pmd_anonymous_page > mm/thp: convert insert_pfn_pmd and its caller to use ptdesc > mm/thp: use ptdesc in copy_huge_pmd > mm/memory: use ptdesc in __pte_alloc > mm/pgtable: fully use ptdesc in pte_alloc_one series functions > mm/pgtable: pass ptdesc to pte_free() > mm/pgtable: introduce ptdesc_pfn and use ptdesc in free_pte_range() > mm/thp: pass ptdesc to set_huge_zero_folio function > mm/pgtable: return ptdesc pointer in pgtable_trans_huge_withdraw > mm/pgtable: use ptdesc in pgtable_trans_huge_deposit > mm/pgtable: pass ptdesc to pmd_populate > mm/pgtable: pass ptdesc to pmd_install > mm: convert vmf.prealloc_pte to struct ptdesc pointer > mm/pgtable: pass ptdesc in pte_free_defer > > arch/alpha/include/asm/pgalloc.h | 4 +- > arch/arc/include/asm/pgalloc.h | 4 +- > arch/arm/include/asm/pgalloc.h | 13 +-- > arch/arm/include/asm/tlb.h | 4 +- > arch/arm/mm/pgd.c | 2 +- > arch/arm64/include/asm/pgalloc.h | 4 +- > arch/arm64/include/asm/tlb.h | 4 +- > arch/csky/include/asm/pgalloc.h | 4 +- > arch/hexagon/include/asm/pgalloc.h | 8 +- > arch/loongarch/include/asm/pgalloc.h | 8 +- > arch/m68k/include/asm/motorola_pgalloc.h | 12 +- > arch/m68k/include/asm/sun3_pgalloc.h | 4 +- > arch/microblaze/include/asm/pgalloc.h | 2 +- > arch/mips/include/asm/pgalloc.h | 4 +- > arch/nios2/include/asm/pgalloc.h | 4 +- > arch/openrisc/include/asm/pgalloc.h | 8 +- > arch/parisc/include/asm/pgalloc.h | 2 +- > arch/powerpc/include/asm/book3s/32/pgalloc.h | 4 +- > arch/powerpc/include/asm/book3s/64/hash-4k.h | 4 +- > arch/powerpc/include/asm/book3s/64/hash-64k.h | 4 +- > arch/powerpc/include/asm/book3s/64/pgalloc.h | 4 +- > arch/powerpc/include/asm/book3s/64/pgtable.h | 8 +- > arch/powerpc/include/asm/book3s/64/radix.h | 4 +- > arch/powerpc/include/asm/pgalloc.h | 8 +- > arch/powerpc/mm/book3s64/hash_pgtable.c | 10 +- > arch/powerpc/mm/book3s64/radix_pgtable.c | 10 +- > arch/riscv/include/asm/pgalloc.h | 8 +- > arch/s390/include/asm/pgalloc.h | 4 +- > arch/s390/include/asm/pgtable.h | 4 +- > arch/s390/mm/pgalloc.c | 2 +- > arch/s390/mm/pgtable.c | 14 +-- > arch/sh/include/asm/pgalloc.h | 4 +- > arch/sparc/include/asm/pgalloc_32.h | 6 +- > arch/sparc/include/asm/pgalloc_64.h | 2 +- > arch/sparc/include/asm/pgtable_64.h | 4 +- > arch/sparc/mm/init_64.c | 2 +- > arch/sparc/mm/srmmu.c | 6 +- > arch/sparc/mm/tlb.c | 14 +-- > arch/x86/include/asm/pgalloc.h | 10 +- > arch/x86/mm/pgtable.c | 8 +- > arch/xtensa/include/asm/pgalloc.h | 12 +- > fs/dax.c | 14 +-- > include/asm-generic/pgalloc.h | 10 +- > include/linux/mm.h | 16 ++- > include/linux/mm_types.h | 4 +- > include/linux/pgtable.h | 6 +- > mm/debug_vm_pgtable.c | 6 +- > mm/huge_memory.c | 103 +++++++++--------- > mm/internal.h | 2 +- > mm/khugepaged.c | 14 +-- > mm/memory.c | 15 +-- > mm/mremap.c | 2 +- > mm/pgtable-generic.c | 37 +++---- > 53 files changed, 240 insertions(+), 236 deletions(-) >