Skip to content

Commit

Permalink
cpu_input_boost: Rewrite to use dual-core boosting and clean up
Browse files Browse the repository at this point in the history
Previously, up to 3 CPUs could boosted at any given time; now, only 2 CPUs
can be boosted. With the new logic, 2 CPUs are boosted when only 1 is online,
and 1 CPU is boosted when there is more than 1 CPU online. This new logic
assumes that when only 1 CPU is online, a 2nd CPU will come online shortly
after due to user interaction, and that newly-onlined CPU will be boosted.
If a 2nd CPU isn't enabled within the time frame of the CPU0's boost, then
only CPU0 will have been boosted. If a 2nd CPU does come online within CPU0's
boost time frame, then it will be boosted for the remaining time left on
CPU0's boost (minus 10ms to eliminate any trivial racing between the
restoration workers).

Boost duration now uses a single variable exposed in sysfs. The user-set
boost duration is reduced by a factor of (1 + num_online_cpus())/(3 + num_online_cpus()).
In other words, when there are more CPUs online, the boost duration is
shorter.

Various functions and variables have been renamed for clarity, and other
parts of the code have been cleaned up as well.

Signed-off-by: Sultanxda <[email protected]>
  • Loading branch information
kerneltoast authored and nikhil18 committed Dec 15, 2015
1 parent c54012e commit 4f6e168
Showing 1 changed file with 162 additions and 96 deletions.
Loading

0 comments on commit 4f6e168

Please sign in to comment.