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

Commit a60187c2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpuidle: Wakeup only cpus for which qos has changed."

parents c1551685 479e9762
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;
}