Page MenuHomeFreeBSD

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

Authored by markj on Nov 16 2021, 9:14 PM.

Details

Summary

No functional change intended.

Obtained from: jeff (object_concurrency patches)

Diff Detail

Repository
R10 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

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
1549

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

1550

This is from vm_fault_getpages()?

sys/vm/vm_fault.c
1549

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.

1550

Yes.

sys/vm/vm_fault.c
1549

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