aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_pad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpi_pad.c')
-rw-r--r--drivers/acpi/acpi_pad.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index a43fa1a57d57..af4aad6ee2eb 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -36,6 +36,7 @@
36#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" 36#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
37#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 37#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
38static DEFINE_MUTEX(isolated_cpus_lock); 38static DEFINE_MUTEX(isolated_cpus_lock);
39static DEFINE_MUTEX(round_robin_lock);
39 40
40static unsigned long power_saving_mwait_eax; 41static unsigned long power_saving_mwait_eax;
41 42
@@ -107,7 +108,7 @@ static void round_robin_cpu(unsigned int tsk_index)
107 if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) 108 if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
108 return; 109 return;
109 110
110 mutex_lock(&isolated_cpus_lock); 111 mutex_lock(&round_robin_lock);
111 cpumask_clear(tmp); 112 cpumask_clear(tmp);
112 for_each_cpu(cpu, pad_busy_cpus) 113 for_each_cpu(cpu, pad_busy_cpus)
113 cpumask_or(tmp, tmp, topology_thread_cpumask(cpu)); 114 cpumask_or(tmp, tmp, topology_thread_cpumask(cpu));
@@ -116,7 +117,7 @@ static void round_robin_cpu(unsigned int tsk_index)
116 if (cpumask_empty(tmp)) 117 if (cpumask_empty(tmp))
117 cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); 118 cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus);
118 if (cpumask_empty(tmp)) { 119 if (cpumask_empty(tmp)) {
119 mutex_unlock(&isolated_cpus_lock); 120 mutex_unlock(&round_robin_lock);
120 return; 121 return;
121 } 122 }
122 for_each_cpu(cpu, tmp) { 123 for_each_cpu(cpu, tmp) {
@@ -131,7 +132,7 @@ static void round_robin_cpu(unsigned int tsk_index)
131 tsk_in_cpu[tsk_index] = preferred_cpu; 132 tsk_in_cpu[tsk_index] = preferred_cpu;
132 cpumask_set_cpu(preferred_cpu, pad_busy_cpus); 133 cpumask_set_cpu(preferred_cpu, pad_busy_cpus);
133 cpu_weight[preferred_cpu]++; 134 cpu_weight[preferred_cpu]++;
134 mutex_unlock(&isolated_cpus_lock); 135 mutex_unlock(&round_robin_lock);
135 136
136 set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); 137 set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu));
137} 138}
@@ -144,7 +145,7 @@ static void exit_round_robin(unsigned int tsk_index)
144} 145}
145 146
146static unsigned int idle_pct = 5; /* percentage */ 147static unsigned int idle_pct = 5; /* percentage */
147static unsigned int round_robin_time = 10; /* second */ 148static unsigned int round_robin_time = 1; /* second */
148static int power_saving_thread(void *data) 149static int power_saving_thread(void *data)
149{ 150{
150 struct sched_param param = {.sched_priority = 1}; 151 struct sched_param param = {.sched_priority = 1};
@@ -234,7 +235,7 @@ static int create_power_saving_task(void)
234 235
235 ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, 236 ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread,
236 (void *)(unsigned long)ps_tsk_num, 237 (void *)(unsigned long)ps_tsk_num,
237 "power_saving/%d", ps_tsk_num); 238 "acpi_pad/%d", ps_tsk_num);
238 rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0; 239 rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0;
239 if (!rc) 240 if (!rc)
240 ps_tsk_num++; 241 ps_tsk_num++;