linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Matthew Wilcox" <willy@infradead.org>
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" <christophe.leroy@csgroup.eu>,
	"Richard Weinberger" <richard@nod.at>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Ankur Arora" <ankur.a.arora@oracle.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Ira Weiny" <ira.weiny@intel.com>, "Nishanth Menon" <nm@ti.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Alexander Sverdlin" <alexander.sverdlin@gmail.com>,
	"Chester A. Unal" <chester.a.unal@arinc9.com>,
	"Sergio Paracuellos" <sergio.paracuellos@gmail.com>,
	"Andreas Larsson" <andreas@gaisler.com>
Subject: Re: [TECH TOPIC] Reaching consensus on CONFIG_HIGHMEM phaseout
Date: Wed, 10 Sep 2025 14:17:56 +0200	[thread overview]
Message-ID: <b60310f3-25d3-4f2b-88cb-ad65d5f55ec2@app.fastmail.com> (raw)
In-Reply-To: <aMDYdp3H-yOHU1Pm@casper.infradead.org>

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.

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.

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.

    Arnd


  parent reply	other threads:[~2025-09-10 12:18 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 21:23 [TECH TOPIC] Reaching consensus on CONFIG_HIGHMEM phaseout Arnd Bergmann
2025-09-09 21:38 ` H. Peter Anvin
2025-09-09 22:24   ` Linus Torvalds
2025-09-09 22:39     ` H. Peter Anvin
2025-09-10  1:06     ` René Herman
2025-09-10  1:46 ` Matthew Wilcox
2025-09-10  9:49   ` Linus Walleij
2025-09-10 12:17   ` Arnd Bergmann [this message]
2025-09-10 12:32     ` David Hildenbrand
2025-09-10 13:10 ` Linus Walleij
2025-09-10 14:04   ` Matthew Wilcox
2025-09-10 15:13     ` Arnd Bergmann
2025-09-10 14:04 ` Richard Weinberger
2025-09-10 16:34   ` Dave Hansen
2025-09-10 20:33     ` Richard Weinberger
2025-09-10 21:56       ` René Herman
2025-09-12 10:30       ` Arnd Bergmann
2025-09-12 12:46         ` Linus Walleij
2025-10-06 20:15         ` Richard Weinberger
2025-09-10 17:11   ` Christophe Leroy
2025-09-10 19:37     ` Richard Weinberger
2025-09-11  5:38 ` Andreas Larsson
2025-09-11  7:53   ` Arnd Bergmann
2025-09-12  9:32     ` Andreas Larsson
2025-09-12  9:36       ` H. Peter Anvin
2025-09-12 10:17       ` Arnd Bergmann
2025-09-12  9:58   ` H. Peter Anvin
2025-09-12 13:16     ` Matthew Wilcox
2025-09-12 16:49 ` Nicolas Ferre
2025-09-12 21:09   ` Arnd Bergmann
2025-09-17 12:59 ` Jason Gunthorpe
2025-09-18 13:12   ` Arnd Bergmann
2025-09-18 13:34     ` Andrew Lunn
2025-09-18 16:18       ` Arnd Bergmann
2025-09-18 16:32         ` Andrew Lunn
2025-09-19  7:17     ` Geert Uytterhoeven
2025-09-19 14:22       ` Arnd Bergmann
2025-09-19 14:34         ` Jason Gunthorpe
2025-09-22  6:58           ` Arnd Bergmann
2025-09-22 17:05             ` Nicolas Schichan
2025-09-22 21:22               ` Arnd Bergmann
2025-09-19 14:41       ` Nicolas Ferre
2025-09-19 14:22     ` Nicolas Ferre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b60310f3-25d3-4f2b-88cb-ad65d5f55ec2@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.sverdlin@gmail.com \
    --cc=andreas@gaisler.com \
    --cc=ankur.a.arora@oracle.com \
    --cc=chester.a.unal@arinc9.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=david@redhat.com \
    --cc=geert+renesas@glider.be \
    --cc=heiko@sntech.de \
    --cc=imx@lists.linux.dev \
    --cc=ira.weiny@intel.com \
    --cc=ksummit@lists.linux.dev \
    --cc=l.stach@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=nm@ti.com \
    --cc=richard@nod.at \
    --cc=rppt@kernel.org \
    --cc=sergio.paracuellos@gmail.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).