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
F106516220: D12411.diff
Wed, Jan 1, 1:51 AM
Unknown Object (File)
Tue, Dec 31, 2:44 AM
Unknown Object (File)
Mon, Dec 30, 1:55 AM
Unknown Object (File)
Sun, Dec 29, 2:56 AM
Unknown Object (File)
Sat, Dec 28, 2:53 AM
Unknown Object (File)
Fri, Dec 27, 7:19 AM
Unknown Object (File)
Sep 30 2024, 11:36 PM
Unknown Object (File)
Sep 21 2024, 6:01 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.