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, Sep 21, 5:49 AM
Unknown Object (File)
Sep 5 2025, 7:13 AM
Unknown Object (File)
Sep 4 2025, 12:52 PM
Unknown Object (File)
Aug 19 2025, 12:15 PM
Unknown Object (File)
Aug 3 2025, 7:21 PM
Unknown Object (File)
Jul 28 2025, 3:30 PM
Unknown Object (File)
Jul 27 2025, 4:03 AM
Unknown Object (File)
Jul 21 2025, 11:22 AM

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 Not Applicable
Unit
Tests Not Applicable

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
1863

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
1863

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.