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
F102941707: D31958.diff
Tue, Nov 19, 12:57 AM
Unknown Object (File)
Mon, Nov 4, 7:40 AM
Unknown Object (File)
Oct 15 2024, 10:13 AM
Unknown Object (File)
Sep 30 2024, 6:57 PM
Unknown Object (File)
Sep 19 2024, 1:24 AM
Unknown Object (File)
Sep 18 2024, 3:08 AM
Unknown Object (File)
Sep 17 2024, 6:19 PM
Unknown Object (File)
Sep 17 2024, 3:16 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

Repository
rG FreeBSD src repository
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
775

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
773–774
kib marked an inline comment as done.

Reword comment, by Alan.

sys/vm/vm_page.c
800

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
800

Do you mean that this break statement should be removed?

800

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
780

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

784

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