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

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

Reply via email to