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)
Wed, Jul 29, 12:26 AM
Unknown Object (File)
Mon, Jul 27, 1:59 AM
Unknown Object (File)
Thu, Jul 23, 4:09 PM
Unknown Object (File)
Wed, Jul 22, 1:42 AM
Unknown Object (File)
Sun, Jul 19, 8:52 PM
Unknown Object (File)
Sat, Jul 18, 2:25 AM
Unknown Object (File)
Thu, Jul 16, 7:19 PM
Unknown Object (File)
Sat, Jul 11, 11:32 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27898
Build 26069: arc lint + arc unit

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

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

sys/vm/vm_page.c
1692

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

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

yes, I think that's reasonable.