From: Alexey Starikovskiy <aystarik@gmail.com>
To: Sitsofe Wheeler <sitsofe@yahoo.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: Reading EeePC900 battery info causes stalls
Date: Thu, 25 Sep 2008 12:47:46 +0400 [thread overview]
Message-ID: <48DB5032.8020604@gmail.com> (raw)
In-Reply-To: <gbduo8$nj4$1@ger.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]
Hi Sitsofe,
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.
Regards,
Alex.
Sitsofe Wheeler wrote:
> (Long thread that was originally posted over here:
> http://tinyurl.com/4akxa5 )
>
> I've found that when running on battery (and the battery is not full)
> the system will stall while battery information is read when using a
> non preemptive kernel.
>
> I can reliably hear the stalls at runlevel 1 by running
> speaker-test -b75000
> and
> watch --interval=1 cat /proc/acpi/battery/BAT0/info
> within separate terminals within screen.
>
> I have ftraces of the stalls but the traces become large very quickly.
> To that end I have disabled the tracing of certain functions to allow
> part of the traces to be produced.
>
> By doing counts across multiple runs I would say that the most
> frequently called functions are the following (in most frequently
> called order). The counts are definitely approximate but are
> reasonable relative to each other.
>
> 475325 acpi_os_release_object (acpi_ut_delete_generic_state)
> 406895 kmem_cache_free (acpi_os_release_object)
> 402838 kmem_cache_alloc (acpi_ut_create_generic_state)
> 132968 acpi_ut_update_ref_count (acpi_ut_update_object_reference)
> 131041 acpi_ut_pop_generic_state (acpi_ut_update_object_reference)
> 131036 acpi_ut_delete_generic_state (acpi_ut_update_object_reference)
> 131025 acpi_ut_create_generic_state (acpi_ut_create_update_state)
> 131023 acpi_ut_create_update_state_and_push
> (acpi_ut_update_object_reference)
> 131020 acpi_ut_create_update_state
> (acpi_ut_create_update_state_and_push)
> 131018 acpi_ut_push_generic_state (acpi_ut_create_update_state_and_push)
> 60147 acpi_ns_get_next_node (acpi_ns_delete_namespace_by_owner)
> 28974 acpi_ns_get_next_valid_node (acpi_ns_get_next_node)
>
>
> Here's the command line I used to disable the tracing of certain
> frequent functions:
>
> echo acpi_os_release_object > set_ftrace_notrace && echo kmem_cache_*
> >> set_ftrace_notrace && echo acpi_ut_* >> set_ftrace_notrace
>
> Logs with the filtering on can be seen here (15Mbytes decompressed each):
> http://sucs.org/~sits/test/eeepc-debug/20080923/latency_trace.gz
> http://sucs.org/~sits/test/eeepc-debug/20080923/trace.txt.gz
>
> I guess the aim is to find a good point to put cond_resched() or
> otherwise solve the latency issue.
>
[-- Attachment #2: add_cond_resched_to_ACPI.patch --]
[-- Type: text/x-diff, Size: 601 bytes --]
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 86c0388..3c715d0 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -143,6 +143,8 @@ void acpi_ex_reacquire_interpreter(void)
*
******************************************************************************/
+#include <linux/sched.h>
+
void acpi_ex_exit_interpreter(void)
{
acpi_status status;
@@ -154,7 +156,7 @@ void acpi_ex_exit_interpreter(void)
ACPI_ERROR((AE_INFO,
"Could not release AML Interpreter mutex"));
}
-
+ cond_resched();
return_VOID;
}
next prev parent reply other threads:[~2008-09-25 8:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 17:52 Reading EeePC900 battery info causes stalls Sitsofe Wheeler
2008-09-25 8:47 ` Alexey Starikovskiy [this message]
2008-09-25 9:35 ` Sitsofe Wheeler
2008-09-25 9:36 ` Sitsofe Wheeler
2008-09-25 9:54 ` Alexey Starikovskiy
2008-09-25 11:07 ` Alexey Starikovskiy
2008-09-25 11:56 ` Sitsofe Wheeler
2008-09-25 12:01 ` Alexey Starikovskiy
2008-09-25 14:57 ` Alexey Starikovskiy
2008-09-25 17:30 ` Sitsofe Wheeler
2008-09-25 11:17 ` Sitsofe Wheeler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DB5032.8020604@gmail.com \
--to=aystarik@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=sitsofe@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).