On Thu, Jun 11, 2026 at 12:01:55PM +0200, David Hildenbrand (Arm) wrote:
>The droppable test currently relies on creating memory pressure in a
>child process to trigger dropping the droppable pages.
>
>That not only takes a long time on some machines (allocating and filling
>all that memory), on large machines this will not work as we hardcode the
>area size to 134217728 bytes.
>
>... further, we rely on timeouts to detect that memory was not dropped,
>which is really suboptimal.
>
>Instead, let's just use MADV_PAGEOUT on a 2 MiB region. MADV_PAGEOUT works
>with droppable memory even without swap.
>
>There is the low chance of MADV_PAGEOUT failing to drop a page because
>of speculative references. We'll wait 1s and retry 10 times to
>rule that unlikely case out as best as we can.
>
>On a machine without swap:
>
>       $ ./droppable
>       TAP version 13
>       1..1
>       ok 1 madvise(MADV_PAGEOUT) behavior
>       # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
>
>Reported-by: Aishwarya TCV <[email protected]>
>Fixes: 9651fcedf7b9 ("mm: add MAP_DROPPABLE for designating always lazily 
>freeable mappings")
>Signed-off-by: David Hildenbrand (Arm) <[email protected]>
>---

Cool! Tested with swap both off and on, and it passed either way :D

That's what I'd expect, VM_DROPPABLE folios stay anon + non-swapbacked,
so reclaim can discard them instead of swapping them out :)

Tested-by: Lance Yang <[email protected]>

Reply via email to