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 ED614C25B75 for ; Sun, 26 May 2024 11:05:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2231E6B0082; Sun, 26 May 2024 07:05:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D3CC6B0083; Sun, 26 May 2024 07:05:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C2B06B0085; Sun, 26 May 2024 07:05:03 -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 E1E5A6B0082 for ; Sun, 26 May 2024 07:05:02 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EBCF6121361 for ; Sun, 26 May 2024 11:05:01 +0000 (UTC) X-FDA: 82160264802.05.E62C391 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf04.hostedemail.com (Postfix) with ESMTP id AEF2340007 for ; Sun, 26 May 2024 11:04:59 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716721500; a=rsa-sha256; cv=none; b=qZ4MlRyB4NKeJPbyF8WLEEUYN5crnsvWYowohk6HapM/w6Uwq82SZdryRjhrE2pamDdyUF hCOct8WXPkDVHkV5E9nJsNP2SiZ0iOBwDFRDQguFa3v2fO+aJkLjl7Owr2bGV1lSDVtAwp DrEr2fourm2T+N6wVnrviMkB09DG0MQ= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716721500; 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: in-reply-to:in-reply-to:references:references; bh=f6hfFcU+6ADL9kV96GYlnV9Y6I9I0M+uJEm9b9ubqHw=; b=7FpjIgmsTb+MmCDWxYULgrs0Q//exv8OIOkxYlTb0lYAxsTp1wB8HMdL0ICSLl89TVlKlG cD82Po+HDQ6WoCGJB6EITdxytoINq3rRT4vJVdg//8wGKoKkfrL9DWqeL4w7AC2kCntkkb HgaPA5DmzD0EMHDkdlEdi4RNOPue7XA= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D4B6B5C908; Sun, 26 May 2024 11:04:57 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4C7C913A51; Sun, 26 May 2024 11:04:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id pqKBD1kXU2ZiZgAAD6G6ig (envelope-from ); Sun, 26 May 2024 11:04:57 +0000 Date: Sun, 26 May 2024 13:04:51 +0200 From: Oscar Salvador To: Christophe Leroy Cc: Andrew Morton , Jason Gunthorpe , Peter Xu , Michael Ellerman , Nicholas Piggin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC PATCH v3 00/16] Reimplement huge pages without hugepd on powerpc (8xx, e500, book3s/64) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: AEF2340007 X-Stat-Signature: ckgy1pyxqjiabj5zb1dd9k53kn7n57q8 X-HE-Tag: 1716721499-54497 X-HE-Meta: U2FsdGVkX1/lt8on7pjvtNfhFHBI3zo2Q0LyvlCCuIVEFeZK/T482xr8ckHR6iWNSbUPXwX7AH9TncP7nOFetOFRaV1tOM/QAl1bjWi/Oj9lD4Aj+jiYLL3TsUhQe2VhHso0Ed4svow1+rmGBHtPqwx0uJvznRr1rk0UFHUreu8+n5D/GJtvDbQHe447XAU/Pu2cIguKf55uDdoVi90vJLOGH1+rxsZyvqQr1WsSo5OZy44DwAa1ugyCeJ8vTn/rnI4e+3IovrpjtpV1Y3OOrBpaDGBNbHnYXLbR51S93cruYckfrMtdc0CPqPJYCAY+9CrotUuvTK5VjdmbvtF4mw9+5SVXL3+O335oSP2NoE5S0+uVV3hQ87VyQx4jZTw2+93td+YCppo8VwN9rJeWmzzVkm03GnpvEXksSH/ACWCUb2KVc2DciAuYSRKxbwIJxsn/YHicVb9OxsgfbS4rRQk/Ofxn6TTBLOZJ8krQ9bOCwupEzLuB5+lvWk1g6V/PQjRkDOCZGfzuTmztMBt06i522rGRy14bmHtk3FrDTA48K+JLv86OLrYd7qU403SmB2l7/5Bm6304nGjfDyyx9lzy6d9HihtW4cS70RzdrwLRvMXnkE/w1zslm8YYz/R8JclbKyINrf7cCDbf2p3M13F+56gJiIgRdD1FpGmTrHDqPkyLCfL8DKJPHK0YrQE2I8gRl/bM7iCzfiackkoG3cclPSmtuvKE5NbHP/hxUw8/n++JMqiSdTlBgYuKONSCoiRByJCHlZQT/tatYfjN9Um4UNLn514ggF/l5uFiupSPDQKvJ6uHurIxGaDA0k3GaIJLkIlsiBehkVWICnF0nAPeFOh1zBjJmSZZwni3kkJO+RlYBQjjaCtKZjipcZboms2+JxgbLkTGT3OzkQNySrvsfK2J/7hxPkhO7XrMXpn7FJo0fX3dLrNiP/zwZNmAd+b1l49q2ZoS7lzCM4P DbrVYn0F Q0nnWbwRCA/vrfHRvI7KQhZUN2FjBT/00/hu9m2wdPAe98UHC8UZh33edkgM4nN9xepo3A2GvtqeQfRDL3SxB3zLJDr84CE5mSYupH0Xe2EHjBAevWNxNJv8dBg== 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: On Sun, May 26, 2024 at 11:22:20AM +0200, Christophe Leroy wrote: > This is the continuation of the RFC v1 series "Reimplement huge pages > without hugepd on powerpc 8xx". It now get rid of hugepd completely > after handling also e500 and book3s/64 > > Also see https://github.com/linuxppc/issues/issues/483 > > Unlike most architectures, powerpc 8xx HW requires a two-level > pagetable topology for all page sizes. So a leaf PMD-contig approach > is not feasible as such. > > Possible sizes on 8xx are 4k, 16k, 512k and 8M. > > First level (PGD/PMD) covers 4M per entry. For 8M pages, two PMD entries > must point to a single entry level-2 page table. Until now that was > done using hugepd. This series changes it to use standard page tables > where the entry is replicated 1024 times on each of the two pagetables > refered by the two associated PMD entries for that 8M page. > > For e500 and book3s/64 there are less constraints because it is not > tied to the HW assisted tablewalk like on 8xx, so it is easier to use > leaf PMDs (and PUDs). > > On e500 the supported page sizes are 4M, 16M, 64M, 256M and 1G. All at > PMD level on e500/32 (mpc85xx) and mix of PMD and PUD for e500/64. We > encode page size with 4 available bits in PTE entries. On e300/32 PGD > entries size is increases to 64 bits in order to allow leaf-PMD entries > because PTE are 64 bits on e500. > > On book3s/64 only the hash-4k mode is concerned. It supports 16M pages > as cont-PMD and 16G pages as cont-PUD. In other modes (radix-4k, radix-6k > and hash-64k) the sizes match with PMD and PUD sizes so that's just leaf > entries. The hash processing make things a bit more complex. To ease > things, __hash_page_huge() is modified to bail out when DIRTY or ACCESSED > bits are missing, leaving it to mm core to fix it. > > Global changes in v3: > - Removed patches 1 and 2 > - Squashed patch 11 into patch 5 > - Replaced patches 12 and 13 with a series from Michael > - Reordered patches a bit to have more general patches up front > > For more details on changes, see in each patch. > > Christophe Leroy (15): > mm: Define __pte_leaf_size() to also take a PMD entry > mm: Provide mm_struct and address to huge_ptep_get() > powerpc/mm: Remove _PAGE_PSIZE > powerpc/mm: Fix __find_linux_pte() on 32 bits with PMD leaf entries > powerpc/mm: Allow hugepages without hugepd > powerpc/8xx: Fix size given to set_huge_pte_at() > powerpc/8xx: Rework support for 8M pages using contiguous PTE entries > powerpc/8xx: Simplify struct mmu_psize_def > powerpc/e500: Remove enc and ind fields from struct mmu_psize_def > powerpc/e500: Switch to 64 bits PGD on 85xx (32 bits) > powerpc/e500: Encode hugepage size in PTE bits > powerpc/e500: Use contiguous PMD instead of hugepd > powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD > powerpc/mm: Remove hugepd leftovers > mm: Remove CONFIG_ARCH_HAS_HUGEPD I glanced over it and it looks much better, not having to fiddle with other arch code and generic declarations is a big plus. I plan to do a proper review tomorrow. Thanks for working on this Christophe! -- Oscar Salvador SUSE Labs