Page MenuHomeFreeBSD

vm_page_startup: correct calculation of the starting page
ClosedPublic

Authored by kib on Sep 17 2021, 6:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 19, 10:14 AM
Unknown Object (File)
Sat, Oct 19, 10:14 AM
Unknown Object (File)
Sat, Oct 19, 10:14 AM
Unknown Object (File)
Sat, Oct 19, 10:13 AM
Unknown Object (File)
Sat, Oct 19, 9:51 AM
Unknown Object (File)
Sep 24 2024, 2:46 PM
Unknown Object (File)
Sep 24 2024, 12:17 AM
Unknown Object (File)
Sep 21 2024, 4:35 PM
Subscribers
None

Details

Summary

Also avoid unneded calculations when phys segment end is the phys_avail[] start.

Submitted by: alc
Fixes: 181bfb42fd01bfa9f46

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Sep 17 2021, 6:53 PM
kib created this revision.
This revision is now accepted and ready to land.Sep 17 2021, 9:11 PM
sys/vm/vm_page.c
785

Is this still needed?

sys/vm/vm_page.c
785

I believe it is in the same state as it was before the fix. I.e. I think the code below would correctly handle a pass while startp == endp, including the vm_phys_enqueue_contig() call. But still, being explicit and tolerate e.g. empty phys_avail[] segments from MD code (for instance MD code doing early allocations and leaving empty segments around) would be not bad.

I can remove this check if you prefer, of course.

sys/vm/vm_page.c
785

Then, for this change, I would only suggest moving the m calculation after the continue.

Separately, I think that an empty phys_avail[] segment from the MD code deserves a warning message from the MI code.

794–795

Why is this repeated?

796
kib marked 4 inline comments as done.

Move m calculation.
Microoptimize setting of vmd_segs bitmap.

This revision now requires review to proceed.Sep 19 2021, 6:08 PM
This revision is now accepted and ready to land.Sep 19 2021, 6:17 PM