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)
Fri, Mar 8, 12:18 AM
Unknown Object (File)
Jan 27 2024, 3:21 AM
Unknown Object (File)
Dec 20 2023, 5:34 AM
Unknown Object (File)
Dec 5 2023, 3:49 PM
Unknown Object (File)
Aug 28 2023, 5:16 AM
Unknown Object (File)
Aug 28 2023, 5:16 AM
Unknown Object (File)
Aug 28 2023, 5:14 AM
Unknown Object (File)
Aug 28 2023, 5:04 AM
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.