3 ms·
AFAICT the POSIX behavior for MADV_DONTNEED is just a hint that the memory won't be accessed soon. https://pubs.opengroup.org/onlinepubs/009695399/functions/po
by kentonv 6y ago
AFAICT the POSIX behavior for MADV_DONTNEED is just a hint that the memory won't be accessed soon.
https://pubs.opengroup.org/onlinepubs/009695399/functions/posix_madvise.html https://pubs.opengroup.org/onlinepubs/009695399/functions/po... says:
POSIX_MADV_DONTNEED
Specifies that the application expects that it will not access the specified
range in the near future.
https://www.freebsd.org/cgi/man.cgi?query=madvise&sektion=2 https://www.freebsd.org/cgi/man.cgi?query=madvise&sektion=2 says:
MADV_DONTNEED Allows the VM system to decrease the in-memory priority
of pages in the specified address range. Consequently,
future references to this address range are more likely
to incur a page fault.
Neither of these suggest that the contents of the memory content can be discarded (as Linux does), only that it can be swapped out.
So it doesn't appear that this provides the "lazy unmap to avoid shootdown" behavior on any OS.