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)
Mon, May 18, 2:05 PM
Unknown Object (File)
Sun, May 17, 4:17 PM
Unknown Object (File)
Sun, May 17, 1:42 PM
Unknown Object (File)
Sat, May 16, 7:39 AM
Unknown Object (File)
Apr 21 2026, 8:07 AM
Unknown Object (File)
Apr 12 2026, 2:33 PM
Unknown Object (File)
Apr 7 2026, 11:28 PM
Unknown Object (File)
Apr 6 2026, 7:37 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 Not Applicable
Unit
Tests Not Applicable

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