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
F97685760: D31958.diff
Mon, Sep 30, 6:57 PM
Unknown Object (File)
Thu, Sep 19, 1:24 AM
Unknown Object (File)
Wed, Sep 18, 3:08 AM
Unknown Object (File)
Tue, Sep 17, 6:19 PM
Unknown Object (File)
Tue, Sep 17, 3:16 PM
Unknown Object (File)
Tue, Sep 17, 6:01 AM
Unknown Object (File)
Mon, Sep 16, 4:13 PM
Unknown Object (File)
Thu, Sep 5, 1:19 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?