[Bug 230160] linuxulator doesn't implement madvise(MADV_DONTNEED) correctly
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Jan 9 17:54:10 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230160
--- Comment #2 from Mark Johnston <markj at FreeBSD.org> ---
Yes, we should probably just extend our madvise(2) to implement Linux's
MADV_DONTNEED. Some care is needed, as we currently assume that madvise(2) is
advisory and so may be ignored for pages in some transient busy state.
However, we cannot correctly do this when implementing Linux MADV_DONTNEED for
private anonymous memory.
I don't really like the idea of having a generic MADV_ZERO. First, Linux
MADV_DONTNEED only "zeroes" the page if it belongs to a private mapping. Pages
belonging to shared mappings should be handled the same way as FreeBSD's
MADV_DONTNEED, from my reading of the man page. So that name would be
misleading. Second, I think it's pretty widely agreed that Linux's
implementation choice here is a historical mistake. We should emulate it, but
I don't think it makes much sense to do so in a generic fashion. I'd just add
an undocumented MADV_DONTNEED_LINUX.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-emulation
mailing list