Page MenuHomeFreeBSD

vm_fault: Factor out per-object operations into vm_fault_object()
ClosedPublic

Authored by markj on Nov 16 2021, 9:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 10:45 PM
Unknown Object (File)
Wed, Jun 26, 10:45 PM
Unknown Object (File)
Wed, Jun 26, 6:15 AM
Unknown Object (File)
Fri, Jun 21, 9:07 AM
Unknown Object (File)
Fri, Jun 21, 8:48 AM
Unknown Object (File)
Fri, Jun 21, 8:22 AM
Unknown Object (File)
Fri, Jun 21, 8:21 AM
Unknown Object (File)
Fri, Jun 21, 5:18 AM
Subscribers

Details

Summary

No functional change intended.

Obtained from: jeff (object_concurrency patches)

Diff Detail

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

Event Timeline

markj requested review of this revision.Nov 16 2021, 9:14 PM

Push OBJ_DEAD checking into vm_fault_object() as well.

sys/vm/vm_fault.c
1550

I liked the old /* break to PAGE HAS BEEN FOUND. */ comment. I wonder if you could just paste it there.

1551

This is from vm_fault_getpages()?

sys/vm/vm_fault.c
1550

Well, it sounds somewhat obvious now that the lookup loop shrunk from 400LOC (in stable/12) to 45LOC. This fragment could be written like this:

res = vm_fault_object(&fs, &behind, &ahead);
if (res == FAULT_SOFT)
    break; /* page has been found */
if (res == FAULT_HARD) {
    faultcount = behind + 1 + ahead;
    hardfault = true;
    break; /* page has been found */
}
switch (res) {
    <handle other statuses>
}

Or do you prefer to fully restore the old "PAGE HAS BEEN FOUND" label? I don't have strong feelings about it.

1551

Yes.

sys/vm/vm_fault.c
1550

I used this comment for orientation in the file. I remembered to search for it to find the core anchor basically splitting the fault handling into 'before we have a page' (lookup/validation) and 'after' (doing pmap work and post-accounting).

May be I can use FAULT_SOFT/FAULT_HARD for this after your change.

This revision is now accepted and ready to land.Nov 17 2021, 10:53 PM