Page MenuHomeFreeBSD

uma: Avoid unmapping ranges in the direct map
ClosedPublic

Authored by markj on Jan 1 2021, 10:22 PM.

Details

Summary

startup_alloc() uses pmap_map() to map slabs used for early allocations.
pmap_map() may ignore the hint address and simply return a range from
the direct map. In this case we must not unmap the range in
startup_free().

UMA uses bootstart and bootmem to track the range of KVA into which
slabs are mapped if the direct map is not used. Unmap a startup slab
only if it was mapped into that range.

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

markj requested review of this revision.Jan 1 2021, 10:22 PM
This revision is now accepted and ready to land.Jan 1 2021, 10:31 PM
alc added inline comments.
sys/vm/uma_core.c
1694–1700

I don't think that it is immediately obvious from this test that it exists so that we don't perform pmap_remove() on the direct map. Could you please add a comment explaining that here?

markj marked an inline comment as done.

Add a comment explaining the check.

This revision now requires review to proceed.Jan 2 2021, 12:12 AM
This revision is now accepted and ready to land.Jan 2 2021, 1:42 AM
This revision was automatically updated to reflect the committed changes.