Page MenuHomeFreeBSD

Fix interaction between largepages and seals/writes.
ClosedPublic

Authored by kib on Sep 10 2020, 4:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 10:44 AM
Unknown Object (File)
Sep 5 2024, 10:02 AM
Unknown Object (File)
Sep 5 2024, 10:02 AM
Unknown Object (File)
Sep 5 2024, 10:02 AM
Unknown Object (File)
Sep 5 2024, 10:02 AM
Unknown Object (File)
Sep 5 2024, 9:50 AM
Unknown Object (File)
Aug 30 2024, 2:58 AM
Unknown Object (File)
Aug 29 2024, 8:47 PM
Subscribers

Details

Summary

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

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

Event Timeline

kib requested review of this revision.Sep 10 2020, 4:48 PM
sys/kern/uipc_shm.c
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.
sys/kern/uipc_shm.c
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.