From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72DB330596B for ; Wed, 10 Sep 2025 12:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757507576; cv=none; b=spe2NajfZiJsk5eavB6j9wEqMyUFXY/84dyqaclSmV7Bl/rkxZuXF5A2E74BQSb3ninuFUFyYYTnlkE7Y8DM1lSt8tgz0+G/twrkmQ/jCsH8IUQiHt6Sx0kLGbKj6EHjWfyG3+rKjHb/Db++v0DyUy9+cBD4mMxxInkCSmFM/MY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757507576; c=relaxed/simple; bh=n1DtndBK5g3HRGB5wLktmQuCwMaE4fiNt3Dq7k07L0I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kxZlYXQfb6Eab3RpiLi0TqFkrO6SHUH+WxoGF0IgnBvkQbW89Woxenlg9ctO50p4YKqIIeNp2Gj2qTqqOEekTB0e4bKxeKZFAo4MThAq+rgCj7vowEDy7Fs7wm/Mg9Y0Yczx8H+byU+/ERzXEIlW17aYMePZpvwklh/9QlLnbWs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gkU91/lF; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gkU91/lF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757507573; h=from:from: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:autocrypt:autocrypt; bh=LViYUFGFqV7wdk7rT7+n+ckEpLRp2oc7FTXBWlnTc1s=; b=gkU91/lFqFoIbG7MXi/zMQWf1G/KzQ1Kwf5VvIOH/u+LKOyFsPhZUem5QGYa5AiTBE/jGp ROTwX6Z7adZfycOVJnr7h9ND7HDEf/TJ48b7PNVlKOv+ujbH96JXu/GlOa71baRAdkk79m +1n0Qv20n5FqDtodgY613gw67GzcgvU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-nLTYHUzpNrOvZxlI8-jFqw-1; Wed, 10 Sep 2025 08:32:52 -0400 X-MC-Unique: nLTYHUzpNrOvZxlI8-jFqw-1 X-Mimecast-MFC-AGG-ID: nLTYHUzpNrOvZxlI8-jFqw_1757507571 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-45b990eb77cso3966405e9.0 for ; Wed, 10 Sep 2025 05:32:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757507571; x=1758112371; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from: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=LViYUFGFqV7wdk7rT7+n+ckEpLRp2oc7FTXBWlnTc1s=; b=us+C0QQEniTNHGkt+s+xCMkJgv/66ojTGYNhTFuP59giqSx/GLE43YYzxHgJQk0awv Q8uS2agAddiaCxuttJ4hAAQAK7vBVe7PultdqcJawy2Rds82vQiJEV3TAzLaFzNVms+M lErMkeHfUFXHRmdHl9alMOZ6WDZAHWuAH19IDn3K1rtI36FtPgdFYOGyrAgbyvNhj8a9 pv5dHGhhBmC9nEaQ6Mm+5s8bJ2nLWGknqOGOJXRCoi/QPqwprR1lS+7mvcETUH+wjK0R b0IjORtudJvhhhuTLAOksVIDny3zjHIEybx9eCNbMDb4NsM37dKJBpWqla13KpAyc4C6 lEXw== X-Gm-Message-State: AOJu0Ywh9XMbeIQSUxaFbYhOqQguDssZy1Ip5DLE79Ts3sO5BS4Z4ksT EwM+enSPolaCHMzD2Y6ve3Ye1NJFxGUS3b3scJfaJsQZsF+O0jqF/k94a9T5Hc03fGOLpV0X92Q UYRHplx1JHyzXfo+jKiOZxZoAo/RLaPNqUn5cfe93JWyhf/v1fLPUJvSzSp8= X-Gm-Gg: ASbGnctZQNoMUqGTadui5xXfrUWwKvIZkj7HBSCLqtfRWXlmvOfnNeufkUWgUmxFZWQ q1sDzfkgW9LZA3xtElKlOwET6xBVXNokR4M+5EEDd5jqTySUBOiLIRnEQPAj5CnlrYx/J1w/tKO 3Vjk8KvthC9+r5kMzxX1KLSDDsnHx0M/BLhiXNpweIAXA7iQOXst6RFvAeqKX+5Mw2kDW5BeY7G l2fzZEZXbNLY+Ax3MYYPTWfiqv2o8JO8e28V4CpCDiGAgLM6hxNa9X1wguC9km4DQGMPJNV4u1C 0qTWMOxMJKdxcwC40jsHx3nnYXjBSbvN2z3y1oTS805Q3Do4shzF0bo0GdcXVdxToPeZRmRn/jR ddi4Wc+a3bJ8CRwDc7V3RUyHZkb+Vb8Yc8+eq3S1RsHyYfemcjIc/QtIiseP9LAVz7IU= X-Received: by 2002:a05:600c:3b1d:b0:45b:8ac2:9761 with SMTP id 5b1f17b1804b1-45dde20e5c0mr148260725e9.13.1757507570799; Wed, 10 Sep 2025 05:32:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/W9Mmo72Y7k0e/5lev9LwiyPK0j0L4lMPmSP/XxC16yAcbXhF14eU/SqL+2U67nqcP2mA5Q== X-Received: by 2002:a05:600c:3b1d:b0:45b:8ac2:9761 with SMTP id 5b1f17b1804b1-45dde20e5c0mr148260265e9.13.1757507570271; Wed, 10 Sep 2025 05:32:50 -0700 (PDT) Received: from ?IPV6:2003:d8:2f17:9c00:d650:ab5f:74c2:2175? (p200300d82f179c00d650ab5f74c22175.dip0.t-ipconnect.de. [2003:d8:2f17:9c00:d650:ab5f:74c2:2175]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e7521bfd08sm6588369f8f.4.2025.09.10.05.32.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Sep 2025 05:32:49 -0700 (PDT) Message-ID: Date: Wed, 10 Sep 2025 14:32:47 +0200 Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [TECH TOPIC] Reaching consensus on CONFIG_HIGHMEM phaseout To: Arnd Bergmann , Matthew Wilcox Cc: ksummit@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, imx@lists.linux.dev, Christophe Leroy , Richard Weinberger , Lucas Stach , Linus Walleij , Geert Uytterhoeven , Ankur Arora , Mike Rapoport , Lorenzo Stoakes , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Suren Baghdasaryan , Ira Weiny , Nishanth Menon , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Alexander Sverdlin , "Chester A. Unal" , Sergio Paracuellos , Andreas Larsson References: <4ff89b72-03ff-4447-9d21-dd6a5fe1550f@app.fastmail.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI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dCyx+t/ga6x2rHyc8Sl86oK1tvAkwBNsfKou3v+jP/l14a7DGBvrmlYjO 59o3t6inu6H7pt7OL6u6BQj7DoMAEQEAAcLBfAQYAQgAJgIbDBYhBBvZyq1zXEw6Rg38yk3e EPcA/4NaBQJonNqrBQkmWAihAAoJEE3eEPcA/4NaKtMQALAJ8PzprBEXbXcEXwDKQu+P/vts IfUb1UNMfMV76BicGa5NCZnJNQASDP/+bFg6O3gx5NbhHHPeaWz/VxlOmYHokHodOvtL0WCC 8A5PEP8tOk6029Z+J+xUcMrJClNVFpzVvOpb1lCbhjwAV465Hy+NUSbbUiRxdzNQtLtgZzOV Zw7jxUCs4UUZLQTCuBpFgb15bBxYZ/BL9MbzxPxvfUQIPbnzQMcqtpUs21CMK2PdfCh5c4gS sDci6D5/ZIBw94UQWmGpM/O1ilGXde2ZzzGYl64glmccD8e87OnEgKnH3FbnJnT4iJchtSvx yJNi1+t0+qDti4m88+/9IuPqCKb6Stl+s2dnLtJNrjXBGJtsQG/sRpqsJz5x1/2nPJSRMsx9 5YfqbdrJSOFXDzZ8/r82HgQEtUvlSXNaXCa95ez0UkOG7+bDm2b3s0XahBQeLVCH0mw3RAQg r7xDAYKIrAwfHHmMTnBQDPJwVqxJjVNr7yBic4yfzVWGCGNE4DnOW0vcIeoyhy9vnIa3w1uZ 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY qIws/H2t In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: q7KmGIJQoTF9p2FJJ2mnwWaz9673jiXbnMGwutL5pdc_1757507571 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10.09.25 14:17, Arnd Bergmann wrote: > On Wed, Sep 10, 2025, at 03:46, Matthew Wilcox wrote: >> On Tue, Sep 09, 2025 at 11:23:37PM +0200, Arnd Bergmann wrote: >>> While removing a feature that is actively used is clearly a regression >>> and not normally done, I expect removing highmem is going to happen >>> at some point anyway when there are few enough users, but the question >>> is when that time will be. >> >> I don't mind that the feature remains ... unless it causes us trouble. >> Which it currently does. Perhaps we could start by removing HIGHPTE? >> There was a certain amount of complexity introduced into the page fault >> path when support for that was introduced. x86 removed support for it, >> so it's just ARM left before we can remove the complexity again. >> >> Most of the other pain points are around storing metadata (directories, >> superblocks, etc) in page cache highmem. I think we can get rid of that >> now too. > > Agreed, this is roughly what I meant with the suggestion of removing > __GFP_HIGHMEM allocations from as many places as possible, while leaving > the pagecache and zram. I already brought up HIGHPTE earlier this year > since it already has an separate Kconfig symbol, but Russell was worried > about increasing the lowmem usage at all. > > Maybe we could go back to the earlier idea of first categorizing > the important highmem users better, and make it possible to > use Kconfig symbols to enable highpte/highmem-anonymous/highmem-file/ > highmem-metadata/highmem-zram/... individually as well as count the > actual usage for each of them. Having statistics in /proc/meminfo or > similar would allow more informed decision about no longer supporting > some of the categories later. That makes sense. Essentially, let's move out as much of the now-possibly-unnecessary-complexity while still leaving basic highmem support in. To mean that implies removing highpte first. > > Not sure how many __GFP_ flags we could reasonably spend on categorizing, > as we are already up to 26 out of 32 (not counting CONFIG_ASAN_HW_TAGS, > which is 64-bit only and uses two more bits), or what alternative > would work. > >> I don't see any particular need to gt rid of file data stored in highmem, >> nor anonymous memory stored in highmem. And if we're only talking >> about hundreds of megabytes of memory, I think anon+ file pagecache is >> probably most of the memory in the system already unless you have some >> very weird workloads. > > The main problem I see with the pagecache itself is that the fewer > highmem machines people test on, the harder it gets to spot regressions > where new code fails to kmap() the pages correctly. Yes. Whenever I touch highmem I'm concerned I will silently break something and nobody notices. Then I find myself booting a x86-pat in a VM and wonder why we are still supporting that and why it is so hard for me to get it tested. If we manage to not have that testing part so annoying, it would already eb a big win. (did ever anybody look into simulating highmem on 64bit to make it easier to test?) > > Another concern is the number of memory zones, but it does not appear > that we would completely remove ZONE_HIGHMEM as long as ZRAM or pagecache > uses it. > >> Where we may want to be a bit careful is some people have Plans to >> reuse the kmap infrastructure to support things like unmapping the >> pagecacheto protect against spectre-eqsue attacks. I know Intel was >> working on this when 3dxp was going to be a Thing, but it's recently >> been brought back: >> >> https://lore.kernel.org/linux-mm/20250812173109.295750-1-jackmanb@google.com/ > > If that gets merged, it would at least address the concern about > testing, since presumably many bugs around missing kmap/kumap then > also show up on x86-64 kernels with ASI enabled. Right. Likely we should at some point cleanup the api to not talk about map/unmap but rather something along the lines of "start access / end access". -- Cheers David / dhildenb