Page MenuHomeFreeBSD

vm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys segments
ClosedPublic

Authored by kib on Sep 14 2021, 12:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 3:56 PM
Unknown Object (File)
Feb 9 2024, 5:29 PM
Unknown Object (File)
Dec 28 2023, 4:05 PM
Unknown Object (File)
Dec 28 2023, 4:05 PM
Unknown Object (File)
Dec 28 2023, 4:04 PM
Unknown Object (File)
Dec 20 2023, 6:59 AM
Unknown Object (File)
Dec 14 2023, 8:33 PM
Unknown Object (File)
Dec 14 2023, 2:54 PM
Subscribers

Details

Summary

If phys_avail[] segment only intersect with some vm_phys segment, add pages from it to the free list that belong to the given vm_phys_seg, instead of dropping them.

The vm_phys segments are generally result of subdivision of phys_avail segments, for instance DMA32 or LOWMEM boundaries split them. On amd64, after UEFI in-place kernel activation (copy_staging disable) was enabled, we typically have a large phys_avail[] segment below 4G which crosses LOWMEM (1M) boundary. With the current way of requiring phys_avail[] fully fit into vm_phys_seg, this memory was ignored.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Sep 14 2021, 12:34 PM
kib created this revision.

I confirm that with this patch applied my system is now able to see all its RAM.

Thank you!

This revision is now accepted and ready to land.Sep 14 2021, 1:42 PM
sys/vm/vm_page.c
776

This comment no longer holds.

kib marked an inline comment as done.

Update comment.

This revision now requires review to proceed.Sep 14 2021, 3:01 PM
sys/vm/vm_page.c
774–776
kib marked an inline comment as done.

Reword comment, by Alan.

sys/vm/vm_page.c
798–799

Isn't it possible for some of the excluded range of the phys_seg to be present in a different phys_avail[] region?

sys/vm/vm_page.c
798–799

Do you mean that this break statement should be removed?

798–799

And the condition seg->start< phys_avail[i] replaced by seg->end < phys_avail[i] perhaps

Walk over all phys_avail[] segments which overlap with our vm_phys_seg when gathering the vm_phys_seg' pages

This revision is now accepted and ready to land.Sep 15 2021, 8:02 PM
sys/vm/vm_page.c
778–779

Why not test for equality here? It seems pointless to allow execution to continue if they are equal.

783

Shouldn't this be startp - seg->start?