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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA620CAC583 for ; Wed, 10 Sep 2025 12:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LViYUFGFqV7wdk7rT7+n+ckEpLRp2oc7FTXBWlnTc1s=; b=D5t/0q/2v3uf2pxAp5as0LbyWf 05UFPj9dG2Joxlo+cTEiSJmJCBKHrb9+RBqBJ9w/FFY6pRBtI5dNA+lrWYNaFPnvySj2U/IHWzAx/ 6XPO0wt6HBj6SMyqxEHah+kGkuPXsPcLQVWkppjJTrEtYcAs1zVTxEMoUUTGkDaF0nm4ZgKNJ++FE 66C6wftNy0viqbFcaxlU4Wqa5ZVy/ktWoyHxe3QTwKdqor/HCgDzzJA0QU42nPs/5TVCYCAkZztCw XBG9w798gEIkUOft112+rk09mPUFIGw2eXZpYrKXEcn2Bmar9lsJfq8kpiEJRRdX8AaoQDe9EVo5s JtTf6I8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwK0Q-0000000E8Ds-3OoX; Wed, 10 Sep 2025 12:32:58 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uwK0O-0000000E8C0-0b2N for linux-arm-kernel@lists.infradead.org; Wed, 10 Sep 2025 12:32:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757507574; 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=WHd0oMalIIoLJPyuccybKNhlIxKxhXCeWMxEYeumxVdUZEXiHu4XC7PlpFTSuZzwTnFkKz zaGL3jrVw/o+FehP1rmXwQAdcRED0Vue7mKoPtk4nQi6aiVLEMYFwiuVim/0lL6vRtV1UB XHwo6tpVeKDSvfvG2W9comHwETgfNOc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-tlkEnjjdM7-FNUD6MZY2pg-1; Wed, 10 Sep 2025 08:32:52 -0400 X-MC-Unique: tlkEnjjdM7-FNUD6MZY2pg-1 X-Mimecast-MFC-AGG-ID: tlkEnjjdM7-FNUD6MZY2pg_1757507571 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-45b990eb77cso3966355e9.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=P4oeJT9E6vVzGm9Lx4PvS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LsrzwhsYoNmlL15rCj6VTCSLVgaQVeWIErMGzY3nzUeQZN+Uods= X-Received: by 2002:a05:600c:3b1d:b0:45b:8ac2:9761 with SMTP id 5b1f17b1804b1-45dde20e5c0mr148260585e9.13.1757507570783; 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 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/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT7CwZoEEwEIAEQCGwMCF4ACGQEFCwkIBwICIgIG FQoJCAsCBBYCAwECHgcWIQQb2cqtc1xMOkYN/MpN3hD3AP+DWgUCaJzangUJJlgIpAAKCRBN 3hD3AP+DWhAxD/9wcL0A+2rtaAmutaKTfxhTP0b4AAp1r/eLxjrbfbCCmh4pqzBhmSX/4z11 opn2KqcOsueRF1t2ENLOWzQu3Roiny2HOU7DajqB4dm1BVMaXQ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6OCB7XeikGEkSas_1757507571 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250910_053256_252598_4E0D9396 X-CRM114-Status: GOOD ( 41.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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