Page MenuHomeFreeBSD

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

Authored by kib on Tue, Sep 14, 12:34 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Tue, Sep 14, 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.Tue, Sep 14, 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.Tue, Sep 14, 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.Wed, Sep 15, 8:02 PM
sys/vm/vm_page.c
778

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?