Page MenuHomeFreeBSD

For unlinked files, do not msync(2) or sync on inactivation.
ClosedPublic

Authored by kib on Sep 19 2017, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 21 2023, 9:31 PM
Unknown Object (File)
Dec 20 2023, 8:29 AM
Unknown Object (File)
Nov 30 2023, 2:12 PM
Unknown Object (File)
Aug 31 2023, 8:38 PM
Unknown Object (File)
Aug 15 2023, 5:53 PM
Unknown Object (File)
Jan 16 2023, 8:02 AM
Unknown Object (File)
Jan 8 2023, 6:57 AM
Subscribers

Details

Summary

One consequence of the patch is that msyncing unlinked file mappings no longer reduces the amount of the dirty memory in the system, but I do not think that there are users of msync(2) that utilize it for such side-effect.

The patch is reported to significantly help with the firefox performance.

PR: 222356

Diff Detail

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

Event Timeline

As long as the page daemon will still launder the pages when we are short of memory, I don't see a problem with msync() ignoring them.

In D12411#257518, @alc wrote:

As long as the page daemon will still launder the pages when we are short of memory, I don't see a problem with msync() ignoring them.

Yes, this only prevents syncing on explicit msync(2), and on the vnode inactivation. Since the inactivation for unlinked UFS vnode triggers reclamation, the writes there are discarded immediately after finished.

alc added inline comments.
sys/kern/vfs_subr.c
3058 ↗(On Diff #33216)

Since "obj" is no longer used unconditionally, I would write "(obj = vp->v_object) != NULL" here.

This revision is now accepted and ready to land.Sep 19 2017, 4:15 PM
This revision was automatically updated to reflect the committed changes.