Merge "sched: Ensure proper synch between isolation, hotplug, and suspend"
This commit is contained in:
commit
9aa1df0cf5
2 changed files with 7 additions and 13 deletions
|
@ -5682,7 +5682,7 @@ int sched_isolate_cpu(int cpu)
|
||||||
if (trace_sched_isolate_enabled())
|
if (trace_sched_isolate_enabled())
|
||||||
start_time = sched_clock();
|
start_time = sched_clock();
|
||||||
|
|
||||||
lock_device_hotplug();
|
cpu_maps_update_begin();
|
||||||
|
|
||||||
cpumask_andnot(&avail_cpus, cpu_online_mask, cpu_isolated_mask);
|
cpumask_andnot(&avail_cpus, cpu_online_mask, cpu_isolated_mask);
|
||||||
|
|
||||||
|
@ -5731,7 +5731,7 @@ int sched_isolate_cpu(int cpu)
|
||||||
sched_update_group_capacities(cpu);
|
sched_update_group_capacities(cpu);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
unlock_device_hotplug();
|
cpu_maps_update_done();
|
||||||
trace_sched_isolate(cpu, cpumask_bits(cpu_isolated_mask)[0],
|
trace_sched_isolate(cpu, cpumask_bits(cpu_isolated_mask)[0],
|
||||||
start_time, 1);
|
start_time, 1);
|
||||||
return ret_code;
|
return ret_code;
|
||||||
|
@ -5752,8 +5752,6 @@ int sched_unisolate_cpu_unlocked(int cpu)
|
||||||
if (trace_sched_isolate_enabled())
|
if (trace_sched_isolate_enabled())
|
||||||
start_time = sched_clock();
|
start_time = sched_clock();
|
||||||
|
|
||||||
lock_device_hotplug_assert();
|
|
||||||
|
|
||||||
if (!cpu_isolation_vote[cpu]) {
|
if (!cpu_isolation_vote[cpu]) {
|
||||||
ret_code = -EINVAL;
|
ret_code = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -5792,9 +5790,9 @@ int sched_unisolate_cpu(int cpu)
|
||||||
{
|
{
|
||||||
int ret_code;
|
int ret_code;
|
||||||
|
|
||||||
lock_device_hotplug();
|
cpu_maps_update_begin();
|
||||||
ret_code = sched_unisolate_cpu_unlocked(cpu);
|
ret_code = sched_unisolate_cpu_unlocked(cpu);
|
||||||
unlock_device_hotplug();
|
cpu_maps_update_done();
|
||||||
return ret_code;
|
return ret_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -893,14 +893,10 @@ static int __ref cpu_callback(struct notifier_block *nfb,
|
||||||
unsigned int need;
|
unsigned int need;
|
||||||
int ret = NOTIFY_OK;
|
int ret = NOTIFY_OK;
|
||||||
|
|
||||||
/* Don't affect suspend resume */
|
|
||||||
if (action & CPU_TASKS_FROZEN)
|
|
||||||
return NOTIFY_OK;
|
|
||||||
|
|
||||||
if (unlikely(!cluster || !cluster->inited))
|
if (unlikely(!cluster || !cluster->inited))
|
||||||
return NOTIFY_OK;
|
return NOTIFY_OK;
|
||||||
|
|
||||||
switch (action) {
|
switch (action & ~CPU_TASKS_FROZEN) {
|
||||||
case CPU_UP_PREPARE:
|
case CPU_UP_PREPARE:
|
||||||
|
|
||||||
/* If online state of CPU somehow got out of sync, fix it. */
|
/* If online state of CPU somehow got out of sync, fix it. */
|
||||||
|
@ -1095,7 +1091,7 @@ static int __init core_ctl_init(void)
|
||||||
cpufreq_register_notifier(&cpufreq_pol_nb, CPUFREQ_POLICY_NOTIFIER);
|
cpufreq_register_notifier(&cpufreq_pol_nb, CPUFREQ_POLICY_NOTIFIER);
|
||||||
cpufreq_register_notifier(&cpufreq_gov_nb, CPUFREQ_GOVINFO_NOTIFIER);
|
cpufreq_register_notifier(&cpufreq_gov_nb, CPUFREQ_GOVINFO_NOTIFIER);
|
||||||
|
|
||||||
lock_device_hotplug();
|
cpu_maps_update_begin();
|
||||||
for_each_online_cpu(cpu) {
|
for_each_online_cpu(cpu) {
|
||||||
struct cpufreq_policy *policy;
|
struct cpufreq_policy *policy;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1109,7 +1105,7 @@ static int __init core_ctl_init(void)
|
||||||
cpufreq_cpu_put(policy);
|
cpufreq_cpu_put(policy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlock_device_hotplug();
|
cpu_maps_update_done();
|
||||||
initialized = true;
|
initialized = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue