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 578EEC77B7D for ; Mon, 8 May 2023 01:00:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A456B6B0078; Sun, 7 May 2023 20:59:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F4696B007D; Sun, 7 May 2023 20:59:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 895516B007E; Sun, 7 May 2023 20:59:59 -0400 (EDT) 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 798296B0078 for ; Sun, 7 May 2023 20:59:59 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 456F48057A for ; Mon, 8 May 2023 00:59:59 +0000 (UTC) X-FDA: 80765280918.27.CAB688C Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by imf22.hostedemail.com (Postfix) with ESMTP id E24F7C0005 for ; Mon, 8 May 2023 00:59:56 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm2 header.b="t /W9pml"; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="cwFPgg/l"; dmarc=none; spf=pass (imf22.hostedemail.com: domain of kirill@shutemov.name designates 64.147.123.24 as permitted sender) smtp.mailfrom=kirill@shutemov.name ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683507597; 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:dkim-signature; bh=9mr4/wH/xvTwG6JnN9j4VBc8laq91Nnaq1pB0ffavak=; b=CyZH8DOq/quTmElCkEX2/JZrp2sx0zOLLTecwykowctunyARw9BO0jzOgb0OJqqaon7zWI 7C73l3wxfUYEmeNg1GJGKjk9IjGeMxpTwuhYOJUKADGhCRG6wPvqdvoFSn+318KQAdLJKg SantfmdBgis2t4FDgJCFv+W6WsPH7Ak= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm2 header.b="t /W9pml"; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="cwFPgg/l"; dmarc=none; spf=pass (imf22.hostedemail.com: domain of kirill@shutemov.name designates 64.147.123.24 as permitted sender) smtp.mailfrom=kirill@shutemov.name ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683507597; a=rsa-sha256; cv=none; b=Q0YtCgW/Z0T1WFxixK1mq2QG7up7+Y4DgCCJNdFRJO0RQhBulc1ho2NeJEEZWRdVRMRWjL +zzuSPVdZFa84+K2phBlQiPu2W80rUHqY66SvYcY/yJT7tCXqe57YIx5mPY+iya/RlguIi WNiR+8xqRyrM3m5G18bCj4p+keBQlCo= Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 6E56C320090B; Sun, 7 May 2023 20:59:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 07 May 2023 20:59:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1683507593; x= 1683593993; bh=9mr4/wH/xvTwG6JnN9j4VBc8laq91Nnaq1pB0ffavak=; b=t /W9pml+33ePA2kUVO9/L8AFOCClVmAQayJd4awQ63u6LufabuiKQiENIMCGXxF0U qgu5FoOq28AR2v80j23gJicGkOSbyYsspjw+bFz+EQqyfL4OEpxkkDcXy3GzJfom AY12o7+sCtf1FTlsYQVaEQz9DC7uK6ekoKV6wly52k3gKLNCtuiQMsqTI54By7un 3Z6OXRw84do8JlEidpWFU93Ryo0gdlFVq2YRRNUN5DOXw7UTnCCvpNtpn0kYVlX7 U58ngPRzTf7ZfdSxNMzoJO7v4hr9GPHgRrmXyBmfy+KsUvm2jz3QxEasSG7WiUk3 hZCv0wybCjModsiHwfnyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1683507593; x=1683593993; bh=9mr4/wH/xvTwG 6JnN9j4VBc8laq91Nnaq1pB0ffavak=; b=cwFPgg/l9InA0OkHNrFQ5AYpbNTnl VXSoOQn8hu5RBz8Q+nyUZAZccPCta9DdhDvXsDdYgEF4UiglbEHApLoNgg0JAJFA yYANmO2zGK4e95zRTlV9eBQFMd82H7cdEfyGAOQd1esj9KgoPCW00XbOGsiBSdZe xaj9GuuV4aiXQ4OWaYectuLhmrVNmmFAn1LJOkf5Bx1KMQolHgmWgHxFcCMPvuGw fksIAYjS4DVV82qVBji2JDICvyXO34MNjF8emJ1etkVdXb0Ef/6NWsD+HrzAhaf4 e8DirIesHXvwLytJ9ER9+oU1Z/3mJb2kQjfROF+pCgnvRfnNZXHkdAGmA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefjedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehttd dttddttddvnecuhfhrohhmpedfmfhirhhilhhlucetrdcuufhhuhhtvghmohhvfdcuoehk ihhrihhllhesshhhuhhtvghmohhvrdhnrghmvgeqnecuggftrfgrthhtvghrnhephfeige fhtdefhedtfedthefghedutddvueehtedttdehjeeukeejgeeuiedvkedtnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkhhirhhilhhlsehshh huthgvmhhovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 May 2023 20:59:52 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 6E43210D1E7; Mon, 8 May 2023 03:59:49 +0300 (+03) Date: Mon, 8 May 2023 03:59:49 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [LSF/MM/BPF] Whither Highmem? Message-ID: <20230508005949.fg2apsozarbcahnr@box.shutemov.name> References: <20230507234330.cnzbumof2hdl4ci6@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: fhh16h5oys9rjdgmpwqo1qzbnnreb878 X-Rspam-User: X-Rspamd-Queue-Id: E24F7C0005 X-Rspamd-Server: rspam07 X-HE-Tag: 1683507596-340228 X-HE-Meta: U2FsdGVkX1+H/l+63GS/8r0TYebbjT5AJGR736YXoTIKI8atW2sG+JkO//M/rrUssedwlOsRchbm3TubX6bDz0NzUwhr50YZZJanaViYMjFtWo7wD5Vp+Y9Q6HTGUGr+AjIuA3Dtg9bGsb+AZNLCNNWWsTBquvY+UsTiqm8ak8D5b1Y4zm7ugomrbxvObLMJ1pNmI7pBloAkcl3owsTs4CR8sFEYmQLj2j1u1A53hVA/4dPOuI8mmrapIRwrrXEHswEoqKm1RAx+OIErBaVYtp9Bd1ipD66y3pl78QMEjtd6jMN5K5X+3BxzwZ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org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 08, 2023 at 01:23:24AM +0100, Matthew Wilcox wrote: > On Mon, May 08, 2023 at 02:43:30AM +0300, Kirill A. Shutemov wrote: > > On Mon, May 08, 2023 at 12:20:42AM +0100, Matthew Wilcox wrote: > > > > > > I see there's a couple of spots on the schedule open, so here's something > > > fun we could talk about. > > > > > > Highmem was originally introduced to support PAE36 (up to 64GB) on x86 > > > in the late 90s. It's since been used to support a similar extension > > > on ARM (maybe other 32-bit architectures?) > > > > > > Things have changed a bit since then. There aren't a lot of systems > > > left which have more than 4GB of memory _and_ are incapable of running a > > > 64-bit kernel. > > > > Actual limit is lower. With 3G/1G userspace/kernel split you will have > > somewhere about 700Mb of virtual address space for direct mapping. > > > > But, I would like to get rid of highmem too. Not sure how realistic it is. > > Right, I was using 4GB because on x86, we have two config options that > enable highmem, CONFIG_HIGHMEM4G and CONFIG_HIGHMEM64G. If we get rid > of the latter, it could be a nice win? Not really. CONFIG_HIGHMEM64G is basically synonym for PAE that has more goodies beyond wider phys_addr_t, like NX bit support. PAE and HIGHMEM4G are mutually exclusive (but NOHIGHMEM is fine). > Also, the more highmem we have, the more kinds of things we need to put in > highmem. Say we have a 3:1 ratio of high to lowmem. On my 16GB laptop, > I have 5GB of Cached and 8.5GB of Anon. That's 13.5GB, so assuming that > ratio would be similar for a 4GB laptop, it's 5.4:1 and storing _just_ > anon & cached pages in highmem would be more than enough. > > (fwiw, PageTables is 125MB) > > Maybe there's a workload that needs, eg page tables or fs metadata to > be stored in highmem. Other than pathological attempts to map one > page per 2MB, I don't think those exist. > > Something I forgot to say is that I do not think we'll see highmem being > needed on 64-bit systems. I hope not. CPU designers must know by now to provide at least 2-bit wider virtual address space than physical address space. > We already have CPUs with 128-bit registers, > and have since the Pentium 3. 128-bit ALUs are missing, but as long as > we're very firm with CPU vendors that this is the kind of nonsense up > with which we shall not put, I think we can get 128-bit normal registers > at the same time that they change the page tables to support more than > 57 bits of physical memory. Current architectural limit on x86 PA is 52. I think we would need 128-bit PTEs before we run out of physical address space (or get 128-bit GPRs). We don't have bits for new features in PTE and started to eat out PFN bits. -- Kiryl Shutsemau / Kirill A. Shutemov