K 10 svn:author V 5 markj K 8 svn:date V 27 2020-06-25T20:30:30.676879Z K 7 svn:log V 960 Implement an approximation of Linux MADV_DONTNEED semantics. Linux MADV_DONTNEED is not advisory: it has side effects for anonymous memory, and some system software depends on that. In particular, MADV_DONTNEED causes anonymous pages to be discarded. If the mapping is a private mapping of a named object then subsequent faults are to repopulate the range from that object, otherwise pages will be zero-filled. For mappings of non-anonymous objects, Linux MADV_DONTNEED can be implemented in the same way as our MADV_DONTNEED. This implementation differs from Linux semantics in its handling of private mappings, inherited through fork(), of non-anonymous objects. After applying MADV_DONTNEED, subsequent faults will repopulate the mapping from the parent object rather than the root of the shadow chain. PR: 230160 Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25330 END