Page MenuHomeFreeBSD

Fix interaction between largepages and seals/writes.

Authored by kib on Sep 10 2020, 4:48 PM.
Referenced Files
Unknown Object (File)
Mon, Jan 16, 4:21 AM
Unknown Object (File)
Tue, Jan 3, 2:05 PM
Unknown Object (File)
Dec 28 2022, 1:01 AM
Unknown Object (File)
Dec 24 2022, 3:59 AM



On write with SHM_GROW_ON_WRITE, use proper truncate.
Do not allow to grow largepage shm if F_SEAL_GROW is set. Note that shrinks are not supported at all due to unmanaged mappings.
Call to vm_pager_update_writecount() is only valid for swap objects, skip it for unmanaged largepages.
Largepages cannot support write sealing.
Do not writecnt largepage mappings.

Reported by: kevans

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

kib requested review of this revision.Sep 10 2020, 4:48 PM
1611 ↗(On Diff #76888)

Doesn't this need to move too?

kib marked an inline comment as done.Sep 10 2020, 5:29 PM
kib added inline comments.
1611 ↗(On Diff #76888)

I think a better fix is to reset writecount to false for largepage. And not pass writecnt to shm_mmap_large at all, there is no reason to set MAP_ENTRY_WRITECNT although it is safe as nop for now.

kib marked an inline comment as done.

Do not do writecnt for largepages mmap.

This revision is now accepted and ready to land.Sep 10 2020, 5:47 PM
This revision was automatically updated to reflect the committed changes.