Skip to content

mm/madvise: teach MADV_PAGEOUT about swap cache

Dave Hansen lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/madvise: help MADV_PAGEOUT to find swap cache pagesmm/madvise.c+57 -111 reply
2/2mm/madvise: skip MADV_PAGEOUT on shared swap cache pagesmm/madvise.c+29 -83 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMinchan Kim
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] mm/madvise: teach MADV_PAGEOUT about swap cache

MADV_PAGEOUT ignores swap cache pages which are not mapped into the calling process. That's nasty because it means that some of the most easily reclaimable pages are inaccessible to a mechanism designed to reclaim pages.

This all turned out to be a bit nastier and more complicated than I would have liked. This has been lightly tested, but I did pass a normal barrage of compile tests.

I rigged up a little test program to try to create these situations. Basically, if the parent "reader" RSS changes in response to MADV_PAGEOUT actions in the child, there is a problem.

	https://www.sr71.net/~dave/intel/madv-pageout.c

I'd add this to selftests, but it *requires* swap to work and its parsing of /proc/self/maps is quite icky.

P.S. mincore() really doesn't work at all in this situation, probably something we need to look at too.

Cc Michal Hocko <[email protected]>
Cc Jann Horn <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Daniel Colascione <[email protected]>
Cc "Joel Fernandes (Google)" <[email protected]>
Cc Andrew Morton <[email protected]>