Updated: April 19, 2023 |
Ask the system to turn on dynamically offlined CPUs
#include <sys/sysmgr.h> int sysmgr_runstate_burst( const unsigned ms_length );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Most of the time, the dynamic CPU-onlining algorithm works fine, but it can take up to 64 ms to decide that there's enough system load to turn on a dynamically offlined CPU, and sometimes we just don't want to wait that long. The sysmgr_runstate_burst() function tells the kernel that the system is about to get busy, and it should be turning on CPUs much sooner than it would normally.
Multiple threads can call the function, and burst mode remains in effect until the last time period expires. A thread can cancel its burst-mode request by calling sysmgr_runstate_burst() again with an argument of 0; any other thread requests remain in force.
In order to successfully call this function, your process must have the PROCMGR_AID_RUNSTATE_BURST ability enabled. For more information, see procmgr_ability().
An errno value if an error occurred.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |