1. Field
The present disclosed embodiments relate generally to computing devices, and more specifically to multithreading on processors of computing devices.
2. Background
Computing devices including devices such as smartphones, tablet computers, gaming devices, and laptop computers are now ubiquitous. These computing devices are now capable of running a variety of applications (also referred to as “apps”) and many of these devices include multiple processors to process tasks that are associated with apps. In many instances, multiple processors are integrated as a collection of processor cores within a single functional subsystem. It is known that the processing load on a mobile device may be apportioned to the multiple cores. Some sophisticated devices, for example, have multiple core processors that may be operated asynchronously at different frequencies. On these types of devices, the amount of work that is performed on each processor may be monitored and controlled by a CPU governor to meet workloads.
A user's experience on a computing device is generally dictated by how smooth the user interface (“UI”) animation runs on the device. UI animations on Android-based devices, application scrolls (e.g., browser scroll, email scroll, home launcher scrolls etc.), and the visually attractive animations that are displayed in connection with application launches present an important use-case of periodic workload on the CPU that is also sporadic in nature. Usually a performance benchmark places fixed-sized loads on the CPU, which allows the system to latch on the right clock frequency when running the benchmark. If a particular processing core has a heavy load, the frequency of that processing core may be increased. If a processing core has a relatively low load or is idle, the frequency of that core may be decreased (e.g., to reduce power consumption).
The Linux operating system for example, may use an on demand governor, which monitors the workload on each processor and adjusts the corresponding clock frequency based on the workload. The adjustment of the clock frequency may be heuristic based and may provide power benefits when operating properly. This approach to adjusting the CPU clock frequency works well if the workload is overall consistent, which is usually the case for many of the typical benchmarks. But the on demand governor does not scale well when the periodic workload also becomes sporadic because there is no consistent history associated with the sporadic workload.
As a consequence, sporadic workloads are a challenge for the governor, and to finish a periodic workload in a timely manner, a known (and non-optimal system solution) is to run a processor locked at higher clock frequency for user-interface workloads. Similarly, other CPU governors (e.g., the Interactive governor) respond more aggressively and increase processor clock frequencies when servicing sporadic/interactive workloads. These governor-based approaches that increase processor clock frequencies adversely impact power consumption, they are merely “best effort,” and these governor-based approaches are not deterministic with respect to changing workloads. In short, existing approaches to handling sporadic workloads either result in “stuttering,” undesirable power consumption, and/or poor application performance.