lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b908b8a9-8860-4464-b86c-467797f1fafd@redhat.com>
Date: Wed, 10 Sep 2025 14:32:47 +0200
From: David Hildenbrand <david@...hat.com>
To: Arnd Bergmann <arnd@...db.de>, Matthew Wilcox <willy@...radead.org>
Cc: ksummit@...ts.linux.dev, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org,
 linux-mips@...r.kernel.org, linux-mm@...ck.org, imx@...ts.linux.dev,
 Christophe Leroy <christophe.leroy@...roup.eu>,
 Richard Weinberger <richard@....at>, Lucas Stach <l.stach@...gutronix.de>,
 Linus Walleij <linus.walleij@...aro.org>,
 Geert Uytterhoeven <geert+renesas@...der.be>,
 Ankur Arora <ankur.a.arora@...cle.com>, Mike Rapoport <rppt@...nel.org>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 "Liam R. Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka
 <vbabka@...e.cz>, Suren Baghdasaryan <surenb@...gle.com>,
 Ira Weiny <ira.weiny@...el.com>, Nishanth Menon <nm@...com>,
 Heiko Stübner <heiko@...ech.de>,
 Alexander Sverdlin <alexander.sverdlin@...il.com>,
 "Chester A. Unal" <chester.a.unal@...nc9.com>,
 Sergio Paracuellos <sergio.paracuellos@...il.com>,
 Andreas Larsson <andreas@...sler.com>
Subject: Re: [TECH TOPIC] Reaching consensus on CONFIG_HIGHMEM phaseout

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ