Page MenuHomeFreeBSD

Move map relookup into its own function.
ClosedPublic

Authored by jeff on Jan 21 2020, 7:42 PM.

Details

Summary

The map revalidation is hopefully rare so we could possibly even noinline or predict_false() the call.

Diff Detail

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

jeff created this revision.Jan 21 2020, 7:42 PM
jeff edited the summary of this revision. (Show Details)Jan 21 2020, 7:53 PM
jeff added reviewers: alc, dougm, kib, markj.
jeff set the repository for this revision to rS FreeBSD src repository.
kib added inline comments.Jan 21 2020, 9:03 PM
sys/vm/vm_fault.c
810 ↗(On Diff #67115)

You could reduce indent below by doing

if (fs->map->timestamp == fs->map_generation)
           return (KERN_SUCCESS);

there

826 ↗(On Diff #67115)

What is KERN_RESTART ?

jeff added inline comments.Jan 21 2020, 9:06 PM
sys/vm/vm_fault.c
810 ↗(On Diff #67115)

Yeah I also prefer to lessen indent and have more early returns. I can do that.

826 ↗(On Diff #67115)

I meant to include that in this diff. I just added it to the list of vm errors. I am using KERN_RESOURCE_SHORTAGE to mean restart without fault_deallocate() and KERN_RESTART to mean restart with fault_deallocate(). It significantly reduces the number of places that call deallocate() and makes the error handling a little bit simpler.

jeff updated this revision to Diff 67128.Jan 22 2020, 2:57 AM

Decrease indent. Remove dead comment. Add missing KERN_RESTART define.

kib accepted this revision.Jan 22 2020, 1:14 PM
This revision is now accepted and ready to land.Jan 22 2020, 1:14 PM
markj accepted this revision.Jan 22 2020, 8:35 PM
This revision was automatically updated to reflect the committed changes.