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, Apr 8, 9:58 PM
Unknown Object (File)
Mar 7 2024, 11:35 PM
Unknown Object (File)
Feb 3 2024, 9:55 AM
Unknown Object (File)
Dec 28 2023, 4:04 PM
Unknown Object (File)
Dec 27 2023, 1:47 PM
Unknown Object (File)
Dec 20 2023, 12:05 AM
Unknown Object (File)
Dec 14 2023, 8:33 PM
Unknown Object (File)
Nov 29 2023, 1:57 AM
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