aboutsummaryrefslogtreecommitdiff
path: root/kernel/cpu
Commit message (Collapse)AuthorAgeFilesLines
* idle: Implement a per-cpu idle-polling modeVikram Mulukutla2017-04-131-2/+25
| | | | | | | | | | | | | | | | cpu_idle_poll_ctrl provides a way of switching the idle thread to use cpu_idle_poll instead of the arch specific lower power mode callbacks (arch_cpu_idle). cpu_idle_poll spins on a flag in a tight loop with interrupts enabled. In some cases it may be useful to enter the tight loop polling mode only on a particular CPU. This allows other CPUs to continue using the arch specific low power mode callbacks. Provide an API that allows this. Change-Id: I7c47c3590eb63345996a1c780faa79dbd1d9fdb4 Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
* idle: exit the cpu_idle_poll loop if cpu_idle_force_poll is clearedVikram Mulukutla2017-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | cpu_idle_poll_ctrl allows the enabling/disabling of the idle polling mode; this mode allows a CPU to spin waiting for a new task to be scheduled rather than having to execute the arch specific idle code. However, the loop that checks for a new task does not look at the flag that enables idle polling mode. So, the CPU may continue to spin even though the aforementioned flag has been cleared. Since the CPU is already in idle, it may be a while before a task is scheduled, precluding potential power savings. Modify the while loop conditional in question to also check if the cpu_idle_force_poll flag is set. Change-Id: Ia2e83af97890dc399b86e090459a41d31ce28b6c Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
* idle: Add a memory barrier after setting cpu_idle_force_pollVikram Mulukutla2017-04-131-0/+3
| | | | | | | | | To ensure that CPUs see cpu_idle_force_poll flag updates, add a memory barrier after writing to the flag. Change-Id: Ic3fdef7d17b673247bce5093530ce8aa08694632 Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
* first commitMeizu OpenSource2016-08-152-0/+149