Commit 336ee08b authored by Andy Grover's avatar Andy Grover

Change idle policy a little

Use acpi_os_free instead of kfree directly
Eliminate CONFIG_SMP ifdef and simplify errata.smp code
parent a218fbda
/* /*
* acpi_processor.c - ACPI Processor Driver ($Revision: 66 $) * acpi_processor.c - ACPI Processor Driver ($Revision: 69 $)
* *
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
...@@ -616,8 +616,15 @@ acpi_processor_set_power_policy ( ...@@ -616,8 +616,15 @@ acpi_processor_set_power_policy (
* Set the default C1 promotion and C2 demotion policies, where we * Set the default C1 promotion and C2 demotion policies, where we
* promote from C1 to C2 after several (10) successive C1 transitions, * promote from C1 to C2 after several (10) successive C1 transitions,
* as we cannot (currently) measure the time spent in C1. Demote from * as we cannot (currently) measure the time spent in C1. Demote from
* C2 to C1 after experiencing several (4) 'shorts' (time spent in C2 * C2 to C1 anytime we experience a 'short' (time spent in C2 is less
* is less than the C2 transtion latency). * than the C2 transtion latency). Note the simplifying assumption
* that the 'cost' of a transition is amortized when we sleep for at
* least as long as the transition's latency (thus the total transition
* time is two times the latency).
*
* TBD: Measure C1 sleep times by instrumenting the core IRQ handler.
* TBD: Demote to default C-State after long periods of activity.
* TBD: Investigate policy's use of CPU utilization -vs- sleep duration.
*/ */
if (pr->power.states[ACPI_STATE_C2].valid) { if (pr->power.states[ACPI_STATE_C2].valid) {
pr->power.states[ACPI_STATE_C1].promotion.threshold.count = 10; pr->power.states[ACPI_STATE_C1].promotion.threshold.count = 10;
...@@ -625,7 +632,7 @@ acpi_processor_set_power_policy ( ...@@ -625,7 +632,7 @@ acpi_processor_set_power_policy (
pr->power.states[ACPI_STATE_C2].latency_ticks; pr->power.states[ACPI_STATE_C2].latency_ticks;
pr->power.states[ACPI_STATE_C1].promotion.state = ACPI_STATE_C2; pr->power.states[ACPI_STATE_C1].promotion.state = ACPI_STATE_C2;
pr->power.states[ACPI_STATE_C2].demotion.threshold.count = 4; pr->power.states[ACPI_STATE_C2].demotion.threshold.count = 1;
pr->power.states[ACPI_STATE_C2].demotion.threshold.ticks = pr->power.states[ACPI_STATE_C2].demotion.threshold.ticks =
pr->power.states[ACPI_STATE_C2].latency_ticks; pr->power.states[ACPI_STATE_C2].latency_ticks;
pr->power.states[ACPI_STATE_C2].demotion.state = ACPI_STATE_C1; pr->power.states[ACPI_STATE_C2].demotion.state = ACPI_STATE_C1;
...@@ -929,7 +936,7 @@ acpi_processor_get_performance_control ( ...@@ -929,7 +936,7 @@ acpi_processor_get_performance_control (
pr->performance.status_register)); pr->performance.status_register));
end: end:
kfree(buffer.pointer); acpi_os_free(buffer.pointer);
return_VALUE(result); return_VALUE(result);
} }
...@@ -1006,7 +1013,7 @@ acpi_processor_get_performance_states ( ...@@ -1006,7 +1013,7 @@ acpi_processor_get_performance_states (
} }
end: end:
kfree(buffer.pointer); acpi_os_free(buffer.pointer);
return_VALUE(result); return_VALUE(result);
} }
...@@ -2059,11 +2066,8 @@ acpi_processor_get_info ( ...@@ -2059,11 +2066,8 @@ acpi_processor_get_info (
if (!pr) if (!pr)
return_VALUE(-EINVAL); return_VALUE(-EINVAL);
#ifdef CONFIG_SMP
/* FIXME: What should this be? -- RR */
if (num_online_cpus() > 1) if (num_online_cpus() > 1)
errata.smp = num_online_cpus(); errata.smp = TRUE;
#endif
acpi_processor_errata(pr); acpi_processor_errata(pr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment