Page MenuHomeFreeBSD

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

Authored by jeff on Mon, Dec 2, 11:47 PM.

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

Event Timeline

jeff created this revision.Mon, Dec 2, 11:47 PM
jeff edited the summary of this revision. (Show Details)Mon, Dec 2, 11:51 PM
jeff added reviewers: alc, doug_freebsd.con.com, kib, markj.
jeff set the repository for this revision to rS FreeBSD src repository.
markj added inline comments.Tue, Dec 3, 3:32 PM
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.

kib accepted this revision.Tue, Dec 3, 3:39 PM
This revision is now accepted and ready to land.Tue, Dec 3, 3:39 PM
jeff added inline comments.Tue, Dec 3, 5:52 PM
sys/vm/vm_object.c
2228 ↗(On Diff #65145)

yes, I think that's reasonable.

markj accepted this revision.Tue, Dec 3, 7:49 PM