Alexey Starikovskiy wrote:
Sitsofe Wheeler wrote:
Hi Alexey,
Alexey Starikovskiy wrote:
I think the least troubling place to add cond_resched() is then
ACPICA is exiting interpreter.
Please check if the attached patch helps with latencies.
There was no real change (latency was still bad). If you look at the
trace (before your patch) on
http://sucs.org/~sits/test/eeepc-debug/20080923/latency_trace.gz
(700kbyte compressed, 15Mbytes uncompressed) you can see that
acpi_ex_exit_interpreter is only called once near the end of the trace:
cat-5901 0.N.. 270496us : acpi_ex_exit_interpreter
(acpi_ev_address_space_dispatch)
By then the time had already been racked up...
Ok, let's add it to the end of acpi_ps_complete_op() then... They
appear every 100usec or so...
acpi_ps_parse_aml() is called not so often (~10000usec), so maybe it is
a "sweet spot"
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index 15e1702..ceab67c 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -439,6 +439,8 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
*
******************************************************************************/
+#include <linux/sched.h>
+
acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
{
acpi_status status;
@@ -688,5 +690,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
acpi_ut_delete_generic_state(ACPI_CAST_PTR
(union acpi_generic_state, thread));
acpi_gbl_current_walk_list = prev_walk_list;
+ cond_resched();
return_ACPI_STATUS(status);
}