Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 479e9762 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian Committed by Maulik Shah
Browse files

cpuidle: Wakeup only cpus for which qos has changed.



The pm_qos framework passes down a mask of cpus for which the qos has
changed.  cpuidle driver uses this info to wakeup only those cpus for the
new qos to take effect. This would prevent waking up cpus for which the qos
values remains unchanged.

Change-Id: Ibb79937674a8f16920c6b8f224a21d2f72a0f9ce
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 1c10389d
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -533,16 +533,28 @@ EXPORT_SYMBOL_GPL(cpuidle_register);

#ifdef CONFIG_SMP

static void smp_callback(void *v)
{
	/* we already woke the CPU up, nothing more to do */
}

/*
 * This function gets called when a part of the kernel has a new latency
 * requirement.  This means we need to get all processors out of their C-state,
 * and then recalculate a new suitable C-state. Just do a cross-cpu IPI; that
 * wakes them all right up.
 * requirement.  This means we need to get only those processors out of their
 * C-state for which qos requirement is changed, and then recalculate a new
 * suitable C-state. Just do a cross-cpu IPI; that wakes them all right up.
 */
static int cpuidle_latency_notify(struct notifier_block *b,
		unsigned long l, void *v)
{
	wake_up_all_idle_cpus();
	const struct cpumask *cpus;

	cpus = v ?: cpu_online_mask;

	preempt_disable();
	smp_call_function_many(cpus, smp_callback, NULL, 1);
	preempt_enable();

	return NOTIFY_OK;
}