diff options
Diffstat (limited to 'kernel/cpu.c')
| -rw-r--r-- | kernel/cpu.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 65098b44518..42605460b8d 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -19,6 +19,7 @@ #include <linux/mutex.h> #include <linux/gfp.h> #include <linux/suspend.h> +#include <trace/events/power.h> #include <trace/events/sched.h> @@ -346,8 +347,8 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) * * Wait for the stop thread to go away. */ - while (!idle_cpu(cpu)) - cpu_relax(); + while (!idle_cpu_relaxed(cpu)) + cpu_read_relax(); /* This actually kills the CPU. */ __cpu_die(cpu); @@ -369,6 +370,8 @@ int __ref cpu_down(unsigned int cpu) { int err; + trace_cpu_hotplug(cpu, POWER_CPU_DOWN_START); + cpu_maps_update_begin(); if (cpu_hotplug_disabled) { @@ -380,6 +383,7 @@ int __ref cpu_down(unsigned int cpu) out: cpu_maps_update_done(); + trace_cpu_hotplug(cpu, POWER_CPU_DOWN_DONE); return err; } EXPORT_SYMBOL(cpu_down); @@ -449,6 +453,8 @@ int __cpuinit cpu_up(unsigned int cpu) pg_data_t *pgdat; #endif + trace_cpu_hotplug(cpu, POWER_CPU_UP_START); + if (!cpu_possible(cpu)) { printk(KERN_ERR "can't online cpu %d because it is not " "configured as may-hotadd at boot time\n", cpu); @@ -492,6 +498,7 @@ int __cpuinit cpu_up(unsigned int cpu) out: cpu_maps_update_done(); + trace_cpu_hotplug(cpu, POWER_CPU_UP_DONE); return err; } EXPORT_SYMBOL_GPL(cpu_up); @@ -726,10 +733,12 @@ void set_cpu_present(unsigned int cpu, bool present) void set_cpu_online(unsigned int cpu, bool online) { - if (online) + if (online) { cpumask_set_cpu(cpu, to_cpumask(cpu_online_bits)); - else + cpumask_set_cpu(cpu, to_cpumask(cpu_active_bits)); + } else { cpumask_clear_cpu(cpu, to_cpumask(cpu_online_bits)); + } } void set_cpu_active(unsigned int cpu, bool active) |
