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)
Wed, Nov 13, 2:46 PM
Unknown Object (File)
Wed, Nov 6, 1:28 AM
Unknown Object (File)
Oct 19 2024, 10:14 AM
Unknown Object (File)
Oct 19 2024, 10:14 AM
Unknown Object (File)
Oct 19 2024, 10:14 AM
Unknown Object (File)
Oct 19 2024, 10:13 AM
Unknown Object (File)
Oct 19 2024, 9:51 AM
Unknown Object (File)
Sep 24 2024, 2:46 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