From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Hirotaka Yamagata <hiro@pisnp.net>,
Andrew Morton <akpm@linux-foundation.org>,
linux-api@vger.kernel.org,
"Liam R. Howlett" <liam@infradead.org>,
Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
cgroups@vger.kernel.org, John Stultz <jstultz@google.com>,
Minchan Kim <minchan@kernel.org>,
Alexandre Marciano Gimenez <raging@google.com>,
Tatsuyuki Ishi <ishitatsuyuki@google.com>
Subject: Re: [RFC PATCH v1 0/4] mm: port MADV_VOLATILE and MADV_NONVOLATILE to v7.3-rc1
Date: Mon, 30 Nov 2026 18:18:18 +0000 [thread overview]
Message-ID: <aw2h55kj_h0uC7UA@gremlin> (raw)
In-Reply-To: <fe03a116-276d-4871-9a0e-fa4e47f4ff53@kernel.org>
On Mon, Nov 30, 2026 at 11:39:45AM +0100, David Hildenbrand (Arm) wrote:
> On 11/30/26 09:34, Hirotaka Yamagata wrote:
>
> Hi,
>
> > This RFC series revives and modernizes the volatile ranges patchset
> > originally proposed by John Stultz and Minchan Kim [1].
> >
> > Volatile ranges allow userspace caches holding regenerable data (such as
> > decoded image bitmaps or other private caches) to mark private anonymous
> > memory as safe for the kernel to discard under memory pressure,
> > bypassing swap. Such ranges are marked via madvise(MADV_VOLATILE).
> > Before reusing the buffer, userspace calls madvise(MADV_NONVOLATILE),
> > which unmarks the range and returns 1 if any pages in the range were
> > purged while volatile (or 0 if all pages remained intact).
>
> We have MAP_DROPPABLE nowadays, I don't think we want more of that.
Yes exactly.
And also absolutely no to this pattern of:
1. Create an unnecessary new file for something
2. Redirect an MADV_xxx to that file, maybe some hooks
3. ???
4. the control of what the MADV_xxx does sits outside of madvise now.
>
> >
> > Unlike MADV_FREE, which silently zero-fills dropped pages on re-access,
> > calling MADV_NONVOLATILE before reuse gives userspace deterministic
> > notification of whether cached data was lost without having to touch
> > every page.
>
> We do have userfaultfd missing faults + rwp (read-write-protection). Can't we
> build something based on that instead?
>
> We currently disable uffd with MAP_DROPPABLE, but maybe there could be a use
> case for it. Of course, you can also build it based on MADV_FREE instead.
Well we'd need to have a compelling reason to combine the two I think :P
But in general agree with - check to see what tooling there is already before
making a big, invasive change to mm.
--
Cheers, Lorenzo
prev parent reply other threads:[~2026-11-30 18:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 8:34 [RFC PATCH v1 0/4] mm: port MADV_VOLATILE and MADV_NONVOLATILE to v7.3-rc1 Hirotaka Yamagata
2026-11-30 8:34 ` [RFC PATCH v1 1/4] mm: introduce VM_VOLATILE and MADV_VOLATILE/MADV_NONVOLATILE VMA handling Hirotaka Yamagata
2026-12-01 8:36 ` sashiko-bot
2026-12-01 12:40 ` Hirotaka Yamagata
2026-11-30 8:34 ` [RFC PATCH v1 2/4] mm: add PTE_MARKER_PURGED and TTU_PURGE for purged volatile pages Hirotaka Yamagata
2026-12-01 8:36 ` sashiko-bot
2026-11-30 8:34 ` [RFC PATCH v1 3/4] mm/volatile: purge volatile anonymous folios during reclaim Hirotaka Yamagata
2026-12-01 8:36 ` sashiko-bot
2026-11-30 8:34 ` [RFC PATCH v1 4/4] mm/volatile: add PGPURGE vmstat counter and purge tracepoint Hirotaka Yamagata
2026-12-01 8:36 ` sashiko-bot
2026-11-30 10:39 ` [RFC PATCH v1 0/4] mm: port MADV_VOLATILE and MADV_NONVOLATILE to v7.3-rc1 David Hildenbrand (Arm)
2026-11-30 18:18 ` Lorenzo Stoakes (ARM) [this message]
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=aw2h55kj_h0uC7UA@gremlin \
--to=ljs@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=cgroups@vger.kernel.org \
--cc=chrisl@kernel.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hiro@pisnp.net \
--cc=ishitatsuyuki@google.com \
--cc=jstultz@google.com \
--cc=kasong@tencent.com \
--cc=liam@infradead.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=raging@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=shakeel.butt@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.