19 ms·
> I don't know if the kernel is capable of sharing read-only paged memory references or not. Any pages mapped from disk should be shared, as a consequence of t
by toast0 6y ago
> I don't know if the kernel is capable of sharing read-only paged memory references or not.
Any pages mapped from disk should be shared, as a consequence of the FreeBSD unified buffer cache; this is why if you write to a binary in-place with cp instead of unlinking first (like install), currently executing copies are changed, and usually crash :). Read-write program sections will be mapped so their changes are private though, so you get copy on write semantics. Trailing parts that aren't page sized will be copied into a full page, I think.
- loeg 6y ago> this is why if you write to a binary in-place with cp instead of unlinking first (like install), currently executing copies are changed, and usually crash This is not true, or no longer true: opening a running program's backing file with O_RDWR or O_WRONLY is prevented via the "writecount" mechanism (and vice versa: files being written cannot be executed).
- toast0 6y agoHmmm does that also apply to dynamic libraries? Now that I'm thinking about the fateful day, I pushed an updated library, not an executable. I'm guessing it was on FreeBSD 8.x, but it could have been 9.x.