HomeFreeBSD

Free bootstacks after AP startup.

Description

Free bootstacks after AP startup.

Bootstacks are unused after APs executed sched_throw() in
init_secondary_tail() and started executing on proper idle thread
stack. Add sysinit that detects that the idle thread for each CPU was
scheduled at least once, and free corresponding bootstack.

Slight addition of the code (~200 bytes) is compensated by the saving,
because even on typical small modern desktop CPU we leak 128K of
memory otherwise (4 pages x 8 threads).

Reviewed by: jhb
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18486

Details

Provenance
kibAuthored on
Reviewer
jhb
Differential Revision
D18486: Free bootstacks after AP startup.
Parents
rS341809: Remove special case handling for getfhat(fd, NULL, handle).
Branches
Unknown
Tags
Unknown