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 88940E77188 for ; Fri, 3 Jan 2025 09:28:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDF746B0082; Fri, 3 Jan 2025 04:28:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D8F016B0085; Fri, 3 Jan 2025 04:28:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C56446B0088; Fri, 3 Jan 2025 04:28:47 -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 A41EC6B0082 for ; Fri, 3 Jan 2025 04:28:47 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2D4861A06A5 for ; Fri, 3 Jan 2025 09:28:47 +0000 (UTC) X-FDA: 82965612282.17.4FFA096 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf02.hostedemail.com (Postfix) with ESMTP id 812D780005 for ; Fri, 3 Jan 2025 09:27:06 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf02.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735896464; 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; bh=SqHwiMnjtBXaTnPPiHapkhzS+5DI8VRKfH/MexUMjA0=; b=Fpuab5APOfpIJ7LdXkb6DT9DBt+dlJLasfI0uYMrE6bpNcl0zuDl7Dbsxl1qHoN/ylq6JS NULsMXyO+qqBY8VKDpDYb7hhdlqi4nYMPokhDKB6CGeiUgGmMgguOh+0JdPi/wsJCKZYFr gFPYKl3xclj6VaidxIbOkxdM4gj2yVA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735896464; a=rsa-sha256; cv=none; b=jlrynmJyEKV9to3CgbbJtkBiqjnddZ9j/nno9nagAJsePQmu5voXGjEIYs6g2G220QrlAm OWHrGRPslyClRABpB7PXx2eQlHrzhOiX11BCZdLyKW4NUK4BLPG2DO8wNzCg4E+y7G8SUM M/xguqaXSSaQCX0T9n4LTTjol8E7b5A= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf02.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C0AF1480; Fri, 3 Jan 2025 01:29:12 -0800 (PST) Received: from [10.57.92.237] (unknown [10.57.92.237]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B8B153F673; Fri, 3 Jan 2025 01:28:35 -0800 (PST) Message-ID: <80cf6cae-11f6-4db2-816b-b1dcca3cee3e@arm.com> Date: Fri, 3 Jan 2025 10:28:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/10] Account page tables at all levels To: Dave Hansen , linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Dave Hansen , Linus Walleij , Andy Lutomirski , Peter Zijlstra , "Mike Rapoport (IBM)" , Ryan Roberts , Thomas Gleixner , Will Deacon , Matthew Wilcox , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, loongarch@lists.linux.dev, x86@kernel.org, Joerg Roedel References: <20241219164425.2277022-1-kevin.brodsky@arm.com> <765aec36-55a4-4161-bb30-4ff838bc2d98@arm.com> <989b55cf-1f9e-4b73-b3dd-d8b6a62be3f2@intel.com> Content-Language: en-GB From: Kevin Brodsky In-Reply-To: <989b55cf-1f9e-4b73-b3dd-d8b6a62be3f2@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 812D780005 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: xh7zfxgtzpn64zjez3caa5qtjx53wtfq X-HE-Tag: 1735896426-943165 X-HE-Meta: U2FsdGVkX1/PH6rZh+WlTB56j9s2PkKfrer8ubEsk+uut2AMof6376p3CeEc82qD9lm2Wc4eMIJT/7rut/KTw6EahouR4eL2jAQXa1of4hKEWhHsSe//0zwkB0duhgBgGPEqJRi7sA5OsZyTpVdleU8cCvr05D8e9bpKvCgnnC4/ad4KrRUSyYvywhYb6cXy2r/e4zEQe0QPMLjEFiHEEIAf6Ik8isi1WSQpQnpBjZLkOUcjUuDk+NQtLZj5CRlwEsKjGjG/gIpcDequFznxHaCS1EBpxNST4DoyUuyplYPfnNzlgJFTsAav/G/xJbOxVPA7i5gy/Ih2r09j70jtvqfD2LwnVLy2YMxQriZwHzKCPWrlbceddzR/IUimMwfZZWVCpa0d6/lKoX0x9rqzmWARxlrXLYxJhdg9gEGnp05Fvr0MpKQr7SgIuMWIcPlsV8JVVEfpXzc0FxK/knmT56pH8BEWvcaoE9bsl3GGztPLZf9BKAS00J+8oPZFkyuMFNH15H+hApbgVt071oHYrDRbEjW7A4h+rHqikjW7vSXKRkuEaR6A3E6cNXEeh64f2wHzYGl3V248fcLj9i8LmyeMdVc1k+uZS6UYKfSaq3RsKCM9AV7XrSKA/5QjinxQRjZVfmxf/hmPF6LmQtT3X04Ip5XvXYd7QeaCeu3Hbc6FY0+BfLOEVUXLT0nHe6uTXu+i4okRwy2nz0CvZYkMHc2XSaLd0PjmDegRFhBLKQYcrn0l7WXxK8q25Tgvg34Le0NYM2pfrarlxPQw0S6Z2fMD93k+8W7o3mjSv9n+muFrPjkloKaXvfWbHs9uC69BF1v4xTwkqTLJ/4mERYV486ERw8Bd/MJsvjsJytvRnQlUuRt7j8SexyGdvTCnYCvv1B6GoQyW+KFAx9LyX2d2uSbSLON08egTbTcV3Ue577R4SmYrn6ZD7NKTHKS75DWjyMfb7Fb+6rHzwnLVPtQ AQLbbrL4 7xgEDsugUORKn6Fj1c40AGpq1S1Y0t+L/07Lckz4WcY8exU0ea9qceoVHQcjtPWhgVLifkDpjp1PU1VtaU+6g/G4KloPona6i9/3t9Y1ucEi4yYpqdoz2Yieh+hC23chStktA3gotVb6TcIAhLBJJOY/KvGEzcVSQDyKi1CHkhZXLAPU= 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 20/12/2024 20:31, Dave Hansen wrote: > On 12/20/24 02:58, Kevin Brodsky wrote: >>> One super tiny nit is that the PAE pgd _can_ be allocated using >>> __get_free_pages(). It was originally there for Xen, but I think it's >>> being used for PTI only at this point and the comments are wrong-ish. >>> >>> I kinda think we should just get rid of the 32-bit kmem_cache entirely. >> That would certainly simplify things on the x86 side! I'm not at all >> familiar with that code though, would you be happy with providing a >> patch? I could add it to this series if that's convenient. > I hacked this together yesterday: > >> https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/log/?h=simplify-pae-20241220 > It definitely needs some more work. I'm particularly still puzzling > about why SHARED_KERNEL_PMD is used both as a trigger for 32b vs. > PAGE_SIZE PAE pgd allocations _and_ for the actual PMD sharing. > > Xen definitely needed the whole page behavior but I'm not sure why PTI did. > > Either way, that series should make the PAE PGDs a _bit_ less weird at > the cost of an extra ~2 pages per process for folks who are running > 32-bit PAE kernels with PTI disabled. > > But I think the diffstat is worth it: > > 5 files changed, 16 insertions(+), 96 deletions(-) That does look like a nice simplification! After the first patch, with my series, we could get rid of _pgd_alloc() and _pgd_free() in arch/x86/mm/pgtable.c and just call __pgd_alloc() and __pgd_free() directly. Considering that these changes are not trivial and may need more work, should I let you post those patches as a separate series? If it gets merged soon, I'll adapt my series, otherwise I can post a follow-up patch later if needed. - Kevin