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, Apr 7, 2:32 AM
Unknown Object (File)
Feb 4 2024, 5:59 PM
Unknown Object (File)
Feb 2 2024, 1:12 AM
Unknown Object (File)
Jan 24 2024, 12:55 PM
Unknown Object (File)
Jan 23 2024, 8:26 PM
Unknown Object (File)
Dec 25 2023, 4:39 PM
Unknown Object (File)
Dec 12 2023, 4:34 PM
Unknown Object (File)
Dec 7 2023, 12:50 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 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.