Re: [RFC PATCH v1 0/4] mm: port MADV_VOLATILE and MADV_NONVOLATILE to v7.3-rc1

From
David Hildenbrand (Arm) <david@kernel.org>
Date
2026-11-30 10:39:55
Also in
cgroups, linux-arch, linux-fsdevel, linux-mm, linux-trace-kernel, lkml
Reply to
Hirotaka Yamagata, 2026-11-30
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.
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.

-- 
Cheers,

David
Thread (9 messages) 9 messages, 4 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help