[Bug 230160] linuxulator doesn't implement madvise(MADV_DONTNEED) and any MADV_ flags with values >= 8 correctly
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Jan 11 11:21:06 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230160
--- Comment #6 from David Chisnall <theraven at FreeBSD.org> ---
(In reply to Bill Sorenson from comment #5)
`MADV_FREE` and Linux's `MADV_DONTNEED` have different use cases. For C, where
malloc is called a lot more often than calloc, `MADV_FREE` provides much better
semantics. For higher-level languages or for higher-security applications
where we need to guarantee zero initialisation, `MADV_FREE` is useless because
we have to `bzero` on either allocation or deallocation.
As I said, at $WORK, we have a number of use cases where Linux's behaviour
gives significantly better performance (less cache churn from redundant
zeroing). We have to fall back to the zeroing behaviour when using anonymous
shared memory though and that's a big perf hit for us. A `MADV_ZERO` would be
a big win.
Note, however, that `MADV_FREE` is currently broken in the Linuxulator, because
the constant has a different value in FreeBSD and Linux and the Linuxulator
just passes the flags through unmodified.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-emulation
mailing list