[Bug 230160] linuxulator doesn't implement madvise(MADV_DONTNEED) and any MADV_ flags with values >= 8 correctly

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 230160] linuxulator doesn't implement madvise(MADV_DONTNEED) and any MADV_ flags with values >= 8 correctly

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230160

--- Comment #6 from David Chisnall <[hidden email]> ---
(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.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"