Page MenuHomeFreeBSD

Reduce object locking in vm_fault. The object is only needed until we have an exclusive busy.
ClosedPublic

Authored by jeff on Jan 4 2020, 8:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 7:59 AM
Unknown Object (File)
Mon, Dec 16, 12:12 PM
Unknown Object (File)
Fri, Dec 13, 1:37 PM
Unknown Object (File)
Dec 9 2024, 2:30 PM
Unknown Object (File)
Nov 24 2024, 10:30 PM
Unknown Object (File)
Nov 10 2024, 8:28 PM
Unknown Object (File)
Nov 10 2024, 8:22 PM
Unknown Object (File)
Oct 17 2024, 2:06 PM
Subscribers

Details

Summary

This drastically shortens maximum hold times on object locks in fault. We will basically only hold it through page allocation. It also eliminates some ugly lock/unlock/relock style code.

I intend to continue to refactor fault into smaller functions but I wanted to introduce the locking change first since it has the largest functional impact.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28627
Build 26659: arc lint + arc unit

Event Timeline

jeff added reviewers: alc, dougm, kib, markj.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
sys/vm/vm_fault.c
337

We could almost drop the lock before pmap_enter() but we are relying on it to prevent invalidation of pages for read-only faults.

635

I don't really like this but my only other option is to perhaps make this bool part of the fault_state.

964

Default objects hold the lock for the full duration.

1123

I don't like the extra label but I am continuing to break this function up and simplify control flow in later patches.

1219–1234

Fixed indentation while adding the extra TRYWLOCK.

1471

This is actually a fairly substantial win.

sys/vm/vm_fault.c
337

So we potentially dirty the object even despite the pmap_enter() could fail, same for prefault.

964

This explanation should be added to the comment, perhaps ?

1191–1192

'A valid page has been found, busied by us' (modulo my english).

1219–1234

And remove useless () around conditions while there, please.

sys/vm/vm_fault.c
337

Yeah it's safe to move this down. I can do so.

1191–1192

A valid page has been found and exclusively busied.

1219–1234

will do.

Review feedback. Mostly style and comments. Re-shuffle vm_fault_soft_fast() to properly handle the error case.

This revision is now accepted and ready to land.Jan 13 2020, 8:39 PM