Page MenuHomeFreeBSD

arm64: Malloc the cpu_desc array
ClosedPublic

Authored by andrew on Jun 6 2023, 8:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 29, 1:45 AM
Unknown Object (File)
Sat, Mar 28, 2:24 AM
Unknown Object (File)
Fri, Mar 27, 8:15 AM
Unknown Object (File)
Feb 8 2026, 2:19 AM
Unknown Object (File)
Feb 7 2026, 10:07 PM
Unknown Object (File)
Jan 31 2026, 2:03 AM
Unknown Object (File)
Jan 14 2026, 12:46 AM
Unknown Object (File)
Jan 12 2026, 7:29 PM

Details

Summary

We only need this during boot. Allocate the array before starting CPUs
to reduce the memory usage.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 51920
Build 48811: arc lint + arc unit

Event Timeline

andrew requested review of this revision.Jun 6 2023, 8:49 AM
zachary.leaf_arm.com added inline comments.
sys/arm64/arm64/identcpu.c
1862

It's the same thing, but mp_ncpus-1 seems clearer for what we're passing here as the first parameter i.e. malloc_array(size_t nmemb...)

sys/arm64/arm64/identcpu.c
1862

I decided on mp_maxid as it is allocating an array indexed by cpu id. If for some reason we had a sparse cpu id space then mp_ncpus - 1 may be too small.

This revision is now accepted and ready to land.Jun 8 2023, 7:55 AM
This revision was automatically updated to reflect the committed changes.