From: Matthew Wilcox <willy@infradead.org>
To: Greg Ungerer <gerg@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-mm@kvack.org
Subject: nommu and folios
Date: Mon, 14 Jul 2025 20:22:04 +0100 [thread overview]
Message-ID: <aHVY3PIBI0M7Whi7@casper.infradead.org> (raw)
Hi Greg!
The last user of add_to_page_cache_lru() is fs/ramfs/file-nommu.c I
think I need your advice about how best to proceed with nommu and folios.
The basic idea behind folios is that they represent a physically,
logically and virtually contiguous block of memory that is a power-of-2
bytes in size >= PAGE_SIZE. struct page is going to be shrunk and it'll
be most efficient if we can arrange for allocations to be larger in size.
UCLinux obviously has very different performance requirements from the
kinds of systems I usually work on -- memory usage minimisation is much
more important. So ideally we wouldn't split the allocation all the way
to order-0 in ramfs_nommu_expand_for_mapping(), but do a split at just
the break point. eg if we have a 40kB file, we'd allocate an order-4
folio, split it into an order-3 folio and add that to the page cache;
split the order-2 page from the end and free it; split the remainder
into one order-1 folio, add it to the page cache and free the remaining
order-1 page.
The problem here is that all the code for handling large folios is
currently gated by CONFIG_TRANSPARENT_HUGEPAGE, which I'm guessing is
not enabled by any uclinux configs ;-)
Something I've been wanting to do for a while is split out the code
for handling PMD-sized folios from the code for splitting large folios
into smaller folios. That's necessarily going to increase the size of
the text section for uclinux, but hopefully it'll be worthwhile because
it'll decrease how much memory is allocated at runtime.
Of course if uclinux files are typically PAGE_SIZE or smaller, this isn't
going to help at all. Which brings me to the really sticky question
... how much do you care about uclinux support in a 2025 and later kernel?
I have no idea how actively microcontroller people use Linux or update
to recent kernels. I'm not trying to push uclinux out, just don't want
to do work that nobody will ever use ;-)
next reply other threads:[~2025-07-14 19:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 19:22 Matthew Wilcox [this message]
2025-07-15 13:54 ` nommu and folios Greg Ungerer
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=aHVY3PIBI0M7Whi7@casper.infradead.org \
--to=willy@infradead.org \
--cc=gerg@linux-m68k.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mm@kvack.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).