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)
Dec 20 2023, 6:40 AM
Unknown Object (File)
Dec 15 2023, 9:56 PM
Unknown Object (File)
Nov 26 2023, 2:12 PM
Unknown Object (File)
Nov 23 2023, 7:07 AM
Unknown Object (File)
Nov 14 2023, 10:06 AM
Unknown Object (File)
Nov 7 2023, 11:37 PM
Unknown Object (File)
Nov 1 2023, 8:42 AM
Unknown Object (File)
Oct 21 2023, 2:57 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 33492

Event Timeline

kib requested review of this revision.Sep 10 2020, 4:48 PM
sys/kern/uipc_shm.c
1611

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

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.