From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Dev Jain <dev.jain@arm.com>,
lsf-pc@lists.linux-foundation.org, ryan.roberts@arm.com,
catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org,
hughd@google.com, baolin.wang@linux.alibaba.com,
akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, linux-mm@kvack.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [LSF/MM/BPF TOPIC] Per-process page size
Date: Fri, 20 Feb 2026 17:50:44 +0100 [thread overview]
Message-ID: <5f61a5fd-ab38-4635-aab8-5de515c4015a@kernel.org> (raw)
In-Reply-To: <aZfn0tbKl_1JD-VM@casper.infradead.org>
On 2/20/26 05:49, Matthew Wilcox wrote:
> On Tue, Feb 17, 2026 at 04:30:59PM +0100, David Hildenbrand (Arm) wrote:
>> In a private conversation I also raised that some situations might make it
>> impossible/hard to drop+re-read.
>>
>> One example I cam up with if a folio is simply long-term R/O pinned. But I
>> am also not quite sure how mlock might interfere here.
>>
>> So yes, I think the page cache is likely the one of the most
>> problematic/messy thing to handle.
>
> So what if we convert to max-supported-order the first time somebody
> calls mmap on a given file? Most files are never mmaped, so it won't
> affect them.
Yes!
> And files that are mmaped are generally not written to.
Well, let's say many mmaped files are not written to. :)
> So there should not be much in the page cache for the common case.
You'd assume many files to either get mmaped or read/written, yes.
> And if no pages from the file have been mmaped yet, they cannot be pinned
> or mlocked.
Is there some other way for someone to block a page from getting evicted
from the pagecache?
We have this memfd_pin_folios() thing, but I don't think we have
something comparable for ordinary pagecache files.
... putting them into a pipe and never reading from the pipe maybe (I
assume that's what splice() does, but not sure if it actually places the
pages in there or whether it creates a copy first)?
But yes, doing the conversion on first mmap() should handle mlock+gup.
--
Cheers,
David
next prev parent reply other threads:[~2026-02-20 16:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 14:50 Dev Jain
2026-02-17 15:22 ` Matthew Wilcox
2026-02-17 15:30 ` David Hildenbrand (Arm)
2026-02-17 15:51 ` Ryan Roberts
2026-02-20 4:49 ` Matthew Wilcox
2026-02-20 16:50 ` David Hildenbrand (Arm) [this message]
2026-02-18 8:39 ` Dev Jain
2026-02-18 8:58 ` Dev Jain
2026-02-18 9:15 ` David Hildenbrand (Arm)
2026-02-20 9:49 ` Arnd Bergmann
2026-02-20 13:37 ` Pedro Falcato
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=5f61a5fd-ab38-4635-aab8-5de515c4015a@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=catalin.marinas@arm.com \
--cc=dev.jain@arm.com \
--cc=hughd@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=will@kernel.org \
--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