Page MenuHomeFreeBSD

vm: add unlocked page lookup before trying vm_fault_soft_fast
ClosedPublic

Authored by mjg on Mar 25 2023, 3:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 19 2024, 11:56 PM
Unknown Object (File)
May 17 2024, 7:21 PM
Unknown Object (File)
May 16 2024, 2:16 AM
Unknown Object (File)
May 16 2024, 1:12 AM
Unknown Object (File)
May 16 2024, 1:12 AM
Unknown Object (File)
May 16 2024, 12:49 AM
Unknown Object (File)
May 9 2024, 10:09 AM
Unknown Object (File)
Jan 14 2024, 7:32 AM
Subscribers

Details

Summary
Shaves a read lock + tryupgrade trip most of the time.

Stats from doing a kernel build (counters not present in the tree):
vm.fault_soft_fast_ok: 262653
vm.fault_soft_fast_failed_other: 41
vm.fault_soft_fast_failed_no_page: 39595772
vm.fault_soft_fast_failed_page_busy: 1929
vm.fault_soft_fast_failed_page_invalid: 22183

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg requested review of this revision.Mar 25 2023, 3:53 PM
sys/vm/vm_fault.c
365–366

There is no reason to busy the object if the page lookup validation fails, since you check for the busy page status in separate statement.

366–374

There should be a blank line before the multiline comment

372

And the blank line after the block of code described by the multiline comment

sys/vm/vm_fault.c
365–366

you mean something like this?

if (m->object != fs->first_object || m->pindex != fs->first_pindex)
        goto fail;

vm_object_busy(fs->first_object);

if (!vm_page_all_valid(m) ||
    ((fs->prot & VM_PROT_WRITE) != 0 && vm_page_busied(m)))
        goto fail_busy;
sys/vm/vm_fault.c
365–366

Yes

mjg marked 4 inline comments as done.
This revision is now accepted and ready to land.Mar 25 2023, 9:49 PM