Page MenuHomeFreeBSD

Fix interaction between largepages and seals/writes.
ClosedPublic

Authored by kib on Thu, Sep 10, 4:48 PM.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib created this revision.Thu, Sep 10, 4:48 PM
kib requested review of this revision.Thu, Sep 10, 4:48 PM
markj added inline comments.Thu, Sep 10, 4:52 PM
sys/kern/uipc_shm.c
1611 ↗(On Diff #76888)

Doesn't this need to move too?

kib marked an inline comment as done.Thu, Sep 10, 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 updated this revision to Diff 76889.Thu, Sep 10, 5:30 PM
kib marked an inline comment as done.

Do not do writecnt for largepages mmap.

kib edited the summary of this revision. (Show Details)Thu, Sep 10, 5:31 PM
markj accepted this revision.Thu, Sep 10, 5:47 PM
This revision is now accepted and ready to land.Thu, Sep 10, 5:47 PM
kevans accepted this revision.Thu, Sep 10, 5:49 PM
This revision was automatically updated to reflect the committed changes.