Page MenuHomeFreeBSD

Weaken three asserts in preparation for lock pushdown in fault.
ClosedPublic

Authored by jeff on Dec 2 2019, 11:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 7:38 AM
Unknown Object (File)
Mon, Oct 13, 7:38 AM
Unknown Object (File)
Mon, Oct 13, 7:38 AM
Unknown Object (File)
Mon, Oct 13, 12:39 AM
Unknown Object (File)
Sun, Oct 12, 7:24 PM
Unknown Object (File)
Fri, Sep 26, 10:55 AM
Unknown Object (File)
Jun 22 2025, 7:26 PM
Unknown Object (File)
Jun 16 2025, 8:22 PM
Subscribers

Details

Summary

I believe vfs_set_writeable_dirty is safe without an object lock at all. I originally had it required to keep the type stable but it does not matter if we race with dead and that would be a reference bug.

Mark tells me that I can now vm_page_replace() while a page is in queue. This allows me to optimize fault in two ways. Firstly, we allocate and free a page in first_object every time we discover a busy backing object page. We only need to do this once and leave it invalid but in a paging queue. the cow optimization replace runs into this. Secondly, this allows me to skip requiring the first_object write lock in cases where we want to free the page.

Lastly, vm_object_busy() is a standin for xbusy. Allow wired refs while the object is busy.

Diff Detail

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

Event Timeline

jeff added reviewers: alc, doug_freebsd.con.com, kib, markj.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
sys/vm/vm_object.c
2228 ↗(On Diff #65145)

Can we instead assert that object->ref_count > 0?

sys/vm/vm_page.c
1692 ↗(On Diff #65145)

As you noted, I think this is fine. The assertion was added in r331128 but the reasoning given in the commit message no longer applies: the page daemon now handles pages without an object (by ignoring them).

3774 ↗(On Diff #65145)

This should be fine now that xbusy is treated as a proper lock.

This revision is now accepted and ready to land.Dec 3 2019, 3:39 PM
sys/vm/vm_object.c
2228 ↗(On Diff #65145)

yes, I think that's reasonable.