See my suggestion for "unmap-on-discard" pages, that would solve this in
a simpler way and has other useful properties (especially the ability to
reclaim unused portions of cached objects). And no need for a VMA.
> Yes, the only overhead is the extra (internal) trap to turn off the
> discardable flag, and then the syscall to turn the bit back on (if you are
> using the memory as a cache). That should be a miniscule overhead, though.
You don't need the internal trap -- check if a page is discardable when
it's aged enough to remove it. The normal page ageing will detect "next
touch", you just have to clear the touched/dirty bits when marking a
page discardable.
Of course, architectures which don't have a touched bit per pte will
need a trap, but they need it for page ageing anyway, it's presumably
already done and implemented.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/